ltl::MArray< T, N > Class Template Reference
[The Class MArray]

A dynamic N-dimensional array storing objects of type T. More...

List of all members.

Public Types

STL definitions:

Public Member Functions

Construct an (optionally mapped) array of rank N with ltl::Range size arguments.
Construct an array of rank N with int size arguments.
Index ranges {1..ni, i=1..N}, int arguments, base defaults to 1.

Constructors for pure subarrays (rank preserved)
Other array's data is referenced, NOT copied ( use operator=() for copy)! Missing arguments are treated as Range::all() !

Construct from preexisting data.
The array dims[] holds the lengths of each dimension (The number of dimensions, and hence the length of dims[] is known from the template parameter N.) No checking is performed. The index ranges are {1..dims[i]} along each dimension i.

Operator=, other's data is copied, own data overwritten
Overloaded X= operators. There is a version for an
 MArray 
rhs, an expression rhs, and a literal rhs for each operator. To have a single implementation of mathematical operations for scalar and vectorized code (where the C language extensions do not define X= ), we transform the
 A x= E 
assignment into
 A = A x E 
and call
 operator= 
.

Elementwise array access (indexing) via operator()
int / ltl::FixedVector arguments, return (reference to) element.

'Cutting' array access (indexing) via operator()
ltl::Range arguments, return (reference to) element.

Change bases:
Change the bases of the array (the bases are the first indices of each dimension)

Array information:
Interfaces ltl::Shape.

Reverse and Transpose:
Reorder array (without copy). Very fast!

Public Attributes

Protected Member Functions

Protected Attributes

Friends

Related Functions

(Note that these are not member functions.)

Detailed Description

template<class T, int N>
class ltl::MArray< T, N >

A dynamic N-dimensional array storing objects of type T.

MArrays feature subarrays (sometimes called views), slices, expression templated evaluation, and other features described below. The memory holding the actual data is reference counted, such that it is not freed until the last reference to the data by views or slices has been removed.


Member Typedef Documentation

template<class T, int N>
typedef MArrayIter<T,N> ltl::MArray< T, N >::Iterator

template<class T, int N>
typedef MArrayIterConst<T,N> ltl::MArray< T, N >::ConstIterator

template<class T, int N>
typedef IndexIter<T,N> ltl::MArray< T, N >::IndexIterator

Index iterator for ltl::where() (indexing arbitrary subsets).

template<class T, int N>
typedef FixedVector<int,N> ltl::MArray< T, N >::IndexV

template<class T, int N>
typedef IndexList<N> ltl::MArray< T, N >::IndexSet

template<class T, int N>
typedef T ltl::MArray< T, N >::value_type

template<class T, int N>
typedef T& ltl::MArray< T, N >::reference

template<class T, int N>
typedef const T& ltl::MArray< T, N >::const_reference

template<class T, int N>
typedef T* ltl::MArray< T, N >::pointer

template<class T, int N>
typedef const T* ltl::MArray< T, N >::const_pointer

template<class T, int N>
typedef size_t ltl::MArray< T, N >::size_type

template<class T, int N>
typedef MArrayIter<T,N> ltl::MArray< T, N >::iterator

template<class T, int N>
typedef MArrayIterConst<T,N> ltl::MArray< T, N >::const_iterator


Constructor & Destructor Documentation

template<class T, int N>
ltl::MArray< T, N >::MArray (  )  [inline]

Construct an array without allocating memory.

This is useful for constructing MArrays whose values are to be read from a file, and thus the dimensions are not known yet.

Warning:
Use this with care! Use this MArray only after being sure that ltl::MArray::realloc() or ltl::MArray::makeReference() has been called.

template<class T, int N>
ltl::MArray< T, N >::MArray ( const Range r1,
const bool  map = false 
) [inline]

template<class T, int N>
ltl::MArray< T, N >::MArray ( const Range r1,
const Range r2,
const bool  map = false 
) [inline]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<class T, int N>
ltl::MArray< T, N >::MArray ( const Range r1,
const Range r2,
const Range r3,
const bool  map = false 
) [inline]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<class T, int N>
ltl::MArray< T, N >::MArray ( const Range r1,
const Range r2,
const Range r3,
const Range r4,
const bool  map = false 
) [inline]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<class T, int N>
ltl::MArray< T, N >::MArray ( const Range r1,
const Range r2,
const Range r3,
const Range r4,
const Range r5,
const bool  map = false 
) [inline]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<class T, int N>
ltl::MArray< T, N >::MArray ( const Range r1,
const Range r2,
const Range r3,
const Range r4,
const Range r5,
const Range r6,
const bool  map = false 
) [inline]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<class T, int N>
ltl::MArray< T, N >::MArray ( const Range r1,
const Range r2,
const Range r3,
const Range r4,
const Range r5,
const Range r6,
const Range r7,
const bool  map = false 
) [inline]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<class T, int N>
ltl::MArray< T, N >::MArray ( const int  r1,
const bool  map = false 
) [inline]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<class T, int N>
ltl::MArray< T, N >::MArray ( const int  r1,
const int  r2,
const bool  map = false 
) [inline]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<class T, int N>
ltl::MArray< T, N >::MArray ( const int  r1,
const int  r2,
const int  r3,
const bool  map = false 
) [inline]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<class T, int N>
ltl::MArray< T, N >::MArray ( const int  r1,
const int  r2,
const int  r3,
const int  r4,
const bool  map = false 
) [inline]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<class T, int N>
ltl::MArray< T, N >::MArray ( const int  r1,
const int  r2,
const int  r3,
const int  r4,
const int  r5,
const bool  map = false 
) [inline]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<class T, int N>
ltl::MArray< T, N >::MArray ( const int  r1,
const int  r2,
const int  r3,
const int  r4,
const int  r5,
const int  r6,
const bool  map = false 
) [inline]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<class T, int N>
ltl::MArray< T, N >::MArray ( const int  r1,
const int  r2,
const int  r3,
const int  r4,
const int  r5,
const int  r6,
const int  r7,
const bool  map = false 
) [inline]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<class T, int N>
ltl::MArray< T, N >::MArray ( const MArray< T, N > &  other  )  [inline]

Copy constructor. Only makes a reference !!!.

template<class T, int N>
ltl::MArray< T, N >::MArray ( const MArray< T, N > &  other,
const Range r0 
) [inline]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<class T, int N>
ltl::MArray< T, N >::MArray ( const MArray< T, N > &  other,
const Range r1,
const Range r2 
) [inline]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<class T, int N>
ltl::MArray< T, N >::MArray ( const MArray< T, N > &  other,
const Range r1,
const Range r2,
const Range r3 
) [inline]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<class T, int N>
ltl::MArray< T, N >::MArray ( const MArray< T, N > &  other,
const Range r1,
const Range r2,
const Range r3,
const Range r4 
) [inline]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<class T, int N>
ltl::MArray< T, N >::MArray ( const MArray< T, N > &  other,
const Range r1,
const Range r2,
const Range r3,
const Range r4,
const Range r5 
) [inline]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<class T, int N>
ltl::MArray< T, N >::MArray ( const MArray< T, N > &  other,
const Range r1,
const Range r2,
const Range r3,
const Range r4,
const Range r5,
const Range r6 
) [inline]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<class T, int N>
ltl::MArray< T, N >::MArray ( const MArray< T, N > &  other,
const Range r1,
const Range r2,
const Range r3,
const Range r4,
const Range r5,
const Range r6,
const Range r7 
) [inline]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<class T, int N>
template<int N2, class R1, class R2, class R3, class R4, class R5, class R6, class R7>
ltl::MArray< T, N >::MArray ( const MArray< T, N2 > &  other,
R1  r1,
R2  r2,
R3  r3,
R4  r4,
R5  r5,
R6  r6,
R7  r7 
) [inline]

Constructor for mixed slicing (int, rank reducing) and Range arguments.

Other array's data is referenced, NOT copied ( use operator=() for copy)!

template<class T, int N>
ltl::MArray< T, N >::MArray ( T *  data,
const int dims 
)

Construct from allocated memory.

template<class T, int N>
ltl::MArray< T, N >::MArray ( const string  filename,
const int dims 
)

Construct from map file.

template<class T, int N>
ltl::MArray< T, N >::MArray ( const Shape< N > *  s,
const bool  map = false,
const char *  filename = NULL 
)

Construct from shape.

Useful to construct an array having the same geometry as another array. If you have map == true and give a filename the memory map will be saved.

template<class T, int N>
template<class Expr>
ltl::MArray< T, N >::MArray ( const ExprNode< Expr, N > &  e,
const bool  map = false,
const char *  filename = NULL 
) [inline]

Construct from an array-valued expression.

The new array is allocated with the shape of the expression and its elements are filled with the evaluated expression. If you have map == true and give a filename the memory map will be saved.

template<class T, int N>
ltl::MArray< T, N >::~MArray (  )  [inline]

Decrement reference count of memory block. If 0 delete.


Member Function Documentation

template<class T, int N>
void ltl::MArray< T, N >::free (  )  [inline]

Free associated memory.

Frees the memory used to store the data before the MArray goes out of scope (before the destructor is being called). Can help keeping code cleaner without using pointers to MArray.

template<class T, int N>
bool ltl::MArray< T, N >::empty (  )  const [inline]

true if MArray currenltly has have no memory allocated.

template<class T, int N>
MArray<T,N>& ltl::MArray< T, N >::operator= ( const MArray< T, N > &  other  )  [inline]

This.

Arrays have to have conformable shapes, no automatic resize takes place. Use realloc() instead! If the lhs ltl::MArray is empty(), i.e. no memory has been allocated then memory conforming to other's shape will be allocated.

overloads the default.

template<class T, int N>
template<class T2>
MArray<T,N>& ltl::MArray< T, N >::operator= ( const MArray< T2, N > &  other  )  [inline]

This.

is more general than the default.

template<class T, int N>
template<class Expr>
MArray<T,N>& ltl::MArray< T, N >::operator= ( const ExprNode< Expr, N > &  e  )  [inline]

Assignment of an expression to a MArray.

The MArray and the expression have to have conformable shapes, no automatic resize takes place. Use realloc() instead! If the lhs ltl::MArray is empty(), i.e. no memory has been allocated then memory conforming to the expression's shape will be allocated.

template<class T, int N>
ListInitializationSwitch< MArray<T,N> > ltl::MArray< T, N >::operator= ( x  )  [inline]

Assigns x to all elements.

A bit more comlicated since we have to discriminate between

 A = 3; and A = 1, 2, 3, 4;
which is done using ListInitializationSwitch which either calls ListInitializer or MArray::fill().

template<class T, int N>
template<class T2>
MArray<T,N>& ltl::MArray< T, N >::operator+= ( const MArray< T2, N > &  a  )  [inline]

template<class T, int N>
template<class T2>
MArray<T,N>& ltl::MArray< T, N >::operator-= ( const MArray< T2, N > &  a  )  [inline]

template<class T, int N>
template<class T2>
MArray<T,N>& ltl::MArray< T, N >::operator *= ( const MArray< T2, N > &  a  )  [inline]

template<class T, int N>
template<class T2>
MArray<T,N>& ltl::MArray< T, N >::operator/= ( const MArray< T2, N > &  a  )  [inline]

template<class T, int N>
template<class T2>
MArray<T,N>& ltl::MArray< T, N >::operator &= ( const MArray< T2, N > &  a  )  [inline]

template<class T, int N>
template<class T2>
MArray<T,N>& ltl::MArray< T, N >::operator|= ( const MArray< T2, N > &  a  )  [inline]

template<class T, int N>
template<class T2>
MArray<T,N>& ltl::MArray< T, N >::operator^= ( const MArray< T2, N > &  a  )  [inline]

template<class T, int N>
template<class Expr>
MArray<T,N>& ltl::MArray< T, N >::operator+= ( const ExprNode< Expr, N > &  e  )  [inline]

template<class T, int N>
template<class Expr>
MArray<T,N>& ltl::MArray< T, N >::operator-= ( const ExprNode< Expr, N > &  e  )  [inline]

template<class T, int N>
template<class Expr>
MArray<T,N>& ltl::MArray< T, N >::operator *= ( const ExprNode< Expr, N > &  e  )  [inline]

template<class T, int N>
template<class Expr>
MArray<T,N>& ltl::MArray< T, N >::operator/= ( const ExprNode< Expr, N > &  e  )  [inline]

template<class T, int N>
template<class Expr>
MArray<T,N>& ltl::MArray< T, N >::operator &= ( const ExprNode< Expr, N > &  e  )  [inline]

template<class T, int N>
template<class Expr>
MArray<T,N>& ltl::MArray< T, N >::operator|= ( const ExprNode< Expr, N > &  e  )  [inline]

template<class T, int N>
template<class Expr>
MArray<T,N>& ltl::MArray< T, N >::operator^= ( const ExprNode< Expr, N > &  e  )  [inline]

template<class T, int N>
MArray<T,N>& ltl::MArray< T, N >::operator+= ( const T  a  ) 

template<class T, int N>
MArray<T,N>& ltl::MArray< T, N >::operator-= ( const T  a  ) 

template<class T, int N>
MArray<T,N>& ltl::MArray< T, N >::operator *= ( const T  a  ) 

template<class T, int N>
MArray<T,N>& ltl::MArray< T, N >::operator/= ( const T  a  ) 

template<class T, int N>
MArray<T,N>& ltl::MArray< T, N >::operator &= ( const T  a  ) 

template<class T, int N>
MArray<T,N>& ltl::MArray< T, N >::operator|= ( const T  a  ) 

template<class T, int N>
MArray<T,N>& ltl::MArray< T, N >::operator^= ( const T  a  ) 

template<class T, int N>
T ltl::MArray< T, N >::operator() ( const int  i1  )  const [inline]

template<class T, int N>
T& ltl::MArray< T, N >::operator() ( const int  i1  )  [inline]

template<class T, int N>
T ltl::MArray< T, N >::operator() ( const int  i1,
const int  i2 
) const [inline]

template<class T, int N>
T& ltl::MArray< T, N >::operator() ( const int  i1,
const int  i2 
) [inline]

template<class T, int N>
T ltl::MArray< T, N >::operator() ( const int  i1,
const int  i2,
const int  i3 
) const [inline]

template<class T, int N>
T& ltl::MArray< T, N >::operator() ( const int  i1,
const int  i2,
const int  i3 
) [inline]

template<class T, int N>
T ltl::MArray< T, N >::operator() ( const int  i1,
const int  i2,
const int  i3,
const int  i4 
) const [inline]

template<class T, int N>
T& ltl::MArray< T, N >::operator() ( const int  i1,
const int  i2,
const int  i3,
const int  i4 
) [inline]

template<class T, int N>
T ltl::MArray< T, N >::operator() ( const int  i1,
const int  i2,
const int  i3,
const int  i4,
const int  i5 
) const [inline]

template<class T, int N>
T& ltl::MArray< T, N >::operator() ( const int  i1,
const int  i2,
const int  i3,
const int  i4,
const int  i5 
) [inline]

template<class T, int N>
T ltl::MArray< T, N >::operator() ( const int  i1,
const int  i2,
const int  i3,
const int  i4,
const int  i5,
const int  i6 
) const [inline]

template<class T, int N>
T& ltl::MArray< T, N >::operator() ( const int  i1,
const int  i2,
const int  i3,
const int  i4,
const int  i5,
const int  i6 
) [inline]

template<class T, int N>
T ltl::MArray< T, N >::operator() ( const int  i1,
const int  i2,
const int  i3,
const int  i4,
const int  i5,
const int  i6,
const int  i7 
) const [inline]

template<class T, int N>
T& ltl::MArray< T, N >::operator() ( const int  i1,
const int  i2,
const int  i3,
const int  i4,
const int  i5,
const int  i6,
const int  i7 
) [inline]

template<class T, int N>
T ltl::MArray< T, N >::operator() ( const FixedVector< int, 1 > &  i  )  const [inline]

template<class T, int N>
T& ltl::MArray< T, N >::operator() ( const FixedVector< int, 1 > &  i  )  [inline]

template<class T, int N>
T ltl::MArray< T, N >::operator() ( const FixedVector< int, 2 > &  i  )  const [inline]

template<class T, int N>
T& ltl::MArray< T, N >::operator() ( const FixedVector< int, 2 > &  i  )  [inline]

template<class T, int N>
T ltl::MArray< T, N >::operator() ( const FixedVector< int, 3 > &  i  )  const [inline]

template<class T, int N>
T& ltl::MArray< T, N >::operator() ( const FixedVector< int, 3 > &  i  )  [inline]

template<class T, int N>
T ltl::MArray< T, N >::operator() ( const FixedVector< int, 4 > &  i  )  const [inline]

template<class T, int N>
T& ltl::MArray< T, N >::operator() ( const FixedVector< int, 4 > &  i  )  [inline]

template<class T, int N>
T ltl::MArray< T, N >::operator() ( const FixedVector< int, 5 > &  i  )  const [inline]

template<class T, int N>
T& ltl::MArray< T, N >::operator() ( const FixedVector< int, 5 > &  i  )  [inline]

template<class T, int N>
T ltl::MArray< T, N >::operator() ( const FixedVector< int, 6 > &  i  )  const [inline]

