31 template<
typename T,
int N> ostream&
operator<< (ostream & a_os,
36 for (
int i = 0; i < N; ++i)
59 #define CH_IGNORE_MAX 100000 61 template<
typename T,
int N> istream&
operator>> (istream & a_is,
74 for (
int i = 1; i < N; ++i)
85 for (
int i = 1; i < N; ++i)
93 MayDay::Abort(
"operator>>(istream&,Index&): expected \'(\' or \'<\'");
106 a_os <<
"Index: " << *
this <<
"\n";
111 pout() << *
this <<
"\n";
116 a_os <<
"Index " << *
this <<
"\n";
151 memcpy(
m_vect, a_a, N*
sizeof(T));
157 if (a_reference[0] == 48)
setAll(0);
158 else if(a_reference[0] == 49)
setAll(1);
196 for (
int i = 0; i < N; i++)
219 return Metaprograms::pointwiseCompare<N,T,std::equal_to<T> >(
m_vect,a_p.
m_vect);
245 for (
int i = 0; i < N; ++i)
256 std::multiplies<T> >()(
m_vect,
271 const OP & a_op)
const 273 return Metaprograms::pointwiseCompare<N,T,OP>(
m_vect,a_p.
m_vect);
300 return ::fabs(a_a) < ::fabs(a_b);
326 template<
typename T>
static T
ourmin(T a_a,
329 return ((a_a < a_b) ? a_a : a_b);
332 template<
typename T>
static T
ourmax(T a_a,
335 return (a_a > a_b ? a_a : a_b);
341 std::ptr_fun(ourmin<T>));
348 std::ptr_fun(ourmax<T>));
355 return (*
this) *= a_s;
376 return (*
this) += a_iv;
381 return (*
this) += a_s;
400 return result.
min(a_p2);
407 return result.
max(a_p2);
423 return result.
reflect(a_refIx, a_idir);
429 return (a_a < 0 ? T(-::fabs(a_a+1))/a_b-1 : a_a/a_b);
462 std::bind2nd(std::ptr_fun(ourcoarsen<T>),a_s));
475 memcpy(
m_vect, (T*)a_inBuf, N*
sizeof(T));
480 memcpy((T*)a_outBuf,
m_vect, N*
sizeof(T));
486 STATIC_ASSERT(N == 1);
494 STATIC_ASSERT(N == 2);
504 STATIC_ASSERT(N == 3);
516 STATIC_ASSERT(N == 4);
530 STATIC_ASSERT(N == 5);
546 STATIC_ASSERT(N == 6);
584 #endif // include guard const T * dataPtr() const
Definition: IndexTMI.H:202
std::ostream & pout()
Use this in place of std::cout for program output.
void dumpOn(std::ostream &a_os) const
Definition: IndexTMI.H:114
istream & operator>>(istream &a_is, IndexTM< T, N > &a_p)
Definition: IndexTMI.H:61
IndexTM< T, N > & operatorOpEquals(const IndexTM< T, N > &a_p, const OP &a_op)
Definition: IndexTMI.H:284
#define CH_assert(cond)
Definition: CHArray.H:37
IndexTM()
Definition: IndexTM.H:93
void setAll(T a_val)
Definition: IndexTMI.H:194
static bool abscompare(const T &a_a, const T &a_b)
Definition: IndexTMI.H:297
bool operator!=(const IndexTM &a_p) const
Definition: IndexTMI.H:222
IndexTM operator-() const
Definition: IndexTMI.H:242
static T ourmin(T a_a, T a_b)
Definition: IndexTMI.H:326
Definition: GenericArithmetic.H:54
T dotProduct(const IndexTM &a_rhs) const
Definition: IndexTMI.H:252
IndexTM< T, N > BASISV_TM(int a_dir)
Definition: IndexTMI.H:410
IndexTM & reciprocal()
Definition: IndexTMI.H:291
bool lexLT(const IndexTM &a_s) const
Definition: IndexTMI.H:227
IndexTM & diagShift(T a_s)
Definition: IndexTMI.H:379
void setVal(int a_i, T a_val)
Definition: IndexTMI.H:187
T sum() const
Definition: IndexTMI.H:260
T & operator[](int a_i)
Definition: IndexTMI.H:175
static T ourcoarsen(T a_a, T a_b)
Definition: IndexTMI.H:426
IndexTM & reflect(T a_refIx, int a_idir)
Definition: IndexTMI.H:358
IndexTM operator+() const
Definition: IndexTMI.H:237
bool lexGT(const IndexTM &a_s) const
Definition: IndexTMI.H:232
IndexTM & coarsen(const IndexTM &a_p)
Definition: IndexTMI.H:466
IndexTM & scale(T a_s)
Definition: IndexTMI.H:353
IndexTM & min(const IndexTM &a_p)
Definition: IndexTMI.H:338
bool operator==(const IndexTM &a_p) const
Definition: IndexTMI.H:217
static void Error(const char *const a_msg=m_nullString, int m_exitCode=CH_DEFAULT_ERROR_CODE)
Print out message to cerr and exit with the specified exit code.
void linearOut(void *a_outBuf) const
Definition: IndexTMI.H:478
T product() const
Definition: IndexTMI.H:265
bool operatorCompare(const IndexTM< T, N > &a_p, const OP &a_op) const
Definition: IndexTMI.H:270
#define CH_IGNORE_MAX
Definition: IndexTMI.H:59
void p() const
Definition: IndexTMI.H:109
ostream & operator<<(ostream &a_os, const IndexTM< T, N > &a_p)
Definition: IndexTMI.H:31
const T * getVect() const
Definition: IndexTMI.H:212
IndexTM & max(const IndexTM &a_p)
Definition: IndexTMI.H:345
IndexTM & shift(int a_coord, T a_s)
Definition: IndexTMI.H:366
void linearIn(const void *a_inBuf)
Definition: IndexTMI.H:473
void printOn(std::ostream &a_os) const
Definition: IndexTMI.H:104
int minDir(bool a_doAbs) const
Definition: IndexTMI.H:302
IndexTM & operator=(const IndexTM &a_rhs)
Definition: IndexTMI.H:169
static T ourmax(T a_a, T a_b)
Definition: IndexTMI.H:332
T m_vect[N]
Definition: IndexTM.H:460
static void Abort(const char *const a_msg=m_nullString)
Print out message to cerr and exit via abort() (if serial) or MPI_Abort() (if parallel).
int maxDir(bool a_doAbs) const
Definition: IndexTMI.H:314