Source: tests/sparse/SparseMatrixBuilder.cpp
21 #include <tests/myratest.h> 25 ADD_TEST(
"SparseMatrixBuilder",
"[sparse]")
29 double error_p = frobenius( (A+B).make_Matrix()-(A.make_Matrix()+B.make_Matrix()) );
30 double error_m = frobenius( (A-B).make_Matrix()-(A.make_Matrix()-B.make_Matrix()) );
31 myra::out() <<
"| A+B(sparse) - A+B(dense) | = " << error_p << std::endl;
32 myra::out() <<
"| A-B(sparse) - A-B(dense) | = " << error_m << std::endl;
33 double tolerance = 1.0e-12;
34 REQUIRE(error_p < tolerance);
35 REQUIRE(error_m < tolerance);
Interface class for representing subranges of dense Matrix's.
Routines for computing Frobenius norms of various algebraic containers.
static SparseMatrix< Number > random(int I, int J, int N)
Generates a random SparseMatrix with size IxJ and (approximately) N nonzeros.
Definition: SparseMatrix.cpp:493
General purpose compressed-sparse-column (CSC) container.
General purpose dense matrix container, O(i*j) storage.
Range/Iterator types associated with SparseMatrix.
Results: [PASS]
| A+B(sparse) - A+B(dense) | = 0
| A-B(sparse) - A-B(dense) | = 0
Go back to Summary of /test programs.