template<class T, int N>
T& ltl::MArray< T, N >::operator() ( const FixedVector< int, 6 > &  i  )  [inline]

template<class T, int N>
T ltl::MArray< T, N >::operator() ( const FixedVector< int, 7 > &  i  )  const [inline]

template<class T, int N>
T& ltl::MArray< T, N >::operator() ( const FixedVector< int, 7 > &  i  )  [inline]

template<class T, int N>
MArray<T,N> ltl::MArray< T, N >::operator() ( const Range r1  )  const [inline]

template<class T, int N>
MArray<T,N> ltl::MArray< T, N >::operator() ( const Range r1,
const Range r2 
) const [inline]

template<class T, int N>
MArray<T,N> ltl::MArray< T, N >::operator() ( const Range r1,
const Range r2,
const Range r3 
) const [inline]

template<class T, int N>
MArray<T,N> ltl::MArray< T, N >::operator() ( const Range r1,
const Range r2,
const Range r3,
const Range r4 
) const [inline]

template<class T, int N>
MArray<T,N> ltl::MArray< T, N >::operator() ( const Range r1,
const Range r2,
const Range r3,
const Range r4,
const Range r5 
) const [inline]

template<class T, int N>
MArray<T,N> ltl::MArray< T, N >::operator() ( const Range r1,
const Range r2,
const Range r3,
const Range r4,
const Range r5,
const Range r6 
) const [inline]

template<class T, int N>
MArray<T,N> ltl::MArray< T, N >::operator() ( const Range r1,
const Range r2,
const Range r3,
const Range r4,
const Range r5,
const Range r6,
const Range r7 
) const [inline]

template<class T, int N>
template<class T1, class T2>
SliceCounter<T,T1,T2>::MArraySlice ltl::MArray< T, N >::operator() ( T1  r1,
T2  r2 
) const [inline]

template<class T, int N>
template<class T1, class T2, class T3>
SliceCounter<T,T1,T2,T3>::MArraySlice ltl::MArray< T, N >::operator() ( T1  r1,
T2  r2,
T3  r3 
) const [inline]

template<class T, int N>
template<class T1, class T2, class T3, class T4>
SliceCounter<T,T1,T2,T3,T4>::MArraySlice ltl::MArray< T, N >::operator() ( T1  r1,
T2  r2,
T3  r3,
T4  r4 
) const [inline]

template<class T, int N>
template<class T1, class T2, class T3, class T4, class T5>
SliceCounter<T,T1,T2,T3,T4,T5>::MArraySlice ltl::MArray< T, N >::operator() ( T1  r1,
T2  r2,
T3  r3,
T4  r4,
T5  r5 
) const [inline]

template<class T, int N>
template<class T1, class T2, class T3, class T4, class T5, class T6>
SliceCounter<T,T1,T2,T3,T4,T5,T6>::MArraySlice ltl::MArray< T, N >::operator() ( T1  r1,
T2  r2,
T3  r3,
T4  r4,
T5  r5,
T6  r6 
) const [inline]

template<class T, int N>
template<class T1, class T2, class T3, class T4, class T5, class T6, class T7>
SliceCounter<T,T1,T2,T3,T4,T5,T6,T7>::MArraySlice ltl::MArray< T, N >::operator() ( T1  r1,
T2  r2,
T3  r3,
T4  r4,
T5  r5,
T6  r6,
T7  r7 
) const [inline]

template<class T, int N>
MArray<T,1> ltl::MArray< T, N >::operator() ( const IndexList< N > &  l  )  const [inline]

Index with ltl::IndexList (rhs version).

Return ltl::MArray<T,1> object.

template<class T, int N>
IndexRef<T,N> ltl::MArray< T, N >::operator[] ( const IndexList< N > &  l  )  [inline]

Index with ltl::IndexList (lhs version).

Assignment to self indexed with IndexList A[l] = Expr<T,1> IndexRef object is needed to carry the operator=( Expr ) method.

template<class T, int N>
void ltl::MArray< T, N >::setBase ( const int  b1  ) 

template<class T, int N>
void ltl::MArray< T, N >::setBase ( const int  b1,
const int  b2 
)

template<class T, int N>
void ltl::MArray< T, N >::setBase ( const int  b1,
const int  b2,
const int  b3 
)

template<class T, int N>
void ltl::MArray< T, N >::setBase ( const int  b1,
const int  b2,
const int  b3,
const int  b4 
)

