// Testing functions for the BLAS sub-library #include //#define LA_COMPLEX_SUPPORT #include #include #include //#include using namespace std; // #ifndef __FILE__ // # define __FILE__ "unknown" // #endif // #ifndef __LINE__ // # define __LINE__ "unknown" // #endif #define check_assert(expr) if (!(expr)) { std::cout << __FILE__ << ": Failed check in line " << __LINE__ << std::endl; error = true; } int main() { bool error = false; { // Checking Blas_H_Dot_Prod LaVectorComplex a(3),b(3); a=LaComplex(1,0); b=LaComplex(1,0); check_assert(Blas_H_Dot_Prod(a,b) == LaComplex(3.0)); } { // Checking LaVectorDouble::inject LaVectorDouble m,n; m.resize(3,1); m=2.0; n.resize(2,1); n=1.0; m(LaIndex(0,1)).inject(n); check_assert(m(0) == 1.0); check_assert(m(1) == 1.0); check_assert(m(2) == 2.0); } return error ? 1 : 0; }