Chombo + EB + MF  3.2
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
IndexTM< T, N > Class Template Reference

#include <IndexTM.H>

Inheritance diagram for IndexTM< T, N >:
Inheritance graph
[legend]

Public Member Functions

template<typename OP >
bool operatorCompare (const IndexTM< T, N > &a_p, const OP &a_op) const
 
template<typename OP >
IndexTM< T, N > & operatorOpEquals (const IndexTM< T, N > &a_p, const OP &a_op)
 
template<typename OP >
IndexTM< T, N > & operatorOpEquals (const T &a_p, const OP &a_op)
 
IndexTMreciprocal ()
 
int minDir (bool a_doAbs) const
 
int maxDir (bool a_doAbs) const
 
integer_factorial (int n) const
 
factorial () const
 
Constructors and Accessors

See derived class IndexTM for more constructors.

 IndexTM ()
 
 ~IndexTM ()
 
 IndexTM (T a_i)
 
 IndexTM (T a_i, T a_j)
 
 IndexTM (T a_i, T a_j, T a_k)
 
 IndexTM (T a_i, T a_j, T a_k, T a_l)
 
 IndexTM (T a_i, T a_j, T a_k, T a_l, T a_m)
 
 IndexTM (T a_i, T a_j, T a_k, T a_l, T a_m, T a_n)
 
 IndexTM (const T *a_a)
 
 IndexTM (const IndexTM &a_rhs)
 
IndexTM copy () const
 
IndexTMoperator= (const IndexTM &a_rhs)
 
T & operator[] (int a_i)
 
operator[] (int a_i) const
 
void setVal (int a_i, T a_val)
 
void setAll (T a_val)
 
Data pointer functions
const T * getVect () const
 
const T * dataPtr () const
 
T * dataPtr ()
 
Comparison Operators
bool operator== (const IndexTM &a_p) const
 
bool operator!= (const IndexTM &a_p) const
 
bool lexLT (const IndexTM &a_s) const
 
bool operator< (const IndexTM &a_s) const
 
bool componentwiseLE (const IndexTM &a_s)
 
bool lexGT (const IndexTM &a_s) const
 
Unary operators
IndexTM operator+ () const
 
IndexTM operator- () const
 
dotProduct (const IndexTM &a_rhs) const
 
sum () const
 
product () const
 
Other arithmetic operators
IndexTMmin (const IndexTM &a_p)
 
IndexTMmax (const IndexTM &a_p)
 
IndexTMscale (T a_s)
 
IndexTMreflect (T a_refIx, int a_idir)
 
IndexTMshift (int a_coord, T a_s)
 
IndexTMshift (const IndexTM &a_iv)
 
IndexTMdiagShift (T a_s)
 
IndexTMcoarsen (const IndexTM &a_p)
 
IndexTMcoarsen (T a_p)
 
- Public Member Functions inherited from GenericArithmeticable< T, IndexTM< T, N > >
virtual ~GenericArithmeticable ()
 
 GenericArithmeticable (IndexTM< T, N > *s)
 
bool operator< (const IndexTM< T, N > &) const
 
bool operator> (const IndexTM< T, N > &) const
 
bool operator<= (const IndexTM< T, N > &) const
 
bool operator>= (const IndexTM< T, N > &) const
 
IndexTM< T, N > & operator+= (const IndexTM< T, N > &)
 
IndexTM< T, N > & operator+= (const T &)
 
IndexTM< T, N > & operator-= (const IndexTM< T, N > &)
 
IndexTM< T, N > & operator-= (const T &)
 
IndexTM< T, N > & operator*= (const IndexTM< T, N > &)
 
IndexTM< T, N > & operator*= (const T &)
 
IndexTM< T, N > & operator/= (const IndexTM< T, N > &)
 
IndexTM< T, N > & operator/= (const T &)
 

Protected Member Functions

 IndexTM (const char *)
 

Protected Attributes

m_vect [N]
 

I/O Functions

void printOn (std::ostream &a_os) const
 
void p () const
 
void dumpOn (std::ostream &a_os) const
 
std::ostream & operator<< (std::ostream &a_os, const IndexTM &a_iv)
 
std::istream & operator>> (std::istream &a_os, IndexTM &a_iv)
 

Constants

static const IndexTM Zero
 
static const IndexTM Unit
 
