Public Member Functions | Friends | List of all members

#include <tjarray.h>

Inheritance diagram for tjarray< V, T >:
Inheritance graph
[legend]

Public Member Functions

 tjarray ()
 
 tjarray (unsigned long n1)
 
 tjarray (const tjarray< V, T > &ta)
 
 tjarray (const V &sv)
 
 tjarray (const ndim &nn)
 
tjarray< V, T > & operator= (const tjarray< V, T > &ta)
 
tjarray< V, T > & operator= (const T &value)
 
V & resize (unsigned int newsize)
 
tjarray< V, T > & redim (const ndim &nn)
 
tjarray< V, T > & redim (unsigned long n1)
 
tjarray< V, T > & autosize ()
 
const ndimget_extent () const
 
T & operator() (const ndim &ii)
 
const T & operator() (const ndim &ii) const
 
T & operator() (unsigned long n1)
 
const T & operator() (unsigned long n1) const
 
unsigned long dim () const
 
unsigned long size (unsigned long i) const
 
unsigned long total () const
 
unsigned long length () const
 
unsigned int elementsize () const
 
tjarray< V, T > & assignValues (const tjarray< V, T > &ta)
 
tjarray< V, T > & copy (const tjarray< V, T > &ta)
 
ndim create_index (unsigned long index) const
 

Friends

STD_ostream & operator<< (STD_ostream &s, const tjarray< V, T > &ta)
 

Detailed Description

template<class V, class T>
class tjarray< V, T >

This class represents a multidimensional array. It is implemented by deriving it from a one dimensional vector which holds the data and adding a member of type 'ndim' that contains the information about the extent in each dimension.

Definition at line 155 of file tjarray.h.

Constructor & Destructor Documentation

§ tjarray() [1/5]

template<class V, class T>
tjarray< V, T >::tjarray ( )

default constructor

§ tjarray() [2/5]

template<class V, class T>
tjarray< V, T >::tjarray ( unsigned long  n1)

constructs an array of dimensionality 'dim' and allocates memory for i,j,... values

§ tjarray() [3/5]

template<class V, class T>
tjarray< V, T >::tjarray ( const tjarray< V, T > &  ta)

copy constructor

§ tjarray() [4/5]

template<class V, class T>
tjarray< V, T >::tjarray ( const V &  sv)

conversion from fvector to 1-dim array

§ tjarray() [5/5]

template<class V, class T>
tjarray< V, T >::tjarray ( const ndim nn)

constructs an array according to an extent 'nn'

Member Function Documentation

§ assignValues()

template<class V, class T>
tjarray<V,T>& tjarray< V, T >::assignValues ( const tjarray< V, T > &  ta)

If the size of the given array 'ta' matches this object, all values from 'ta' will be assigned to this

§ autosize()

template<class V, class T>
tjarray<V,T>& tjarray< V, T >::autosize ( )
inline

Remove all dimensions with a size of 1 from the extent vector

Definition at line 244 of file tjarray.h.

§ copy()

template<class V, class T>
tjarray<V,T>& tjarray< V, T >::copy ( const tjarray< V, T > &  ta)

The array will be resized to the size of ta and all values from 'ta' will be assigned to this

§ create_index()

template<class V, class T>
ndim tjarray< V, T >::create_index ( unsigned long  index) const

Converts a linear index to a tuple of indices in the array

§ dim()

template<class V, class T>
unsigned long tjarray< V, T >::dim ( ) const

returns the dimensionality

§ elementsize()

template<class V, class T>
unsigned int tjarray< V, T >::elementsize ( ) const

returns the size of each element in bytes

§ get_extent()

template<class V, class T>
const ndim& tjarray< V, T >::get_extent ( ) const

Get the extent vector, i.e. the information about the dimensions

§ length()

template<class V, class T>
unsigned long tjarray< V, T >::length ( ) const

returns the total number of elements

§ operator()() [1/4]

template<class V, class T>
T& tjarray< V, T >::operator() ( const ndim ii)

returns the element indexed by the extent vector ii

§ operator()() [2/4]

template<class V, class T>
const T& tjarray< V, T >::operator() ( const ndim ii) const

returns the readonly element indexed by the extent vector ii

§ operator()() [3/4]

template<class V, class T>
T& tjarray< V, T >::operator() ( unsigned long  n1)

returns the element with index firstIndex,...

§ operator()() [4/4]

template<class V, class T>
const T& tjarray< V, T >::operator() ( unsigned long  n1) const

returns the readonly element with index firstIndex,...

§ operator=() [1/2]

template<class V, class T>
tjarray<V,T>& tjarray< V, T >::operator= ( const tjarray< V, T > &  ta)

Copy assignment

§ operator=() [2/2]

template<class V, class T>
tjarray<V,T>& tjarray< V, T >::operator= ( const T &  value)

assigns 'value' to all elements

§ redim() [1/2]

template<class V, class T>
tjarray<V,T>& tjarray< V, T >::redim ( const ndim nn)

Redimensionalize and resize the array according to the given extent vector. If the total number of values does not change, the array is simply reshaped but the values are preserved.

§ redim() [2/2]

template<class V, class T>
tjarray<V,T>& tjarray< V, T >::redim ( unsigned long  n1)

Redimensionalize and resize the array according to the given extent vector If the total number of values does not change, the array is simply reshaped but the values are preserved.

§ resize()

template<class V, class T>
V& tjarray< V, T >::resize ( unsigned int  newsize)

Resize the array, that is create a 1-dim array with the given new size (virtual)

§ size()

template<class V, class T>
unsigned long tjarray< V, T >::size ( unsigned long  i) const

returns the extent in the i'th dimension

§ total()

template<class V, class T>
unsigned long tjarray< V, T >::total ( ) const

returns the total number of elements

Friends And Related Function Documentation

§ operator<<

template<class V, class T>
STD_ostream& operator<< ( STD_ostream &  s,
const tjarray< V, T > &  ta 
)
friend

prints array to the stream s

Definition at line 341 of file tjarray.h.


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