ODIN
|
#include <tjarray.h>
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 ndim & | get_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) |
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.
constructs an array of dimensionality 'dim' and allocates memory for i,j,... values
copy constructor
conversion from fvector to 1-dim array
constructs an array according to an extent 'nn'
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
The array will be resized to the size of ta and all values from 'ta' will be assigned to this
Converts a linear index to a tuple of indices in the array
unsigned long tjarray< V, T >::dim | ( | ) | const |
returns the dimensionality
unsigned int tjarray< V, T >::elementsize | ( | ) | const |
returns the size of each element in bytes
Get the extent vector, i.e. the information about the dimensions
unsigned long tjarray< V, T >::length | ( | ) | const |
returns the total number of elements
returns the element indexed by the extent vector ii
returns the readonly element indexed by the extent vector ii
T& tjarray< V, T >::operator() | ( | unsigned long | n1 | ) |
returns the element with index firstIndex,...
const T& tjarray< V, T >::operator() | ( | unsigned long | n1 | ) | const |
returns the readonly element with index firstIndex,...
assigns 'value' to all elements
Copy assignment
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.
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.
V& tjarray< V, T >::resize | ( | unsigned int | newsize | ) |
Resize the array, that is create a 1-dim array with the given new size (virtual)
unsigned long tjarray< V, T >::size | ( | unsigned long | i | ) | const |
returns the extent in the i'th dimension
unsigned long tjarray< V, T >::total | ( | ) | const |
returns the total number of elements
|
friend |