void linearIn (const void *a_inBuf)
 
void linearOut (void *a_outBuf) const
 
static int InitStatics ()
 

Additional Inherited Members

- Public Types inherited from GenericArithmeticable< T, IndexTM< T, N > >
typedef T scalar_type
 
typedef IndexTM< T, Nself_type
 

Constructor & Destructor Documentation

template<typename T, int N>
IndexTM< T, N >::IndexTM ( )
inline

Construct an IndexTM whose components are uninitialized.

template<typename T, int N>
IndexTM< T, N >::~IndexTM ( )
inline

Destructor.

template<typename T, int N>
IndexTM< T, N >::IndexTM ( a_i)
explicit

References IndexTM< T, N >::m_vect, and N.

template<typename T, int N>
IndexTM< T, N >::IndexTM ( a_i,
a_j 
)

References IndexTM< T, N >::m_vect, and N.

template<typename T, int N>
IndexTM< T, N >::IndexTM ( a_i,
a_j,
a_k 
)

References IndexTM< T, N >::m_vect, and N.

template<typename T, int N>
IndexTM< T, N >::IndexTM ( a_i,
a_j,
a_k,
a_l 
)

References IndexTM< T, N >::m_vect, and N.

template<typename T, int N>
IndexTM< T, N >::IndexTM ( a_i,
a_j,
a_k,
a_l,
a_m 
)

References IndexTM< T, N >::m_vect, and N.

template<typename T, int N>
IndexTM< T, N >::IndexTM ( a_i,
a_j,
a_k,
a_l,
a_m,
a_n 
)

References IndexTM< T, N >::m_vect, and N.

template<typename T, int N>
IndexTM< T, N >::IndexTM ( const T *  a_a)
inlineexplicit

Construct an IndexTM setting the coordinates to the corresponding values in the integer array a_a.

References IndexTM< T, N >::m_vect, and N.

template<typename T, int N>
IndexTM< T, N >::IndexTM ( const IndexTM< T, N > &  a_rhs)
inline

The copy constructor.

References IndexTM< T, N >::m_vect, and N.

template<typename T, int N>
IndexTM< T, N >::IndexTM ( const char *  a_reference)
inlineprotected

Member Function Documentation

template<typename T, int N>
IndexTM IndexTM< T, N >::copy ( ) const
inline
template<typename T , int N>
IndexTM< T, N > & IndexTM< T, N >::operator= ( const IndexTM< T, N > &  a_rhs)
inline

The assignment operator.

References IndexTM< T, N >::m_vect, and N.

template<typename T , int N>
T & IndexTM< T, N >::operator[] ( int  a_i)
inline

Returns a modifiable lvalue reference to the i'th coordinate of the IndexTM.

References CH_assert, and N.

template<typename T , int N>
T IndexTM< T, N >::operator[] ( int  a_i) const
inline

Returns the i'th coordinate of the IndexTM.

References CH_assert, and N.

template<typename T, int N>
void IndexTM< T, N >::setVal ( int  a_i,
a_val 
)
inline

Set i'th coordinate of IndexTM to val.

References CH_assert, and N.

template<typename T, int N>
void IndexTM< T, N >::setAll ( a_val)
inline

set all values to val

References N.

Referenced by checkMoments(), and IndexTM< T, N >::IndexTM().

template<typename T , int N>
const T * IndexTM< T, N >::getVect ( ) const
inline

Returns a const pointer to an array of coordinates of the IndexTM. Useful for arguments to FORTRAN calls.

template<typename T , int N>
const T * IndexTM< T, N >::dataPtr ( ) const
inline

Only for sending to Fortran

Referenced by BASISV_TM().

template<typename T , int N>
T * IndexTM< T, N >::dataPtr ( )
inline

Only for sending to Fortran

template<typename T , int N>
bool IndexTM< T, N >::operator== ( const IndexTM< T, N > &  a_p) const
inline

Returns true if this IndexTM is equivalent to argument IndexTM. All comparisons between analogous components must be satisfied.

References IndexTM< T, N >::m_vect.

template<typename T , int N>
bool IndexTM< T, N >::operator!= ( const IndexTM< T, N > &  a_p) const
inline

Returns true if this IndexTM is different from argument IndexTM. All comparisons between analogous components must be satisfied.