template<class T, int N>
void ltl::MArray< T, N >::setBase ( const int  b1,
const int  b2,
const int  b3,
const int  b4,
const int  b5 
)

template<class T, int N>
void ltl::MArray< T, N >::setBase ( const int  b1,
const int  b2,
const int  b3,
const int  b4,
const int  b5,
const int  b6 
)

template<class T, int N>
void ltl::MArray< T, N >::setBase ( const int  b1,
const int  b2,
const int  b3,
const int  b4,
const int  b5,
const int  b6,
const int  b7 
)

template<class T, int N>
void ltl::MArray< T, N >::makeReference ( const MArray< T, N > &  other  ) 

Make this being a referece to other's data.

template<class T, int N>
void ltl::MArray< T, N >::realloc ( const Shape< N > &  s,
const bool  map = false,
const char *  filename = NULL 
)

Reallocate memory. Data are abolished.

If you have map == true and give a filename the new memory map will be saved.

template<class T, int N>
iterator ltl::MArray< T, N >::iter (  )  [inline]

template<class T, int N>
iterator ltl::MArray< T, N >::begin (  )  [inline]

template<class T, int N>
const_iterator ltl::MArray< T, N >::begin (  )  const [inline]

template<class T, int N>
iterator ltl::MArray< T, N >::end (  )  [inline]

template<class T, int N>
const_iterator ltl::MArray< T, N >::end (  )  const [inline]

template<class T, int N>
T* ltl::MArray< T, N >::beginRA (  )  [inline]

In case our memory layout is contiguous, we can offer an easy solution to provide random access iterators.

template<class T, int N>
T* ltl::MArray< T, N >::endRA (  )  [inline]

template<class T, int N>
T* ltl::MArray< T, N >::data (  )  const [inline]

Pointer to first data element.

Warning:
The second data element NEED NOT be at first + 1 since the memeory might be non-contiguous. Use iteators!

template<class T, int N>
IndexIterator ltl::MArray< T, N >::indexBegin (  )  const [inline]

An iterator-style thing providing indices when dereferenced.

I.e. *i or i() gives a FixedVector holding the indices and and i(int) gives the index in the i-th dimension

template<class T, int N>
size_type ltl::MArray< T, N >::nelements (  )  const [inline]

Number of elements .

template<class T, int N>
size_type ltl::MArray< T, N >::size (  )  const [inline]

Number of elements .

template<class T, int N>
int ltl::MArray< T, N >::minIndex ( const int  dim  )  const [inline]

First index along dimension dim (starting to count at 1).

template<class T, int N>
int ltl::MArray< T, N >::maxIndex ( const int  dim  )  const [inline]

Last index along dimension dim (starting to count at 1).

template<class T, int N>
int ltl::MArray< T, N >::length ( const int  dim  )  const [inline]

Length of dimension dim.

template<class T, int N>
int ltl::MArray< T, N >::stride ( const int  dim  )  const [inline]

Stride of dimension dim.

template<class T, int N>
bool ltl::MArray< T, N >::isStride1 (  )  const [inline]

template<class T, int N>
int ltl::MArray< T, N >::zeroOffset (  )  const [inline]

template<class T, int N>
bool ltl::MArray< T, N >::isStorageContiguous (  )  const [inline]

template<class T, int N>
bool ltl::MArray< T, N >::isConformable ( const Shape< N > &  other  )  const [inline]

Check conformability with other ltl::Shape.

template<class T, int N>
template<class T2>
bool ltl::MArray< T, N >::isConformable ( const MArray< T2, N > &  other  )  const [inline]

Check conformability with other array.

template<class T, int N>
const Shape<N>* ltl::MArray< T, N >::shape (  )  const [inline]

Return the ltl::Shape.

template<class T, int N>
MemoryBlock<T>* ltl::MArray< T, N >::memoryBlock (  )  const [inline]

Return pointer to associated MemoryBlock .

template<class T, int N>
bool ltl::MArray< T, N >::isAllocated (  )  const [inline]

Return true, if MArray has associated MemoryBlock.

template<class T, int N>
void ltl::MArray< T, N >::reverseSelf ( const int  dim = 1  ) 

Reverse this MArray.

template<class T, int N>
MArray<T, N> ltl::MArray< T, N >::reverse ( const int  dim = 1  )  const

Return reversed MArray.

