27 #include "../common/STLUtils.h" 51 while (it != rhs.
m_data.end())
53 m_data[it->first] = it->second->clone();
73 while (it != rhs.
m_data.end())
75 m_data[it->first] = it->second->clone();
138 return new Array(*
this);
143 std::ostringstream output;
145 std::size_t total_size = 1;
147 std::vector<std::size_t> products_back (
getDimension(), 1);
149 std::vector<std::size_t> products_front (
getDimension(), 1);
158 for (std::size_t
b = 0;
b < i;
b++)
162 std::vector<std::vector<std::size_t> > poses(total_size, std::vector<std::size_t>(
getDimension(), 0));
169 for (std::size_t j = 0; j < products_back[i]; j++)
171 for (std::size_t l = 0; l < products_front[i]; l++)
177 for (std::size_t i = 0; i < poses.size(); i++)
182 output << it->second->toString() <<
" ";
int m_type
The data type of this array.
V * GetPValue(const std::map< K, V * > &m, const K &k)
It finds for a given key in the map and returns a pointer if something is found or NULL otherwise...
AbstractData * clone() const
It creates a new clone of the array.
std::vector< std::size_t > m_dimensionSizes
The vector of sizes for the dimensions.
int getElementsTypeCode()
Returns the data type of the elements of the array.
Array & operator=(const Array &rhs)
Assignment operator.
Class for dealing with arrays of abstract data.
The type for variable-length multidimensional arrays.
std::size_t getDimension() const
Returns the numbe of dimensions of the array.
te::dt::AbstractData & operator[](const std::vector< std::size_t > &i)
Access data in i index.
static te::dt::DateTime d(2010, 8, 9, 15, 58, 39)
std::string toString() const
Return a string with all the data inside array.
A base class for values that can be retrieved from the data access module.
std::size_t m_dimension
The number of dimensions.
te::dt::AbstractData * getData(const std::vector< std::size_t > &i)
Returns data from specified position.
Array(std::size_t d, int t)
Multi-dimensional array constructor.
std::size_t getDimensionSize(std::size_t i) const
Gets the number of elements in the i-th dimension.
void FreeContents(boost::unordered_map< K, V * > &m)
This function can be applied to a map of pointers. It will delete each pointer in the map...
void insert(te::dt::AbstractData *data, const std::vector< std::size_t > &pos)
Inserts data into specified position.
std::map< std::vector< std::size_t >, te::dt::AbstractData * > m_data
A map from positions to data.