concepts::MultiArray< 1, T > Class Template Reference

Container typename for multidimensional Array which is based on std::map. More...

#include <multiArray.hh>

Inheritance diagram for concepts::MultiArray< 1, T >:
concepts::OutputOperator

Classes

class  Scanner
 Class for scanning (iterating) over the array in all dimensions. More...
 

Public Member Functions

void clear ()
 Clears the array. More...
 
void erase (const uint i[1])
 Erase entry i. More...
 
void erase (uint i)
 
void erase_last ()
 
bool isElm (const uint i) const
 
bool isElm (const uint i[1]) const
 Checks if the element exists. More...
 
 MultiArray (bool commutable=false)
 Constructor. More...
 
T & operator[] (const uint i)
 Index operator for the container. More...
 
const T & operator[] (const uint i) const
 Index operator for the container. More...
 
T & operator[] (const uint i[1])
 Index operator for the container. More...
 
const T & operator[] (const uint i[1]) const
 Index operator for the container. More...
 
Scanner * scan () const
 Scanner over the entrances. More...
 
uint size () const
 Number of entrances. More...
 
 ~MultiArray ()
 

Protected Member Functions

virtual std::ostream & info (std::ostream &os) const
 Returns information in an output stream. More...
 

Private Attributes

std::map< uint, T > data_
 array of T More...
 

Detailed Description

template<typename T>
class concepts::MultiArray< 1, T >

Container typename for multidimensional Array which is based on std::map.

First level, 1-dimensional array

Definition at line 445 of file multiArray.hh.

Constructor & Destructor Documentation

◆ MultiArray()

template<typename T >
concepts::MultiArray< 1, T >::MultiArray ( bool  commutable = false)
inline

Constructor.

Commutability for one-dimensional array not important, its here for the recursive definition.

Definition at line 481 of file multiArray.hh.

◆ ~MultiArray()

template<typename T >
concepts::MultiArray< 1, T >::~MultiArray ( )
inline

Definition at line 485 of file multiArray.hh.

Member Function Documentation

◆ clear()

template<typename T >
void concepts::MultiArray< 1, T >::clear ( )
inline

Clears the array.

Definition at line 534 of file multiArray.hh.

◆ erase() [1/2]

template<typename T >
void concepts::MultiArray< 1, T >::erase ( const uint  i[1])
inline

Erase entry i.

Definition at line 520 of file multiArray.hh.

◆ erase() [2/2]

template<typename T >
void concepts::MultiArray< 1, T >::erase ( uint  i)
inline

Definition at line 521 of file multiArray.hh.

◆ erase_last()

template<typename T >
void concepts::MultiArray< 1, T >::erase_last ( )
inline

Definition at line 525 of file multiArray.hh.

◆ info()

template<typename T >
std::ostream & concepts::MultiArray< 1, T >::info ( std::ostream &  os) const
protectedvirtual

Returns information in an output stream.

Reimplemented from concepts::OutputOperator.

Definition at line 557 of file multiArray.hh.

◆ isElm() [1/2]

template<typename T >
bool concepts::MultiArray< 1, T >::isElm ( const uint  i) const

Definition at line 551 of file multiArray.hh.

◆ isElm() [2/2]

template<typename T >
bool concepts::MultiArray< 1, T >::isElm ( const uint  i[1]) const
inline

Checks if the element exists.

Definition at line 516 of file multiArray.hh.

◆ operator[]() [1/4]

template<typename T >
T& concepts::MultiArray< 1, T >::operator[] ( const uint  i)
inline

Index operator for the container.

If an item is not existing, it is created, inserted into the array and then returned.

Returns
The i-th element of the array.

Definition at line 506 of file multiArray.hh.

◆ operator[]() [2/4]

template<typename T >
const T & concepts::MultiArray< 1, T >::operator[] ( const uint  i) const

Index operator for the container.

Returns
The i-th element of the array.

Definition at line 543 of file multiArray.hh.

◆ operator[]() [3/4]

template<typename T >
T& concepts::MultiArray< 1, T >::operator[] ( const uint  i[1])
inline

Index operator for the container.

If an item is not existing, it is created, inserted into the array and then returned.

Returns
The (i[0])th element of the array.

Definition at line 493 of file multiArray.hh.

◆ operator[]() [4/4]

template<typename T >
const T& concepts::MultiArray< 1, T >::operator[] ( const uint  i[1]) const
inline

Index operator for the container.

Returns
The (i[0])th element of the array.

Definition at line 498 of file multiArray.hh.

◆ scan()

template<typename T >
Scanner* concepts::MultiArray< 1, T >::scan ( ) const
inline

Scanner over the entrances.

Definition at line 513 of file multiArray.hh.

◆ size()

template<typename T >
uint concepts::MultiArray< 1, T >::size ( ) const
inline

Number of entrances.

Definition at line 531 of file multiArray.hh.

Member Data Documentation

◆ data_

template<typename T >
std::map<uint, T> concepts::MultiArray< 1, T >::data_
private

array of T

Definition at line 539 of file multiArray.hh.


The documentation for this class was generated from the following file:
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich