esso::Array< N, T0 > Class Template Reference

Multidimensional, efficient array class for large data sets. More...

#include <flex.h>

List of all members.

Public Member Functions

T & operator() (IXTYPE i0) const
T & operator() (IXTYPE i0, IXTYPE i1) const
T & operator() (IXTYPE i0, IXTYPE i1, IXTYPE i2) const
T & operator() (IXTYPE i0, IXTYPE i1, IXTYPE i2, IXTYPE i3) const
T & operator() (IXTYPE i0, IXTYPE i1, IXTYPE i2, IXTYPE i3, IXTYPE i4) const
T & operator() (IXTYPE i0, IXTYPE i1, IXTYPE i2, IXTYPE i3, IXTYPE i4, IXTYPE i5) const
T & operator[] (const Ix< N > &ix) const
constructor
 Array ()
 Array (const Ix< N > &len0)
 Array (const Ix< N > &len0, const Ix< N > &l0)
 Array (const Array &src)
template<class TypeS>
 Array (const Array< N, TypeS > &src)
 Array (const Array< N+1, Type > &src, DIMT n, IXTYPE i)
 Array (IXTYPE i0)
 Array (IXTYPE i0, IXTYPE i1)
 Array (IXTYPE i0, IXTYPE i1, IXTYPE i2)
 Array (IXTYPE i0, IXTYPE i1, IXTYPE i2, IXTYPE i3)
 Array (IXTYPE i0, IXTYPE i1, IXTYPE i2, IXTYPE i3, IXTYPE i4)
 Array (IXTYPE i0, IXTYPE i1, IXTYPE i2, IXTYPE i3, IXTYPE i4, IXTYPE i5)
const
IXTYPE L (DIMT n) const
IXTYPE U (DIMT n) const
IXTYPE Len (DIMT n) const
IXTYPE Stride (DIMT n) const
T * Origo () const
T * Start () const
const MultiPtr< T > & Data () const
bool IsNull () const
nonconst
bool Dealloc ()
bool Realloc (const Ix< N > &len0)
bool Realloc (const Ix< N > &len0, const Ix< N > &l0)
bool Realloc (const Ix< N > &len0, const Ix< N > &l0, const MultiPtr< T > &data0, T *origo0)
template<class TypeS>
bool Realloc (const Array< N, TypeS > &src)
template<class TypeS>
bool Refer (const Array< N, TypeS > &src)
bool Clone ()
template<class TypeS>
bool Clone (const Array< N, TypeS > &src)
template<class TypeS>
ArrayExtend (const Array< N-1, TypeS > &src, IXTYPE l0, IXTYPE u0)
template<class TypeS>
ArrayRmdim (const Array< N+1, TypeS > &src, DIMT n, IXTYPE i)
template<class TypeS>
Arrayoperator= (const Array< N, TypeS > &src)
Arrayoperator= (const Array &src)
ArrayShift (DIMT n, IXTYPE i)
ArrayShift (const Ix< N > &ix)
ArrayPermute (DIMT n1, DIMT n2)
ArrayPermute (const Permutation< N > &nx)
ArrayRestrict (DIMT n, IXTYPE l0, IXTYPE u0)
ArrayRestrict (const Ix< N > &l0, const Ix< N > &u0)
ArrayRestrictL (DIMT n, IXTYPE l0)
ArrayRestrictL (const Ix< N > &l0)
ArrayRestrictU (DIMT n, IXTYPE u0)
ArrayRestrictU (const Ix< N > &u0)
ArrayFlip (DIMT n)
ArrayFlip (const Ix< N, bool > &r)
ArrayReverse (DIMT n)
ArrayReverse (const Ix< N, bool > &r)
ArrayRestride (DIMT n, IXTYPE s)
ArrayRestride (const Ix< N > &s)


Detailed Description

template<int N, class T0>
class esso::Array< N, T0 >

Multidimensional, efficient array class for large data sets.

Use this array for efficient numerical computations or other applications where powerful and efficient arrays are needed for large data sets.

If efficiency is crusial, see also the specialization Array<N,Fix<T> > . It is faster but less flexible (cannot permute dimensions).


Constructor & Destructor Documentation

template<int N, class T0>
esso::Array< N, T0 >::Array (  )  [inline]

Default constructor. Initialize array with no data and index bounds zero

