26 #include <tests/myratest.h> 32 template<
class Precision>
void test(
int N, Precision tolerance)
34 myra::out() << typestring<Precision>() << std::endl;
39 const auto XD = jacobi(A);
40 const auto& X = XD.first;
41 const auto& D = XD.second;
44 myra::out() <<
" |X'X-I| = " << I_error << std::endl;
45 Precision R_error = frobenius(A*X-X*D);
46 myra::out() <<
" |A*X-X*D| = " << R_error << std::endl;
47 REQUIRE(I_error < tolerance);
48 REQUIRE(R_error < tolerance);
53 ADD_TEST(
"sjacobi",
"[dense]")
54 { test<float> (10, 1.0e-3f); }
56 ADD_TEST(
"djacobi",
"[dense]")
57 { test<double> (20, 1.0e-8); }
Interface class for representing subranges of DiagonalMatrix's.
Jacobi methods for real symmetric eigendecomposition.
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
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
Routines for multiplying by a DiagonalMatrix.
Returns a transposed copy of a Matrix. The inplace version only works on a square operand...
Various utility functions/classes related to scalar Number types.
General purpose dense matrix container, O(i*j) storage.
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.