Test for the SimpleRigidArray module and associated functions.
96 cout <<
"Test SimpleRigidArray" << endl
97 <<
"=====================" << endl;
104 cout <<
"SimpleRigidArray<double, 6> A,B(8.);" << endl;
105 cout <<
"SimpleRigidArray<int, 4> C,D(100);" << endl;
113 cout <<
"const SimpleRigidArray<int, 4> E(D);" << endl;
116 cout <<
"SimpleRigidArray<float, 4> F(D);" << endl;
128 CODE( C[2]=
int(-13.2); )
158 cout <<
"Test raw array functions" << endl
159 <<
"========================" << endl << endl;
162 cout <<
"SimpleRigidArray<int, 4> A;" << endl;
164 cout <<
"SimpleRigidArray<int, 4> B;" << endl;
166 cout <<
"SimpleRigidArray<float, 4> C;" << endl;
168 CODE( A[0]=2; A[1]=3; A[2]=4; A[3]=5; )
169 CODE( B[0]=1; B[1]=3; B[2]=5; B[3]=7; )
170 CODE( C[0]=.1; C[1]=.3; C[2]=.5; C[3]=.7; )
176 section(
"reduction to scalar");
189 cout <<
"anysmaller A<B: " 191 cout <<
" anylarger A>B: " 195 cout <<
"anysmaller A<B: " 197 cout <<
" anylarger A>B: " 201 cout <<
"anysmaller A<B: " 203 cout <<
" anylarger A>B: " 207 cout <<
"anysmaller A<B: " 209 cout <<
" anylarger A>B: " void section(const char *s)
print headline
T inline_product(const SimpleRigidArray< T, N > &array)
Product of all elements.
#define FUNC(func)
print result of function
const char * boolchar(const bool &v)
return string for bool value
#define AFF_SIMPLEARRAYTEST_CC_VERSION
#define DUMP(A)
Dump any object through its dump function.
bool inline_anysmaller(const SimpleRigidArray< T, N > &A, const SimpleRigidArray< T, N > &B)
Returns true if any of A is smaller than corresponding B.
bool inline_anylarger(const SimpleRigidArray< T, N > &A, const SimpleRigidArray< T, N > &B)
Returns true if any of A is larger than corresponding B.
T inline_strideproduct(const SimpleRigidArray< T, N > &A, const SimpleRigidArray< T, N > &B)
Returns strided product.
#define CODE(C)
Dump code and execute (works like echo)
A very basic rigid array class (with deep inline copy).
T inline_sum(const SimpleRigidArray< T, N > &array)
Sum of all elements.
T inline_innerproduct(const SimpleRigidArray< T, N > &A, const SimpleRigidArray< T, N > &B)
Returns inner product.