template<int N, class T0>
esso::Array< N, T0 >::Array ( const Ix< N > &  len0  )  [inline]

Constructor with lower index bound set to zero

  • len0 number of elements for each dimension

template<int N, class T0>
esso::Array< N, T0 >::Array ( const Ix< N > &  len0,
const Ix< N > &  l0 
) [inline]

  • len0 number of elements for each dimension
  • l0 lower index bound

template<int N, class T0>
esso::Array< N, T0 >::Array ( const Array< N, T0 > &  src  )  [inline]

Copy constructor Creates a reference to the same memory area as src

template<int N, class T0>
template<class TypeS>
esso::Array< N, T0 >::Array ( const Array< N, TypeS > &  src  )  [inline]

Copy constructor from another array type object If possible, create a reference to the same memory area as src. If this is not possible, create a new memory area and copy src elements

template<int N, class T0>
esso::Array< N, T0 >::Array ( const Array< N+1, Type > &  src,
DIMT  n,
IXTYPE  i 
) [inline]

Constructor that creates reference to a slice along dimension n from higher-dimension array

References esso::Array< N, T0 >::L(), esso::Array< N, T0 >::Stride(), and esso::Array< N, T0 >::U().

template<int N, class T0>
esso::Array< N, T0 >::Array ( IXTYPE  i0  )  [inline]

1-dimensional array of given length

template<int N, class T0>
esso::Array< N, T0 >::Array ( IXTYPE  i0,
IXTYPE  i1 
) [inline]

2-dimensional array of given length

template<int N, class T0>
esso::Array< N, T0 >::Array ( IXTYPE  i0,
IXTYPE  i1,
IXTYPE  i2 
) [inline]

3-dimensional array of given length

template<int N, class T0>
esso::Array< N, T0 >::Array ( IXTYPE  i0,
IXTYPE  i1,
IXTYPE  i2,
IXTYPE  i3 
) [inline]

4-dimensional array of given length

template<int N, class T0>
esso::Array< N, T0 >::Array ( IXTYPE  i0,
IXTYPE  i1,
IXTYPE  i2,
IXTYPE  i3,
IXTYPE  i4 
) [inline]

5-dimensional array of given length

template<int N, class T0>
esso::Array< N, T0 >::Array ( IXTYPE  i0,
IXTYPE  i1,
IXTYPE  i2,
IXTYPE  i3,
IXTYPE  i4,
IXTYPE  i5 
) [inline]

6-dimensional array of given length


Member Function Documentation

template<int N, class T0>
IXTYPE esso::Array< N, T0 >::L ( DIMT  n  )  const [inline]

template<int N, class T0>
IXTYPE esso::Array< N, T0 >::U ( DIMT  n  )  const [inline]

template<int N, class T0>
IXTYPE esso::Array< N, T0 >::Len ( DIMT  n  )  const [inline]

Convenience function giving the number of array elements along given dimension. Simply put, Len(n) is U(n) - L(n)

Referenced by esso::CreateMPIArray(), and esso::CreateMPIPPArray().

template<int N, class T0>
T* esso::Array< N, T0 >::Start (  )  const [inline]

Pointer to first valid element i.e. element at lowest index bound

Useful for passing pointer to fortran routine, but note that if the dimensions are permuted or reversed the data organization is not compatible with fortran.

template<int N, class T0>
bool esso::Array< N, T0 >::IsNull (  )  const [inline]

Returns:
true if this array has no data allocated

Referenced by esso::Array< N, T0 >::Clone(), esso::Array< N, Fix< T0 > >::Clone(), esso::CreateMPIArray(), and esso::CreateMPIPPArray().

template<int N, class T0>
bool esso::Array< N, T0 >::Dealloc (  )  [inline]

Release this object from it's element data and set index bounds to zero

template<int N, class T0>
bool esso::Array< N, T0 >::Realloc ( const Ix< N > &  len0  )  [inline]

Release this object from it's element data and allocate a new data set with given size (lower index bounds zero)

Returns:
always returns true

Referenced by esso::Clone(), esso::Array< N, T0 >::Clone(), and esso::Array< N, Fix< T0 > >::Clone().

template<int N, class T0>
bool esso::Array< N, T0 >::Realloc ( const Ix< N > &  len0,
const Ix< N > &  l0 
) [inline]

