25 #include <tests/myratest.h> 31 template<
class Number>
void roundtrip_Matrix()
40 auto error = frobenius(A1-A2);
41 myra::out() <<
"|A1-A2| = " << error <<
" (" << typestring<Number>() <<
")" << std::endl;
45 template<
class Number>
void roundtrip_LowerMatrix()
54 auto error = frobenius(L1-L2);
55 myra::out() <<
"|L1-L2| = " << error <<
" (" << typestring<Number>() <<
")" << std::endl;
59 template<
class Number>
void roundtrip_DiagonalMatrix()
68 auto error = frobenius(D1-D2);
69 myra::out() <<
"|D1-D2| = " << error <<
" (" << typestring<Number>() <<
")" << std::endl;
74 template<
class Number>
void roundtrip_Vector()
83 auto error = frobenius(V1-V2);
84 myra::out() <<
"|V1-V2| = " << error <<
" (" << typestring<Number>() <<
")" << std::endl;
90 ADD_TEST(
"dense_io1",
"[dense]")
93 roundtrip_Matrix<NumberS> ();
94 roundtrip_Matrix<NumberD> ();
95 roundtrip_Matrix<NumberC> ();
96 roundtrip_Matrix<NumberZ> ();
98 roundtrip_LowerMatrix<NumberS> ();
99 roundtrip_LowerMatrix<NumberD> ();
100 roundtrip_LowerMatrix<NumberC> ();
101 roundtrip_LowerMatrix<NumberZ> ();
103 roundtrip_DiagonalMatrix<NumberS> ();
104 roundtrip_DiagonalMatrix<NumberD> ();
105 roundtrip_DiagonalMatrix<NumberC> ();
106 roundtrip_DiagonalMatrix<NumberZ> ();
108 roundtrip_Vector<NumberS> ();
109 roundtrip_Vector<NumberD> ();
110 roundtrip_Vector<NumberC> ();
111 roundtrip_Vector<NumberZ> ();
Tabulates the values of a square NxN diagonal matrix. Allows random access, but only on the diagonal...
Definition: conjugate.h:23
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
Wraps a std::vector<char>, presents it as both an InputStream and OutputStream. Useful for hygienic u...
Definition: VectorStream.h:22
static Vector< Number > random(int N)
Generates a random Vector of specified size.
Definition: Vector.cpp:276
Specialized container for a lower triangular matrix, O(N^2/2) storage. Used by symmetry exploiting ma...
Various utility functions/classes related to scalar Number types.
static DiagonalMatrix< Number > random(int N)
Generates a random DiagonalMatrix of specified size.
Definition: DiagonalMatrix.cpp:217
A stream that serialize/deserializes to std::vector<char> buffer.
General purpose dense matrix container, O(i*j) storage.
Tabulates a vector of length N, allows random access.
Definition: conjugate.h:21
Container for either a column vector or row vector (depends upon the usage context) ...
Stores a lower triangular matrix in rectangular packed format.
Definition: conjugate.h:22
Container for a diagonal matrix, O(n) storage. Used by SVD, row/column scaling, etc.
void write(OutputStream &out) const
Writes to OutputStream, complements InputStream constructor.
Definition: DiagonalMatrix.cpp:83
static LowerMatrix< Number > random(int N)
Generates a random LowerMatrix of specified size.
Definition: LowerMatrix.cpp:249
|A1-A2| = 0 (float)
|A1-A2| = 0 (double)
|A1-A2| = 0 (std::complex<float>)
|A1-A2| = 0 (std::complex<double>)
|L1-L2| = 0 (float)
|L1-L2| = 0 (double)
|L1-L2| = 0 (std::complex<float>)
|L1-L2| = 0 (std::complex<double>)
|D1-D2| = 0 (float)
|D1-D2| = 0 (double)
|D1-D2| = 0 (std::complex<float>)
|D1-D2| = 0 (std::complex<double>)
|V1-V2| = 0 (float)
|V1-V2| = 0 (double)
|V1-V2| = 0 (std::complex<float>)
|V1-V2| = 0 (std::complex<double>)