25 #include <tests/myratest.h> 33 myra::out() << typestring<Number>() << std::endl;
38 Precision error = frobenius( transpose(A).make_Matrix() - transpose(A.make_Matrix()) );
39 myra::out() <<
"|A'(sparse) - A'(dense)| = " << error << std::endl;
40 REQUIRE(error < tolerance);
45 ADD_TEST(
"transpose",
"[sparse]")
47 test<NumberS>(20,30,150,1.0e-4f);
48 test<NumberD>(20,30,150,1.0e-12);
49 test<NumberC>(20,30,150,1.0e-4f);
50 test<NumberZ>(20,30,150,1.0e-12);
53 ADD_TEST(
"transpose_Pattern",
"[sparse]")
56 auto At = transpose(A);
58 for (
auto iterator = A.begin(); iterator != A.end(); ++iterator)
Returns a transposed copy of a SparseMatrix.
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.
Returns a transposed copy of a Matrix. The inplace version only works on a square operand...
static Pattern random(int I, int J, int N)
Generates a random Pattern with size IxJ and (approximately) N nonzeros.
Definition: Pattern.cpp:300
General purpose dense matrix container, O(i*j) storage.
Range/Iterator types associated with Pattern.
Reflects Precision trait for a Number, scalar Number types should specialize it.
Definition: Number.h:33
Container class for a sparse nonzero pattern, used in reordering/symbolic analysis.
Range/Iterator types associated with SparseMatrix.
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