Release this object from it's element data and allocate a new data set with given size and given lower index bounds

Returns:
always returns true

template<int N, class T0>
template<class TypeS>
bool esso::Array< N, T0 >::Realloc ( const Array< N, TypeS > &  src  )  [inline]

Release this object from it's element data and allocate a new, uninitialized data set with given size and index bounds identical with those of src.

Returns:
true on success or false if operation failed

References esso::Array< N, T0 >::L(), and esso::Array< N, T0 >::U().

template<int N, class T0>
template<class TypeS>
bool esso::Array< N, T0 >::Refer ( const Array< N, TypeS > &  src  )  [inline]

Reinitialize this object as an identical copy of src (refering to the same data area as src)

Returns:
true on success or false if operation failed

References esso::Array< N, T0 >::Data(), esso::Array< N, T0 >::L(), esso::Array< N, T0 >::Origo(), esso::Array< N, T0 >::Stride(), and esso::Array< N, T0 >::U().

template<int N, class T0>
bool esso::Array< N, T0 >::Clone (  )  [inline]

Same as Clone(*this).

Returns:
true on success or false if operation failed

Referenced by esso::Clone().

template<int N, class T0>
template<class TypeS>
bool esso::Array< N, T0 >::Clone ( const Array< N, TypeS > &  src  )  [inline]

Release this object from it's element data and allocate a new data set with index bounds identical to those of src. Finally copy the element data from src

Note that this is the same as Realloc followed by element-wise copy.

Returns:
true on success or false if operation failed

References esso::Array< N, T0 >::IsNull(), and esso::Array< N, T0 >::Realloc().

template<int N, class T0>
template<class TypeS>
Array< N, T0 > & esso::Array< N, T0 >::Extend ( const Array< N-1, TypeS > &  src,
IXTYPE  l0,
IXTYPE  u0 
) [inline]

Create a reference to src by setting the stride for dimension 0 to 0, that is, all elements along dimension 0 refer to the same element position. New index bounds for dimension zero are given as arguments.

References esso::Array< N, T0 >::Data(), esso::Array< N, T0 >::L(), esso::Array< N, T0 >::Origo(), esso::Array< N, T0 >::Stride(), and esso::Array< N, T0 >::U().

template<int N, class T0>
template<class TypeS>
Array< N, T0 > & esso::Array< N, T0 >::Rmdim ( const Array< N+1, TypeS > &  src,
DIMT  n,
IXTYPE  i 
) [inline]

Create a reference to a slice of src by cutting along dimension n at index i

References esso::Array< N, T0 >::Data(), esso::Array< N, T0 >::L(), esso::Array< N, T0 >::Origo(), esso::Array< N, T0 >::Stride(), and esso::Array< N, T0 >::U().

template<int N, class T0>
template<class TypeS>
Array& esso::Array< N, T0 >::operator= ( const Array< N, TypeS > &  src  )  [inline]

Create an identical reference to src data if possible (same as Refer(src) ), otherwise create a new data area and copy src elements into it (same as Clone(src))

template<int N, class T0>
Array& esso::Array< N, T0 >::operator= ( const Array< N, T0 > &  src  )  [inline]

Create an identical reference to src data (same as Refer(src))

template<int N, class T0>
Array< N, T0 > & esso::Array< N, T0 >::Shift ( DIMT  n,
IXTYPE  i 
) [inline]

Shift data and valid index range along dimension n

Referenced by esso::Array< N, T0 >::Shift().

template<int N, class T0>
Array< N, T0 > & esso::Array< N, T0 >::Shift ( const Ix< N > &  ix  )  [inline]

Shift data and valid index range along all dimensions

References esso::Array< N, T0 >::Shift().

template<int N, class T0>
Array< N, T0 > & esso::Array< N, T0 >::Permute ( DIMT  n1,
DIMT  n2 
) [inline]

Permute dimensions by swapping two

template<int N, class T0>
Array< N, T0 > & esso::Array< N, T0 >::Permute ( const Permutation< N > &  nx  )  [inline]

Permute dimensions

template<int N, class T0>
Array< N, T0 > & esso::Array< N, T0 >::Restrict ( DIMT  n,
IXTYPE  l0,
IXTYPE  u0 
) [inline]

