tvalarray< T > Class Template Reference

Array class with debugging support and a minimal set of std::valarray-compatible methods. More...

#include <tvalarray.h>

Inheritance diagram for tvalarray< T >:

tvalarray_wrapper< T >

List of all members.

Public Member Functions

 tvalarray ()
 Create an empty array.
 tvalarray (unsigned _n)
 Create an array with n elements.
 tvalarray (const T &value, unsigned _n)
 Create an array with n initialized elements.
 tvalarray (const T *values, unsigned _n)
 Create an array with n initialized elements.
 tvalarray (const tvalarray &a)
 Copy constructor.
unsigned size () const
 Gets the number of elements.
 operator T * ()
 Gets the underlying array.
 operator const T * () const
 Gets the underlying array.
tvalarrayoperator= (const tvalarray &a)
 Copy (but do not resize!!!).
tvalarrayoperator+= (const tvalarray &a)
 Addition assignment.
tvalarrayoperator+= (const T &c)
 Addition assignment.
tvalarrayoperator^= (const tvalarray &a)
 Bitwise exclusive OR assignment.
tvalarrayoperator^= (const T &c)
 Bitwise exclusive OR assignment.
tvalarrayoperator &= (const tvalarray &a)
 Bitwise AND assignment.
tvalarrayoperator &= (const T &c)
 Bitwise AND assignment.
tvalarrayoperator|= (const tvalarray &a)
 Bitwise inclusive OR assignment.
tvalarrayoperator|= (const T &c)
 Bitwise inclusive OR assignment.
tvalarrayoperator<<= (const tvalarray &a)
 Bitwise left shift assignment.
tvalarrayoperator<<= (const T &c)
 Bitwise left shift assignment.
tvalarrayoperator>>= (const tvalarray &a)
 Bitwise right shift assignment.
tvalarrayoperator>>= (const T &c)
 Bitwise right shift assignment.
tvalarrayoperator*= (const tvalarray &a)
 Multiplication assignment.
tvalarrayoperator*= (const T &c)
 Multiplication assignment.
tvalarrayoperator/= (const tvalarray &a)
 Division assignment.
tvalarrayoperator/= (const T &c)
 Division assignment.
tvalarrayoperator%= (const tvalarray &a)
 Remainder assignment.
tvalarrayoperator%= (const T &c)
 Remainder assignment.
tvalarrayoperator= (const T &c)
 Assignment operation.
tvalarrayoperator-= (const T &c)
 Subtraction assignment.
tvalarrayoperator-= (const tvalarray &a)
 Subtraction assignment.
void resize (unsigned _n, T value=T())
 Resize array and initialize all elements.
operator[] (int k) const
 Gets the kth element.
T & operator[] (int k)
 Gets the kth element.
tvalarray shift (int k) const
 Returns a shifted array.
tvalarray cshift (int k) const
 Returns a rotated array.
void realloc (int _n)
 (Re)allocate array.

Protected Member Functions

 tvalarray (T *array, unsigned _n, bool realloc)
 Create an array that uses the specified low level array.

Friends

template<class Tp>
void copy (const tvalarray< Tp > &source, tvalarray< Tp > &dest)
 Copy (also realloc if necessary).
template<class Tp>
void copy (const tvalarray< tvalarray< Tp > > &source, tvalarray< tvalarray< Tp > > &dest)
 Copy (also realloc if necessary).
template<class Tp>
void resize (tvalarray< Tp > &arr, unsigned _n, Tp value=Tp())
 Resize array and initialize all elements.
template<class Tp>
void resize (tvalarray< tvalarray< Tp > > &arr, unsigned _n, tvalarray< Tp > value=tvalarray< Tp >())
 Resize array and initialize all elements in hyper-arrays.


Detailed Description

template<class T>
class tvalarray< T >

Array class with debugging support and a minimal set of std::valarray-compatible methods.

Version:
0.5, 12/22/2008
Author:
Peter Csizmadia (2000-2003,2007)

Constructor & Destructor Documentation

template<class T>
tvalarray< T >::tvalarray ( T *  array,
unsigned  _n,
bool  realloc 
) [inline, protected]

Create an array that uses the specified low level array.

template<class T>
tvalarray< T >::tvalarray (  )  [inline]

Create an empty array.

template<class T>
tvalarray< T >::tvalarray ( unsigned  _n  )  [inline]

Create an array with n elements.

template<class T>
tvalarray< T >::tvalarray ( const T &  value,
unsigned  _n 
) [inline]

Create an array with n initialized elements.

template<class T>
tvalarray< T >::tvalarray ( const T *  values,
unsigned  _n 
) [inline]

Create an array with n initialized elements.

template<class T>
tvalarray< T >::tvalarray ( const tvalarray< T > &  a  )  [inline]

Copy constructor.


Member Function Documentation

template<class T>
unsigned tvalarray< T >::size (  )  const [inline]

Gets the number of elements.

template<class T>
tvalarray< T >::operator T * (  )  [inline]

