concepts::MultiArray< dim, T > Class Template Reference
Container typename for multidimensional Array which is based on std::map. More...
#include <multiArray.hh>
Classes | |
class | Scanner |
Class for scanning (iterating) over the array in all dimensions. More... | |
Public Member Functions | |
void | clear () |
Clears the array. More... | |
void | commute (uint i[dim]) const |
if commutable_ then order the smallest index to front More... | |
void | erase (const uint i[dim]) |
Erase entry i . More... | |
void | erase (uint i[dim]) |
void | erase_last () |
Erase last entry. More... | |
bool | isElm (const uint i[dim]) const |
Checks if the element exists. More... | |
bool | isElm (uint i[dim]) const |
MultiArray (bool commutable=false) | |
Constructor If commutable then the order of the indices is not important, e.g. More... | |
T & | operator[] (const uint i[dim]) |
Index operator for the container. More... | |
const T & | operator[] (const uint i[dim]) const |
Index operator for the container. More... | |
T & | operator[] (uint i[dim]) |
const T & | operator[] (uint i[dim]) const |
Scanner * | scan () const |
uint | size () const |
Size. More... | |
~MultiArray () | |
Protected Member Functions | |
virtual std::ostream & | info (std::ostream &os) const |
Private Attributes | |
const bool | commutable_ |
flag for commutability More... | |
std::map< uint, MultiArray< dim-1, T > > | data_ |
array of arrays of the dimension dim-1 More... | |
Detailed Description
template<uint dim, typename T>
class concepts::MultiArray< dim, T >
Container typename for multidimensional Array which is based on std::map.
Is recursivly defined.
Definition at line 33 of file multiArray.hh.
Constructor & Destructor Documentation
◆ MultiArray()
|
inline |
Constructor If commutable
then the order of the indices is not important, e.g.
(i,j) and (j,i) have the same entrance.
Definition at line 234 of file multiArray.hh.
◆ ~MultiArray()
|
inline |
Definition at line 235 of file multiArray.hh.
Member Function Documentation
◆ clear()
void concepts::MultiArray< dim, T >::clear |
Clears the array.
Definition at line 403 of file multiArray.hh.
◆ commute()
void concepts::MultiArray< dim, T >::commute | ( | uint | i[dim] | ) | const |
if commutable_
then order the smallest index to front
Definition at line 354 of file multiArray.hh.
◆ erase() [1/2]
void concepts::MultiArray< dim, T >::erase | ( | const uint | i[dim] | ) |
Erase entry i
.
Definition at line 364 of file multiArray.hh.
◆ erase() [2/2]
void concepts::MultiArray< dim, T >::erase | ( | uint | i[dim] | ) |
◆ erase_last()
void concepts::MultiArray< dim, T >::erase_last |
Erase last entry.
Definition at line 386 of file multiArray.hh.
◆ info()
|
protectedvirtual |
Definition at line 411 of file multiArray.hh.
◆ isElm() [1/2]
bool concepts::MultiArray< dim, T >::isElm | ( | const uint | i[dim] | ) | const |
Checks if the element exists.
Definition at line 337 of file multiArray.hh.
◆ isElm() [2/2]
bool concepts::MultiArray< dim, T >::isElm | ( | uint | i[dim] | ) | const |
◆ operator[]() [1/4]
T & concepts::MultiArray< dim, T >::operator[] | ( | const uint | i[dim] | ) |
Index operator for the container.
If an item is not existing, it is created, inserted into the array and then returned.
- Returns
- The (i,j)th element of the array.
Definition at line 280 of file multiArray.hh.
◆ operator[]() [2/4]
const T & concepts::MultiArray< dim, T >::operator[] | ( | const uint | i[dim] | ) | const |
Index operator for the container.
- Returns
- The (i,j)th element of the array.
Definition at line 311 of file multiArray.hh.
◆ operator[]() [3/4]
T& concepts::MultiArray< dim, T >::operator[] | ( | uint | i[dim] | ) |
◆ operator[]() [4/4]
const T& concepts::MultiArray< dim, T >::operator[] | ( | uint | i[dim] | ) | const |
◆ scan()
|
inline |
Definition at line 252 of file multiArray.hh.
◆ size()
uint concepts::MultiArray< dim, T >::size |
Size.
Definition at line 393 of file multiArray.hh.
Member Data Documentation
◆ commutable_
|
private |
flag for commutability
Definition at line 276 of file multiArray.hh.
◆ data_
|
private |
array of arrays of the dimension dim-1
Definition at line 274 of file multiArray.hh.
The documentation for this class was generated from the following file:
- toolbox/multiArray.hh