Public Member Functions

tjarray< V, T > Class Template Reference
[Classes for basic data types and vectors/arrays (tjutils library)]

#include <tjarray.h>

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

List of all members.

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)
STD_string printbody () const
ndim create_index (unsigned long index) const

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

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

default constructor

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

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

copy constructor

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

conversion from fvector to 1-dim array

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

constructs an array according to an extent 'nn'


Member Function Documentation

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

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.

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

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

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

returns the dimensionality

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

returns the size of each element in bytes

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

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

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

returns the total number of elements

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

returns the readonly element with index firstIndex,...

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

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

returns the element indexed by the extent vector ii

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

returns the element with index firstIndex,...

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

assigns 'value' to all elements

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

Copy assignment

template<class V, class T>
STD_string tjarray< V, T >::printbody (  )  const

returns the elements of the array as a formatted string

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.

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.

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)

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

returns the extent in the i'th dimension

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

returns the total number of elements


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