Restrict valid index range along dimension n

Resulting index range along n is the intersection of the given range [l0,u0[ and the previous index range [L(n),U(n)[

template<int N, class T0>
Array< N, T0 > & esso::Array< N, T0 >::Restrict ( const Ix< N > &  l0,
const Ix< N > &  u0 
) [inline]

Restrict valid index range along all dimensions

template<int N, class T0>
Array< N, T0 > & esso::Array< N, T0 >::RestrictL ( DIMT  n,
IXTYPE  l0 
) [inline]

Restrict lower index bound along dimension n

template<int N, class T0>
Array< N, T0 > & esso::Array< N, T0 >::RestrictL ( const Ix< N > &  l0  )  [inline]

Restrict lower index bound along all dimensions

template<int N, class T0>
Array< N, T0 > & esso::Array< N, T0 >::RestrictU ( DIMT  n,
IXTYPE  u0 
) [inline]

Restrict upper index bound along dimension n

template<int N, class T0>
Array< N, T0 > & esso::Array< N, T0 >::RestrictU ( const Ix< N > &  u0  )  [inline]

Restrict upper index bound along all dimensions

template<int N, class T0>
Array< N, T0 > & esso::Array< N, T0 >::Flip ( DIMT  n  )  [inline]

Reverse order of elements along dimension n and adjust valid index range so that element at (0,0,...,0) is unchanged

template<int N, class T0>
Array< N, T0 > & esso::Array< N, T0 >::Flip ( const Ix< N, bool > &  r  )  [inline]

Reverse order of elements along all dimensions and adjust valid index range so that element at (0,0,...,0) is unchanged

template<int N, class T0>
Array< N, T0 > & esso::Array< N, T0 >::Reverse ( DIMT  n  )  [inline]

Reverse order of elements along dimension n. Valid index range is unchanged

template<int N, class T0>
Array< N, T0 > & esso::Array< N, T0 >::Reverse ( const Ix< N, bool > &  r  )  [inline]

Reverse order of elements along all dimensions, Valid index range is unchanged

template<int N, class T0>
Array< N, T0 > & esso::Array< N, T0 >::Restride ( DIMT  n,
IXTYPE  s 
) [inline]

Set this object to point to every s 'th element along dimension n

Referenced by esso::Array< N, T0 >::Restride().

template<int N, class T0>
Array< N, T0 > & esso::Array< N, T0 >::Restride ( const Ix< N > &  s  )  [inline]

Set this object to point to every s[n] 'th element along dimension n for all n (along all dimensions)

References esso::Array< N, T0 >::Restride().

template<int N, class T0>
T& esso::Array< N, T0 >::operator() ( IXTYPE  i0  )  const [inline]

Get 1-dimensional array element at given position

template<int N, class T0>
T& esso::Array< N, T0 >::operator() ( IXTYPE  i0,
IXTYPE  i1 
) const [inline]

Get 2-dimensional array element at given position

template<int N, class T0>
T& esso::Array< N, T0 >::operator() ( IXTYPE  i0,
IXTYPE  i1,
IXTYPE  i2 
) const [inline]

Get 3-dimensional array element at given position

template<int N, class T0>
T& esso::Array< N, T0 >::operator() ( IXTYPE  i0,
IXTYPE  i1,
IXTYPE  i2,
IXTYPE  i3 
) const [inline]

Get 4-dimensional array element at given position

template<int N, class T0>
T& esso::Array< N, T0 >::operator() ( IXTYPE  i0,
IXTYPE  i1,
IXTYPE  i2,
IXTYPE  i3,
IXTYPE  i4 
) const [inline]

Get 5-dimensional array element at given position

template<int N, class T0>
T& esso::Array< N, T0 >::operator() ( IXTYPE  i0,
IXTYPE  i1,
IXTYPE  i2,
IXTYPE  i3,
IXTYPE  i4,
IXTYPE  i5 
) const [inline]

Get 6-dimensional array element at given position

template<int N, class T0>
T& esso::Array< N, T0 >::operator[] ( const Ix< N > &  ix  )  const [inline]

Get element at given position

Referenced by esso::Array< N, Type >::Start(), and esso::Array< N, Fix< T0 > >::Start().


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

Generated on Mon Feb 23 19:15:47 2009 for Expresso by  doxygen 1.5.6