Source: tests/sparse/hermitian.cpp
23 #include <tests/myratest.h> 31 myra::out() << typestring<Number>() << std::endl;
36 Precision error = frobenius( hermitian(A).make_Matrix() - hermitian(A.make_Matrix()) );
37 myra::out() <<
"|A'(sparse) - A'(dense)| = " << error << std::endl;
38 REQUIRE(error < tolerance);
43 ADD_TEST(
"hermitian",
"[sparse]")
45 test<NumberS>(20,30,150,1.0e-4f);
46 test<NumberD>(20,30,150,1.0e-12);
47 test<NumberC>(20,30,150,1.0e-4f);
48 test<NumberZ>(20,30,150,1.0e-12);
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.
Reflects Precision trait for a Number, scalar Number types should specialize it.
Definition: Number.h:33
Returns a hermitian copy of a Matrix. The inplace version only works on a square operand.
Returns a hermitian copy of a SparseMatrix.
Range/Iterator types associated with SparseMatrix.
Results: [PASS]
float
|A'(sparse) - A'(dense)| = 0
double
|A'(sparse) - A'(dense)| = 0
std::complex<float>
|A'(sparse) - A'(dense)| = 0
std::complex<double>
|A'(sparse) - A'(dense)| = 0
Go back to Summary of /test programs.