27 #include <tests/myratest.h> 36 myra::out() << typestring<Number>() << std::endl;
43 myra::out() <<
" |A*inv(A)-I| = " << error << std::endl;
44 REQUIRE(error < tolerance);
50 myra::out() << typestring<Number>() << std::endl;
55 for (
int n = 0; n < N; ++n)
61 myra::out() <<
" |A*inv(A)-I| = " << error << std::endl;
62 REQUIRE(error < tolerance);
68 myra::out() << typestring<Number>() << std::endl;
75 myra::out() <<
" |A*inv(A)-I| = " << error << std::endl;
76 REQUIRE(error < tolerance);
81 ADD_TEST(
"inverse_DiagonalMatrix",
"[dense][lapack]")
83 myra::out() <<
"Testing explicit inverse routines (DiagonalMatrix)" << std::endl;
84 test_diagonal<float >(15,1.0e-4f);
85 test_diagonal<double>(16,1.0e-9);
86 test_diagonal<std::complex<float > >(17,1.0e-4f);
87 test_diagonal<std::complex<double> >(18,1.0e-9);
88 myra::out() << std::endl;
91 ADD_TEST(
"inverse_LowerMatrix",
"[dense][lapack]")
93 myra::out() <<
"Testing explicit inverse routines (LowerMatrix)" << std::endl;
94 test_lower<float >(15,1.0e-4f);
95 test_lower<double>(16,1.0e-9);
96 test_lower<std::complex<float > >(17,1.0e-4f);
97 test_lower<std::complex<double> >(18,1.0e-9);
98 myra::out() << std::endl;
101 ADD_TEST(
"inverse_Matrix",
"[dense][lapack]")
103 myra::out() <<
"Testing explicit inverse routines (square Matrix)" << std::endl;
104 test_square<float >(15,1.0e-4f);
105 test_square<double>(16,1.0e-9);
106 test_square<std::complex<float > >(17,1.0e-4f);
107 test_square<std::complex<double> >(18,1.0e-9);
108 myra::out() << std::endl;
Interface class for representing subranges of DiagonalMatrix's.
Tabulates the values of a square NxN diagonal matrix. Allows random access, but only on the diagonal...
Definition: conjugate.h:23
Interface class for representing subranges of dense Matrix's.
Tabulates an IxJ matrix. Allows random access, has column major layout to be compatible with BLAS/LAP...
Definition: bdsqr.h:20
Matrix< Number > make_Matrix(char op='N') const
Accumulates *this onto the lower triangle of a Matrix<Number>
Definition: LowerMatrix.cpp:152
Routines for computing Frobenius norms of various algebraic containers.
static Matrix< Number > random(int I, int J)
Generates a random Matrix of specified size.
Definition: Matrix.cpp:353
Range construct for a lower triangular matrix stored in rectangular packed format.
Specialized container for a lower triangular matrix, O(N^2/2) storage. Used by symmetry exploiting ma...
Returns the lower triangle of a dense Matrix.
Various utility functions/classes related to scalar Number types.
static Matrix< Number > identity(int IJ)
Generates an identity Matrix of specified size.
Definition: Matrix.cpp:349
static DiagonalMatrix< Number > random(int N)
Generates a random DiagonalMatrix of specified size.
Definition: DiagonalMatrix.cpp:217
General purpose dense matrix container, O(i*j) storage.
Reflects Precision trait for a Number, scalar Number types should specialize it.
Definition: Number.h:33
Overwrites a LowerMatrix, DiagonalMatrix, or square Matrix with its own inverse. Or, returns it as a copy.
Stores a lower triangular matrix in rectangular packed format.
Definition: conjugate.h:22
Container for a diagonal matrix, O(n) storage. Used by SVD, row/column scaling, etc.
Variety of routines all for dense Matrix*Matrix multiplies. Delegates to the BLAS.
static LowerMatrix< Number > random(int N)
Generates a random LowerMatrix of specified size.
Definition: LowerMatrix.cpp:249
Testing explicit inverse routines (LowerMatrix)
float
|A*inv(A)-I| = 1.05797e-06
double
|A*inv(A)-I| = 1.20657e-15
std::complex<float>
|A*inv(A)-I| = 5.95333e-06
std::complex<double>
|A*inv(A)-I| = 1.3808e-14