36 #define LAPACKTEST_VERSION \ 37 "LAPACKTEST V1.1 Test interfaced LAPACK functions" 40 #include <tfxx/commandline.h> 43 #include <aff/iterator.h> 44 #include <aff/arrayoperators.h> 58 void dump(
const Tmatrix::Tcoc& m)
61 const int precision=5;
64 for (
int i=m.first(1); i<=m.last(1); ++i)
70 for (
int j=m.first(0); j<=m.last(0); ++j)
74 for (
int i=m.first(1); i<=m.last(1); ++i)
77 cout.precision(precision);
84 #define DUMP( M ) cout << #M << ":" << endl; dump(M); 89 void test(
const Tmatrix::Tcoc& M,
const Tmatrix::Tcoc V)
92 cout <<
"test function" << endl
93 <<
"-------------" << endl;
94 cout <<
"input matrix and vector:" << endl;
98 cout <<
"positive definite system matrix: " << endl;
101 cout <<
"right hand side vector: " << endl;
104 cout <<
"solution to system of linear equations: " << endl;
106 cout <<
"expected solution: " << endl;
113 int main(
int iargc,
char* argv[])
120 "usage: lapacktest [-n n]" "\n" 121 " or: lapacktest --help|-h" "\n" 129 "-n N test system of size NxN" "\n" 133 using namespace tfxx::cmdline;
134 static Declare options[]=
148 cerr << usage_text << endl;
153 Commandline cmdline(iargc, argv, options);
156 if (cmdline.optset(0))
158 cerr << usage_text << endl;
159 cerr << help_text << endl;
189 opt.
nsize=cmdline.int_arg(2);
197 cout <<
"Define system of size " << opt.
nsize <<
"x" << opt.
nsize << endl;
204 tfxx::numeric::RNGgaussian rng;
208 aff::Iterator<Tmatrix> I(M);
218 aff::Iterator<Tmatrix> I(R);
231 Tmatrix M(3,3), V(3,1), W(3,2);
void dump(const Tmatrix::Tcoc &m)
prototypes for C++ LAPACK interface functions (prototypes)
aff::Array< double > TDmatrix
#define LAPACKTEST_VERSION
TDmatrix transposeNxM(const TDmatrix::Tcoc &A)
calculate transpose of NxM matrix.
matrix and vector operators (prototypes)
TDmatrix dotNxM(const TDmatrix::Tcoc &A, const TDmatrix::Tcoc &B)
dot product for NxM matrices.
void test(const Tmatrix::Tcoc &M, const Tmatrix::Tcoc V)
void dposv(char UPLO, TDmatrix &A, TDmatrix &B, int &INFO, const bool &debug)
Compute the solution to a real system of linear equations A * X = B.
int main(int iargc, char *argv[])