template<typename T , int N>
bool IndexTM< T, N >::lexLT ( const IndexTM< T, N > &  a_s) const
inline

Returns true if this IndexTM is lexically less than the argument. An IndexTM MUST BE either lexically less than, lexically greater than, or equal to another IndexTM.

iv1 is lexically less than iv2 if:

in 2-D:
(iv1[0] < iv2[0]) || ((iv1[0] == iv2[0]) && (iv1[1] < iv2[1]));

in 3-D:
(iv1[0] < iv2[0]) || (iv1[0]==iv2[0] && ((iv1[1] < iv2[1] || ((iv1[1] == iv2[1]) && (iv1[2] < iv2[2])))));

References IndexTM< T, N >::m_vect.

Referenced by IndexTM< Real, GLOBALDIM >::operator<().

template<typename T, int N>
bool IndexTM< T, N >::operator< ( const IndexTM< T, N > &  a_s) const
inline

Returns true if this IndexTM is lexically less than the argument. An IndexTM MUST BE either lexically less than, lexically greater than, or equal to another IndexTM.

iv1 is lexically less than iv2 if:

in 2-D:
(iv1[0] < iv2[0]) || ((iv1[0] == iv2[0]) && (iv1[1] < iv2[1]));

in 3-D:
(iv1[0] < iv2[0]) || (iv1[0]==iv2[0] && ((iv1[1] < iv2[1] || ((iv1[1] == iv2[1]) && (iv1[2] < iv2[2])))));

template<typename T, int N>
bool IndexTM< T, N >::componentwiseLE ( const IndexTM< T, N > &  a_s)
inline

Does operator <= the same way that intvect does it Intvect code looks like this: return D_TERM6(vect[0] >= p[0], && vect[1] >= p[1], && vect[2] >= p[2], && vect[3] >= p[3], && vect[4] >= p[4], && vect[5] >= p[5]);

Referenced by IndexedMoments< Dim, P >::shift().

template<typename T , int N>
bool IndexTM< T, N >::lexGT ( const IndexTM< T, N > &  a_s) const
inline

Returns true if this IndexTM is lexically greater than the argument. An IndexTM MUST BE either lexically less than, lexically greater than, or equal to another IndexTM.

iv1 is lexically less than iv2 if:

in 2-D:
(iv1[0] > iv2[0]) || ((iv1[0] == iv2[0]) && (iv1[1] > iv2[1]));

in 3-D:
(iv1[0] > iv2[0]) || (iv1[0]==iv2[0] && ((iv1[1] > iv2[1] || ((iv1[1] == iv2[1]) && (iv1[2] > iv2[2])))));

References IndexTM< T, N >::m_vect.

template<typename T , int N>
IndexTM< T, N > IndexTM< T, N >::operator+ ( ) const
inline

Unary plus – for completeness.

template<typename T , int N>
IndexTM< T, N > IndexTM< T, N >::operator- ( ) const
inline

Unary minus – negates all components of this IndexTM.

References IndexTM< T, N >::m_vect, and N.

template<typename T , int N>
T IndexTM< T, N >::dotProduct ( const IndexTM< T, N > &  a_rhs) const
inline

References IndexTM< T, N >::m_vect, and N.

template<typename T , int N>
T IndexTM< T, N >::sum ( ) const
inline
template<typename T , int N>
T IndexTM< T, N >::product ( ) const
inline

Product of all components of this IndexTM.

template<typename T, int N>
template<typename OP >
bool IndexTM< T, N >::operatorCompare ( const IndexTM< T, N > &  a_p,
const OP &  a_op 
) const

Used by GenericArithmeticable to implement all pointwise arithmetic and comparison functions.

References IndexTM< T, N >::m_vect.

template<typename T, int N>
template<typename OP >
IndexTM< T, N > & IndexTM< T, N >::operatorOpEquals ( const IndexTM< T, N > &  a_p,
const OP &  a_op 
)
inline
template<typename T, int N>
template<typename OP >
IndexTM< T, N > & IndexTM< T, N >::operatorOpEquals ( const T &  a_p,
const OP &  a_op 
)
inline
template<typename T , int N>
IndexTM< T, N > & IndexTM< T, N >::reciprocal ( )
inline

Modifies this IndexTM by division of each component into T(1).

References N.

template<typename T , int N>
int IndexTM< T, N >::minDir ( bool  a_doAbs) const
inline

