43 cout <<
"Test of \"Matrix Operations\" function..." <<
flush;
47 copy(generateVEData<cl_float>(10u,3u),vec0);
48 copy(generateVEData<cl_float>(10u,1u),vec1);
52 using namespace elementOperators;
59 vector<cl_float> output(10);
60 copy(vec1[0], output);
62 bool status(output[1] == 20.5);
71 cout <<
"Test of \"System Solve Cramer's rule\" function..." <<
flush;
75 copy(generateVEData<cl_float>(10u,2u),vecB);
76 copy(generateVEData<cl_float>(10u,2u),vecX);
82 using namespace elementOperators;
89 vector<cl_float> output(10);
90 copy(vecX[0], output);
92 bool status(output[1] > 0.09 && output[1] < .1);
100 cout <<
"Test of \"System Solve congugate gradient method\" function..." <<
flush;
104 copy(generateVEData<cl_float>(10u,2u),vecB);
105 copy(generateVEData<cl_float>(10u,2u),vecX);
111 using namespace elementOperators;
118 vector<cl_float> output(10);
119 copy(vecX[0], output);
121 bool status(output[1] > 0.09 && output[1] < .1);
130 bool allTestsPassed(
true);
136 return allTestsPassed ? EXIT_SUCCESS : EXIT_FAILURE;
Advanced Simulation Library.
Advanced Computational Language.
vector< Element > gcSolveSystem(const MatrixOfElements &a, const VectorOfElements &b, const VectorOfElements &x)
generates code for solving the solution of a system of linear equations
void errorMessage(cl_int status, const char *errorMessage)
Prints errorMessage and exits depending on the status.
vector< Element > gcSolveSystemCG(const MatrixOfElements &a, const VectorOfElements &b, const VectorOfElements &x)
generates code for solving the solution of a system of linear equations
The class represents several Element.
VectorOfElements generateVEConstant(T a)
Generates VectorOfElements with 1 Element acl::Constant with value a.
void copy(MemBlock &source, T *destination)
MatrixOfElements generateMEConstant(const asl::AMatr< T > &a)
Generates VectorOfElements correspondinng to a.
bool testMatrixOperations()