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

◆ IndexTM() [1/10]

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

Construct an IndexTM whose components are uninitialized.

Referenced by IndexTM< Real, GLOBALDIM >::factorial(), and IndexTM< Real, GLOBALDIM >::~IndexTM().

◆ ~IndexTM()

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

Destructor.

◆ IndexTM() [2/10]

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

◆ IndexTM() [3/10]

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

◆ IndexTM() [4/10]

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

◆ IndexTM() [5/10]

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

◆ IndexTM() [6/10]

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

◆ IndexTM() [7/10]

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

◆ IndexTM() [8/10]

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.

◆ IndexTM() [9/10]

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

The copy constructor.

◆ IndexTM() [10/10]

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

Member Function Documentation

◆ copy()

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

◆ operator=()

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

The assignment operator.

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

◆ operator[]() [1/2]

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.

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

◆ operator[]() [2/2]

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

Returns the i'th coordinate of the IndexTM.

◆ setVal()

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

Set i'th coordinate of IndexTM to val.

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

◆ setAll()

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

◆ getVect()

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.

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

◆ dataPtr() [1/2]

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

Only for sending to Fortran

Referenced by BASISV_TM(), and IndexTM< Real, GLOBALDIM >::copy().

◆ dataPtr() [2/2]

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

Only for sending to Fortran

◆ operator==()

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.

Referenced by IndexTM< Real, GLOBALDIM >::copy(), and IndexTM< Real, GLOBALDIM >::operator!=().

◆ operator!=()

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.

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

◆ lexLT()

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])))));

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

◆ operator<()

template<typename T, int N = CH_SPACEDIM>
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])))));

◆ componentwiseLE()

template<typename T, int N = CH_SPACEDIM>
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< SpaceDim, CH_EBIS_ORDER >::shift().

◆ lexGT()

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])))));

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

◆ operator+()

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

Unary plus – for completeness.

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

◆ operator-()

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

Unary minus – negates all components of this IndexTM.

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

◆ dotProduct()

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

◆ sum()

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

◆ product()

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

Product of all components of this IndexTM.

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

◆ operatorCompare()

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.

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

◆ operatorOpEquals() [1/2]

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

◆ operatorOpEquals() [2/2]

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

◆ reciprocal()

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

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

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

◆ minDir()

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

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

◆ maxDir()

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.

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

◆ min()

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.

Referenced by IndexTM< Real, GLOBALDIM >::componentwiseLE(), and min().

◆ max()

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.

Referenced by IndexTM< Real, GLOBALDIM >::componentwiseLE(), and max().

◆ scale()

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.

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

◆ reflect()

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.

Referenced by IndexTM< Real, GLOBALDIM >::componentwiseLE(), and reflect().

◆ shift() [1/2]

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.

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

◆ shift() [2/2]

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.

◆ diagShift()

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.

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

◆ coarsen() [1/2]

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.

Referenced by coarsen(), and IndexTM< Real, GLOBALDIM >::componentwiseLE().

◆ coarsen() [2/2]

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

Modify IndexTM by component-wise integer projection.

◆ printOn()

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

Print an IndexTM to the ostream.

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

◆ p()

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

◆ dumpOn()

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

Print an IndexTM to the ostream a bit more verbosely.

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

◆ InitStatics()

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

Initializes Zero and Unit.

◆ linearIn()

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

Low-level data copy.

◆ linearOut()

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

◆ integer_factorial()

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

◆ factorial()

template<typename T, int N = CH_SPACEDIM>
T IndexTM< T, N >::factorial ( ) const
inline

Friends And Related Function Documentation

◆ operator<<

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

Print the IndexTM to given output stream in ASCII.

◆ operator>>

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

Read next IndexTM from given input stream.

Member Data Documentation

◆ Zero

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

◆ Unit

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

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

◆ m_vect

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

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