Component with the minimum value of this Index(returns 0 if they are all the same). a_doAbs : if true then take the absolute value before comparing

References N.

template<typename T , int N>
int IndexTM< T, N >::maxDir ( bool  a_doAbs) const
inline

Component with the maximum value of this Index (returns 0 if they are all the same). a_doAbs : if true then take the absolute value before comparing.

References N.

template<typename T , int N>
IndexTM< T, N > & IndexTM< T, N >::min ( const IndexTM< T, N > &  a_p)
inline

Modifies this IndexTM by taking component-wise min with IndexTM argument.

References IndexTM< T, N >::m_vect, and N.

Referenced by min().

template<typename T , int N>
IndexTM< T, N > & IndexTM< T, N >::max ( const IndexTM< T, N > &  a_p)
inline

Modifies this IndexTM by taking component-wise max with IndexTM argument.

References IndexTM< T, N >::m_vect, and N.

Referenced by max().

template<typename T, int N>
IndexTM< T, N > & IndexTM< T, N >::scale ( a_s)
inline

Modifies this IndexTM by multiplying each component by a scalar.

template<typename T, int N>
IndexTM< T, N > & IndexTM< T, N >::reflect ( a_refIx,
int  a_idir 
)
inline

Modifies IndexTM by reflecting it in the plane defined by the index ref_ix and with normal in the direction of idir. Directions are based at zero.

References CH_assert, and N.

Referenced by reflect().

template<typename T, int N>
IndexTM< T, N > & IndexTM< T, N >::shift ( int  a_coord,
a_s 
)
inline

Modifies this IndexTM by adding s to component in given coordinate direction.

References CH_assert, and N.

template<typename T, int N>
IndexTM< T, N > & IndexTM< T, N >::shift ( const IndexTM< T, N > &  a_iv)
inline

Modifies this IndexTM by component-wise addition with IndexTM argument.

template<typename T, int N>
IndexTM< T, N > & IndexTM< T, N >::diagShift ( a_s)
inline

Modifies this IndexTM by adding a scalar s to each component.

template<typename T , int N>
IndexTM< T, N > & IndexTM< T, N >::coarsen ( const IndexTM< T, N > &  a_p)
inline

Modify IndexTM by component-wise integer projection.

References CH_assert, IndexTM< T, N >::m_vect, and N.

Referenced by coarsen().

template<typename T, int N>
IndexTM< T, N > & IndexTM< T, N >::coarsen ( a_p)
inline

Modify IndexTM by component-wise integer projection.

References CH_assert, and N.

template<typename T, int N>
void IndexTM< T, N >::printOn ( std::ostream &  a_os) const

Print an IndexTM to the ostream.

template<typename T , int N>
void IndexTM< T, N >::p ( ) const

Print an IndexTM to the pout().

References pout().

template<typename T, int N>
void IndexTM< T, N >::dumpOn ( std::ostream &  a_os) const

Print an IndexTM to the ostream a bit more verbosely.

template<typename T, int N>
static int IndexTM< T, N >::InitStatics ( )
static

Initializes Zero and Unit.

template<typename T , int N>
void IndexTM< T, N >::linearIn ( const void *  a_inBuf)

Low-level data copy.

References N.

template<typename T , int N>
void IndexTM< T, N >::linearOut ( void *  a_outBuf) const

References N.

template<typename T, int N>
T IndexTM< T, N >::integer_factorial ( int  n) const
inline
template<typename T, int N>
T IndexTM< T, N >::factorial ( ) const
inline

Friends And Related Function Documentation

template<typename T, int N>
std::ostream& operator<< ( std::ostream &  a_os,
const IndexTM< T, N > &  a_iv 
)
friend

Print the IndexTM to given output stream in ASCII.

template<typename T, int N>
std::istream& operator>> ( std::istream &  a_os,
IndexTM< T, N > &  a_iv 
)
friend

Read next IndexTM from given input stream.

Member Data Documentation

template<typename T, int N>
const IndexTM< T, N > IndexTM< T, N >::Zero
static
template<typename T, int N>
const IndexTM< T, N > IndexTM< T, N >::Unit
static

This is an IndexTM all of whose components are equal to one.

template<typename T, int N>
T IndexTM< T, N >::m_vect[N]
protected

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