Gets the underlying array.

template<class T>
tvalarray< T >::operator const T * (  )  const [inline]

Gets the underlying array.

template<class T>
tvalarray& tvalarray< T >::operator= ( const tvalarray< T > &  a  )  [inline]

Copy (but do not resize!!!).

template<class T>
tvalarray& tvalarray< T >::operator+= ( const tvalarray< T > &  a  )  [inline]

Addition assignment.

template<class T>
tvalarray& tvalarray< T >::operator+= ( const T &  c  )  [inline]

Addition assignment.

template<class T>
tvalarray& tvalarray< T >::operator^= ( const tvalarray< T > &  a  )  [inline]

Bitwise exclusive OR assignment.

template<class T>
tvalarray& tvalarray< T >::operator^= ( const T &  c  )  [inline]

Bitwise exclusive OR assignment.

template<class T>
tvalarray& tvalarray< T >::operator &= ( const tvalarray< T > &  a  )  [inline]

Bitwise AND assignment.

template<class T>
tvalarray& tvalarray< T >::operator &= ( const T &  c  )  [inline]

Bitwise AND assignment.

template<class T>
tvalarray& tvalarray< T >::operator|= ( const tvalarray< T > &  a  )  [inline]

Bitwise inclusive OR assignment.

template<class T>
tvalarray& tvalarray< T >::operator|= ( const T &  c  )  [inline]

Bitwise inclusive OR assignment.

template<class T>
tvalarray& tvalarray< T >::operator<<= ( const tvalarray< T > &  a  )  [inline]

Bitwise left shift assignment.

template<class T>
tvalarray& tvalarray< T >::operator<<= ( const T &  c  )  [inline]

Bitwise left shift assignment.

template<class T>
tvalarray& tvalarray< T >::operator>>= ( const tvalarray< T > &  a  )  [inline]

Bitwise right shift assignment.

template<class T>
tvalarray& tvalarray< T >::operator>>= ( const T &  c  )  [inline]

Bitwise right shift assignment.

template<class T>
tvalarray& tvalarray< T >::operator*= ( const tvalarray< T > &  a  )  [inline]

Multiplication assignment.

template<class T>
tvalarray& tvalarray< T >::operator*= ( const T &  c  )  [inline]

Multiplication assignment.

template<class T>
tvalarray& tvalarray< T >::operator/= ( const tvalarray< T > &  a  )  [inline]

Division assignment.

template<class T>
tvalarray& tvalarray< T >::operator/= ( const T &  c  )  [inline]

Division assignment.

template<class T>
tvalarray& tvalarray< T >::operator%= ( const tvalarray< T > &  a  )  [inline]

Remainder assignment.

template<class T>
tvalarray& tvalarray< T >::operator%= ( const T &  c  )  [inline]

Remainder assignment.

template<class T>
tvalarray& tvalarray< T >::operator= ( const T &  c  )  [inline]

Assignment operation.

template<class T>
tvalarray& tvalarray< T >::operator-= ( const T &  c  )  [inline]

Subtraction assignment.

template<class T>
tvalarray& tvalarray< T >::operator-= ( const tvalarray< T > &  a  )  [inline]

Subtraction assignment.

template<class T>
void tvalarray< T >::resize ( unsigned  _n,
value = T() 
) [inline]

Resize array and initialize all elements.

template<class T>
T tvalarray< T >::operator[] ( int  k  )  const [inline]

Gets the kth element.

template<class T>
T& tvalarray< T >::operator[] ( int  k  )  [inline]

Gets the kth element.

template<class T>
tvalarray< T > tvalarray< T >::shift ( int  k  )  const [inline]

Returns a shifted array.

template<class T>
tvalarray< T > tvalarray< T >::cshift ( int  k  )  const [inline]

Returns a rotated array.

template<class T>
void tvalarray< T >::realloc ( int  _n  )  [inline]

(Re)allocate array.


Friends And Related Function Documentation

template<class T>
template<class Tp>
void copy ( const tvalarray< Tp > &  source,
tvalarray< Tp > &  dest 
) [friend]

Copy (also realloc if necessary).

The instance for Tp!=tvalarray<>.

template<class T>
template<class Tp>
void copy ( const tvalarray< tvalarray< Tp > > &  source,
tvalarray< tvalarray< Tp > > &  dest 
) [friend]

Copy (also realloc if necessary).

The instance for Tp==tvalarray<>.

template<class T>
template<class Tp>
void resize ( tvalarray< Tp > &  arr,
unsigned  _n,
Tp  value = Tp() 
) [friend]

Resize array and initialize all elements.

template<class T>
template<class Tp>
void resize ( tvalarray< tvalarray< Tp > > &  arr,
unsigned  _n,
tvalarray< Tp >  value = tvalarray< Tp >() 
) [friend]

Resize array and initialize all elements in hyper-arrays.


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

Generated on Wed Jun 17 18:46:47 2009 for GridRipper by  doxygen 1.5.6