Public Member Functions | Private Attributes
Sundance::ArrayOfTuples< T > Class Template Reference

Class ArrayOfTuples packs an heterogeneous array of tuples into a single 1D array. More...

List of all members.

Public Member Functions

 ArrayOfTuples ()
 Empty ctor.
 ArrayOfTuples (int tupleSize)
 Constructor specifying the size of each tuple, but not the number of tuples.
 ArrayOfTuples (int numTuples, int tupleSize)
 Constructor specifying both the size and number of the tuples.
int length () const
 Returns the number of tuples.
int tupleSize () const
 Returns the size of the tuples.
void resize (int newSize)
 Change the number of tuples.
void resize (int newSize, int newTupleSize)
 Change the number and size of the tuples.
void reserve (int newSize)
 Reserve memory for a number of tuples.
void setTupleSize (int tupleSize)
 Specify the size of the tuples.
const T & value (int i, int j) const
 Get the j-th entry in the i-th tuple.
T & value (int i, int j)
 Get the j-th entry in the i-th tuple.
void append (const Array< T > &x)
 Append a new tuple to the array.
void append (const T *x, int n)
 Append a new tuple to the array.

Private Attributes

int numTuples_
int tupleSize_
Array< T > data_

Detailed Description

template<class T>
class Sundance::ArrayOfTuples< T >

Class ArrayOfTuples packs an heterogeneous array of tuples into a single 1D array.

Definition at line 45 of file SundanceArrayOfTuples.hpp.


Constructor & Destructor Documentation

template<class T >
Sundance::ArrayOfTuples< T >::ArrayOfTuples ( ) [inline]

Empty ctor.

Definition at line 105 of file SundanceArrayOfTuples.hpp.

template<class T >
Sundance::ArrayOfTuples< T >::ArrayOfTuples ( int  tupleSize) [inline]

Constructor specifying the size of each tuple, but not the number of tuples.

Definition at line 109 of file SundanceArrayOfTuples.hpp.

template<class T >
Sundance::ArrayOfTuples< T >::ArrayOfTuples ( int  numTuples,
int  tupleSize 
) [inline]

Constructor specifying both the size and number of the tuples.

Definition at line 113 of file SundanceArrayOfTuples.hpp.


Member Function Documentation

template<class T>
void Sundance::ArrayOfTuples< T >::append ( const Array< T > &  x) [inline]
template<class T>
void Sundance::ArrayOfTuples< T >::append ( const T *  x,
int  n 
) [inline]

Append a new tuple to the array.

Definition at line 126 of file SundanceArrayOfTuples.hpp.

template<class T>
int Sundance::ArrayOfTuples< T >::length ( ) const [inline]
template<class T>
void Sundance::ArrayOfTuples< T >::reserve ( int  newSize) [inline]

Reserve memory for a number of tuples.

Definition at line 79 of file SundanceArrayOfTuples.hpp.

Referenced by Sundance::BasicSimplicialMesh::estimateNumElements().

template<class T>
void Sundance::ArrayOfTuples< T >::resize ( int  newSize,
int  newTupleSize 
) [inline]

Change the number and size of the tuples.

Definition at line 71 of file SundanceArrayOfTuples.hpp.

template<class T>
void Sundance::ArrayOfTuples< T >::resize ( int  newSize) [inline]
template<class T>
void Sundance::ArrayOfTuples< T >::setTupleSize ( int  tupleSize) [inline]

Specify the size of the tuples.

Definition at line 82 of file SundanceArrayOfTuples.hpp.

Referenced by Sundance::BasicSimplicialMesh::BasicSimplicialMesh().

template<class T>
int Sundance::ArrayOfTuples< T >::tupleSize ( ) const [inline]
template<class T>
T& Sundance::ArrayOfTuples< T >::value ( int  i,
int  j 
) [inline]

Get the j-th entry in the i-th tuple.

Definition at line 88 of file SundanceArrayOfTuples.hpp.

template<class T>
const T& Sundance::ArrayOfTuples< T >::value ( int  i,
int  j 
) const [inline]

Member Data Documentation

template<class T>
Array<T> Sundance::ArrayOfTuples< T >::data_ [private]
template<class T>
int Sundance::ArrayOfTuples< T >::numTuples_ [private]
template<class T>
int Sundance::ArrayOfTuples< T >::tupleSize_ [private]

Site Contact