12 #define INFINITY HUGE_VAL
15 #define MSG(x) {cout << x << endl;}
16 #define ABS(x) ( ((x) < 0) ? -(x) : (x))
17 #define SIGN(x) ( ((x) < 0) ? -1 : +1)
19 #define MAX(x,y) ( ((x) > (y)) ? (x) : (y))
20 #define MIN(x,y) ( ((x) < (y)) ? (x) : (y))
64 stream.read((
char*) &iTmp,
sizeof(
int));
65 rtValue = (Type) iTmp;
66 }
else if(tType ==
FLOAT) {
68 stream.read((
char*) &fTmp,
sizeof(
float));
69 rtValue = (Type) fTmp;
70 }
else if(tType ==
DOUBLE) {
72 stream.read((
char*) &dTmp,
sizeof(
double));
73 rtValue = (Type) dTmp;
80 #define IRAND(x,y) ((x) + (int)(((float) (y - x)) * rand()/(RAND_MAX+1.0)))
87 Type
getRank(
int iRank,
int iDim, Type* pfVector);
96 #define ML_NAN_CHK(var) if(!isnan(var)) {cerr << "ML_NAN_CHK failed in File: " << __FILE__ << " Line: " << __LINE__ << ". " << #var << "!= NAN" << endl; abort();}
98 #define ML_NOT_NAN_CHK(var) if(isnan(var)) {cerr << "ML_NOT_NAN_CHK failed in File: " << __FILE__ << " Line: " << __LINE__ << ". " << #var << "== NAN" << endl; abort();}
101 #define ML_NULL_CHK(var) if((var) != NULL) {cerr << "ML_NULL_CHK failed in File: " << __FILE__ << " Line: " << __LINE__ << ". " << #var << "!= NULL" << endl; abort();}
103 #define ML_NOT_NULL_CHK(var) if((var) == NULL) {cerr << "ML_NOT_NULL_CHK failed in File: " << __FILE__ << " Line: " << __LINE__ << ". " << #var << "== NULL" << endl; abort();}
107 #define ML_BOOL_CHK(var) if(!(var)) {cerr << "ML_BOOL_CHK failed in File: " << __FILE__ << " Line: " << __LINE__ << ". " << #var << "=" << var << endl; abort();}
111 #define ML_LS_CHK(var, val) if((var) >= (val)) {cerr << "ML_LS_CHK failed in File: " << __FILE__ << " Line: " << __LINE__ << ". " << #var << "=" << var << " >= " << val << endl; abort();}
113 #define ML_LEQ_CHK(var, val) if((var) > (val)) {cerr << "ML_LEQ_CHK failed in File: " << __FILE__ << " Line: " << __LINE__ << ". " << #var << "=" << var << " > " << val << endl; abort();}
117 #define ML_GR_CHK(var, val) if((var) <= (val)) {cerr << "ML_GR_CHK failed in File: " << __FILE__ << " Line: " << __LINE__ << ". " << #var << "=" << var << " <= " << val << endl; abort();}
119 #define ML_GEQ_CHK(var, val) if((var) < (val)) {cerr << "ML_GEQ_CHK failed in File: " << __FILE__ << " Line: " << __LINE__ << ". " << #var << "=" << var << " < " << val << endl; abort();}
123 #define ML_EQ_CHK(var, val) if((var) != (val)) {cerr << "ML_EQ_CHK failed in File: " << __FILE__ << " Line: " << __LINE__ << ". " << #var << "=" << var << " != " << val << endl; abort();}
125 #define ML_NEQ_CHK(var, val) if((var) == (val)) {cerr << "ML_NEQ_CHK failed in File: " << __FILE__ << " Line: " << __LINE__ << ". " << #var << "=" << var << " == " << val << endl; abort();}
129 #define ML_RANGE_CHK(var, lower, upper) if((var)<(lower) && (var)>(upper)) {cerr << "ML_RANGE_CHK failed in File: " << __FILE__ << " Line: " << __LINE__ << ". " << #var << "=" << var << " out of range ["<<lower <<","<<upper<<"]" << endl; abort();}
132 #define ML_WARNING_MSG(x) {cerr << "ML_WARNING_MSG in File: " << __FILE__ << " Line: " << __LINE__ << endl << x << endl << endl; cerr << endl;}
136 #define ML_CRITICAL_MSG(x) {cerr << "ML_CRITICAL_MSG in File: " << __FILE__ << " Line: " << __LINE__ << endl << x << endl << endl; abort();}
139 #define ML_MSG(x) {cerr << "ML_MSG in File: " << __FILE__ << " Line: " << __LINE__ << endl << x << endl << endl; cerr << endl;}
157 void nDimFor(
const vector<Type>& rvtStart,
const vector<Type>& rvtEnd, vector<Type>& rvtIndices,
bool bInit);
160 void nDimForReverse(
const vector<Type>& rvtStart,
const vector<Type>& rvtEnd, vector<Type>& rvtIndices,
bool bInit);
172 double bico(
int n,
int k);
DATATYPE
Definition: CObject.h:39
void nDimFor(const vector< Type > &rvtStart, const vector< Type > &rvtEnd, vector< Type > &rvtIndices, bool bInit)
double bico(int n, int k)
void readValueOfType(Type &rtValue, fstream &stream, DATATYPE tType)
Definition: Macros.h:60
void nDimForReverse(const vector< Type > &rvtStart, const vector< Type > &rvtEnd, vector< Type > &rvtIndices, bool bInit)
Type getRank(int iRank, int iDim, Type *pfVector)