35 #include <tests/myratest.h> 42 template<
class Precision>
void test(
int X,
int Y, Precision tolerance)
44 myra::out() << typestring<Precision>() << std::endl;
47 auto A = laplacian2<Precision>(X,Y);
51 auto VD = lanczosN(make_GemmAction(A),Q,size,tolerance,100);
56 Precision R_error = frobenius(R);
57 myra::out() <<
" |A*V-V*D| = " << R_error << std::endl;
60 Precision I_error = frobenius(gemm(V,
'T',V)-I);
61 myra::out() <<
" |V'V-I| = " << I_error << std::endl;
62 REQUIRE(R_error < tolerance*10.0);
63 REQUIRE(I_error < tolerance*10.0);
68 ADD_TEST(
"lanczos2",
"[iterative]")
70 test<float> (20,15,1.0e-4f);
71 test<double>(20,15,1.0e-8);
Interface class for representing subranges of DiagonalMatrix's.
Interface class for representing subranges of dense Matrix's.
Applies the "Action" of a linear operator, b := A*x, used in iterative solution algorithms.
Variety of routines for mixed dense*sparse or dense*sparse matrix multiplies. The dense*dense case is...
Routines for computing Frobenius norms of various algebraic containers.
Routines for multiplying by a DiagonalMatrix.
General purpose compressed-sparse-column (CSC) container.
Definition: stlprint.h:32
Routines for printing the contents of various std::container's to a std::ostream using operator <<...
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
Signatures for sparse matrix * dense vector multiplies. All delegate to gemm() under the hood...
Finds several dominant eigenpairs of a real symmetric Action.
General purpose dense matrix container, O(i*j) storage.
An Action for multiplying by a dense Matrix or SparseMatrix using gemm().
Container for a diagonal matrix, O(n) storage. Used by SVD, row/column scaling, etc.
Helper routines for reordering/filling 2D structured grids. Used by many unit tests.
Variety of routines all for dense Matrix*Matrix multiplies. Delegates to the BLAS.
Range/Iterator types associated with SparseMatrix.