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);
299 return Abs(a_a) <
Abs(a_b);
325 template<
typename T>
static T
ourmin(T a_a,
328 return ((a_a < a_b) ? a_a : a_b);
331 template<
typename T>
static T
ourmax(T a_a,
334 return (a_a > a_b ? a_a : a_b);
340 std::ptr_fun(ourmin<T>));
347 std::ptr_fun(ourmax<T>));
353 return (*
this) *= a_s;
374 return (*
this) += a_iv;
379 return (*
this) += a_s;
398 return result.
min(a_p2);
405 return result.
max(a_p2);
421 return result.
reflect(a_refIx, a_idir);
427 return (a_a < 0 ? T(-
Abs(a_a+1))/a_b-1 : a_a/a_b);
460 std::bind2nd(std::ptr_fun(ourcoarsen<T>),a_s));
473 memcpy(
m_vect, (T*)a_inBuf,
N*
sizeof(T));
478 memcpy((T*)a_outBuf,
m_vect,
N*
sizeof(T));
484 static_assert(
N == 1,
"N==1");
492 static_assert(
N == 2,
"N==2");
502 static_assert(
N == 3,
"N==3");
514 static_assert(
N == 4,
"N==4");
528 static_assert(
N == 5,
"N==5");
544 static_assert(
N == 6,
"N==6");
582 #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:283
#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:296
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:325
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:408
IndexTM & reciprocal()
Definition: IndexTMI.H:290
bool lexLT(const IndexTM &a_s) const
Definition: IndexTMI.H:227
IndexTM & diagShift(T a_s)
Definition: IndexTMI.H:377
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:424
IndexTM & reflect(T a_refIx, int a_idir)
Definition: IndexTMI.H:356
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:464
IndexTM & scale(T a_s)
Definition: IndexTMI.H:351
IndexTM & min(const IndexTM &a_p)
Definition: IndexTMI.H:337
T Abs(const T &a_a)
Definition: Misc.H:53
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:476
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
void const char const int const int * N
Definition: Lapack.H:83
IndexTM & max(const IndexTM &a_p)
Definition: IndexTMI.H:344
IndexTM & shift(int a_coord, T a_s)
Definition: IndexTMI.H:364
void linearIn(const void *a_inBuf)
Definition: IndexTMI.H:471
void printOn(std::ostream &a_os) const
Definition: IndexTMI.H:104
int minDir(bool a_doAbs) const
Definition: IndexTMI.H:301
IndexTM & operator=(const IndexTM &a_rhs)
Definition: IndexTMI.H:169
static T ourmax(T a_a, T a_b)
Definition: IndexTMI.H:331
T m_vect[N]
Definition: IndexTM.H:522
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:313