template<class T, int N>
void ltl::MArray< T, N >::transposeSelf ( const int  dim1 = 1,
const int  dim2 = 2 
)

Transpose this MArray.

template<class T, int N>
MArray<T, N> ltl::MArray< T, N >::transpose ( const int  dim1 = 1,
const int  dim2 = 2 
) const

Return transposed MArray.

template<class T, int N>
void ltl::MArray< T, N >::describeSelf (  )  const

Debug output. Print geometry information.

template<class T, int N>
template<class T2>
void ltl::MArray< T, N >::copy ( const MArray< T2, N > &  other  )  [inline, protected]

Copy from other.

template<class T, int N>
void ltl::MArray< T, N >::fill ( const T  t  )  [protected]

Fill with t.

template<class T, int N>
void ltl::MArray< T, N >::subarray ( const MArray< T, N > &  other,
const Range r1 
) [protected]

Constructs a pure subarray of other, i.e. rank is preserved.

template<class T, int N>
void ltl::MArray< T, N >::subarray ( const MArray< T, N > &  other,
const Range r1,
const Range r2 
) [protected]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<class T, int N>
void ltl::MArray< T, N >::subarray ( const MArray< T, N > &  other,
const Range r1,
const Range r2,
const Range r3 
) [protected]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<class T, int N>
void ltl::MArray< T, N >::subarray ( const MArray< T, N > &  other,
const Range r1,
const Range r2,
const Range r3,
const Range r4 
) [protected]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<class T, int N>
void ltl::MArray< T, N >::subarray ( const MArray< T, N > &  other,
const Range r1,
const Range r2,
const Range r3,
const Range r4,
const Range r5 
) [protected]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<class T, int N>
void ltl::MArray< T, N >::subarray ( const MArray< T, N > &  other,
const Range r1,
const Range r2,
const Range r3,
const Range r4,
const Range r5,
const Range r6 
) [protected]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<class T, int N>
void ltl::MArray< T, N >::subarray ( const MArray< T, N > &  other,
const Range r1,
const Range r2,
const Range r3,
const Range r4,
const Range r5,
const Range r6,
const Range r7 
) [protected]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<class T, int N>
template<int N2, class R1, class R2, class R3, class R4, class R5, class R6, class R7>
void ltl::MArray< T, N >::slicearray ( const MArray< T, N2 > &  other,
R1  r1,
R2  r2,
R3  r3,
R4  r4,
R5  r5,
R6  r6,
R7  r7 
) [inline, protected]

template<class T, int N>
template<int N2>
void ltl::MArray< T, N >::slice ( int setRank,
Range  r,
const MArray< T, N2 > &  other,
int  sourceRank 
) [inline, protected]

template<class T, int N>
template<int N2>
void ltl::MArray< T, N >::slice ( int setRank,
int  r,
const MArray< T, N2 > &  other,
int  sourceRank 
) [inline, protected]

template<class T, int N>
template<int N2>
void ltl::MArray< T, N >::slice ( int setRank,
NoArgument  ,
const MArray< T, N2 > &  other,
int  sourceRank 
) [inline, protected]

template<class T, int N>
void ltl::MArray< T, N >::setupMemory ( const bool  map = false,
const char *  filename = NULL 
) [protected]

template<class T, int N>
void ltl::MArray< T, N >::setupShape ( const int dims  )  [protected]

template<class T, int N>
void ltl::MArray< T, N >::setrange ( const int  dim,
const Range r 
) [protected]


Friends And Related Function Documentation

template<class T, int N>
friend class MArrayIter< T, N > [friend]

template<class T, int N>
friend class MArrayIterConst< T, N > [friend]

template<class T, int N>
friend class ListInitializationSwitch< MArray< T, N > > [friend]


Member Data Documentation

template<class T, int N>
MemoryBlock<T>* ltl::MArray< T, N >::memBlock_ [protected]

Our MemoryBlock.

template<class T, int N>
Shape<N> ltl::MArray< T, N >::shape_ [protected]

Holds shape information.

And zeroOffset_ which is the distance between data_ and the the address of the first element of the array, such that

        first = data_ + sum( base(i) * stride(i) )
              = data_ + shape_.zeroOffset();
always holds.

template<class T, int N>
T* __restrict__ ltl::MArray< T, N >::data_

Pointer to element ( 0, 0, ..., 0 ).


Generated on Wed Mar 11 17:44:36 2009 for LTL by  doxygen 1.5.3