Modigliani  2.0
A stochastic simulator for axons, neurons, and networks
Public Member Functions | List of all members
modigliani_base::Multidim_array< T > Class Template Reference

Multidimensional array. More...

+ Inheritance diagram for modigliani_base::Multidim_array< T >:

Public Member Functions

 Multidim_array (Size d, Size n)
 Constructs a multidim array. More...
 
virtual ~Multidim_array ()
 Destructor.
 
T & Elem (const std::vector< Size > &coordinateVec)
 Access element at given coordinate position. More...
 
const T & ElemByIndex (Size index) const
 access a element with a "meaningless" index More...
 
void SetAll (const T &val)
 Sets all the elements to the given input. More...
 
T & Elem (Size index1...)
 Access element at given coordinate position. More...
 
Size TotalNumElem () const
 Returns total number of elements in the array. More...
 

Detailed Description

template<class T>
class modigliani_base::Multidim_array< T >

Multidimensional array.

Implements a regular - multidimensional, i.e. a "dim"-diemsional hypercube with "num" elements per dimension.

Constructor & Destructor Documentation

template<class T >
modigliani_base::Multidim_array< T >::Multidim_array ( Size  d,
Size  n 
)
inline

Constructs a multidim array.

Parameters
dNumber of dimensions
nNumber of elements

Member Function Documentation

template<class T >
T& modigliani_base::Multidim_array< T >::Elem ( const std::vector< Size > &  coordinateVec)
inline

Access element at given coordinate position.

Parameters
coordinateVecVector of coordinates
Returns
Element at the index
Warning
No range checking done on the coordinates
template<class T >
T& modigliani_base::Multidim_array< T >::Elem ( Size  index1...)
inline

Access element at given coordinate position.

Parameters
index1Indexes
Returns
Element
Warning
No range checking done on the coordinates
template<class T >
const T& modigliani_base::Multidim_array< T >::ElemByIndex ( Size  index) const
inline

access a element with a "meaningless" index

The index is guaranteed to touch all elements but has no assigned meaning as to the position of element in relation to others. However index is guaranteed to be in $[0,num^dim]$ and will touch all elements once.

Parameters
indexThe index
Returns
The element at given index
Warning
Arbitrary index, no information inferable from the index, might change anytime (only range remains guaranteed).
template<class T >
void modigliani_base::Multidim_array< T >::SetAll ( const T &  val)
inline

Sets all the elements to the given input.

Parameters
valInput value
template<class T >
Size modigliani_base::Multidim_array< T >::TotalNumElem ( ) const
inline

Returns total number of elements in the array.

Returns
Number of elements

The documentation for this class was generated from the following file: