// -*- c++ -*- // // $COPYRIGHT$ // //=========================================================================== #include "mtl/mtl2lapack.h" #include "mtl/dense1D.h" #include "mtl/utils.h" using namespace std; /* Sample Output 3x3 [ [1,2,2], [2,1,2], [2,2,1] ] Estimated condition number: 7 */ int main() { const int M = 3; const int N = 3; using namespace mtl; //begin double da[] = { 1, 2, 2, 2, 1, 2, 2, 2, 1}; mtl2lapack::lapack_matrix::type A(da, M, N); dense1D pivot(N, 0); double anorm = 0; double cond; //end print_all_matrix(A); //begin int info = mtl2lapack::getrf(A, pivot); if (info == 0) { anorm = 5; mtl2lapack::gecon('1', A, anorm, cond); cout << "Estimated condition number: "; if (info == 0) cout << 1.0 / cond << endl; else cerr << "error INFO = " << info << endl;; } else { cerr << "error INFO = " << info << endl; } //end return 0; }