29 #include <tests/myratest.h> 39 myra::out() << typestring<Number>() << std::endl;
43 Number alpha = random<Number>();
44 Number beta = random<Number>();
49 auto options = Options::create().set_nthreads(4).set_blocksize(128);
55 symm_inplace(
'L',
'L', C1, L, B, alpha, beta);
56 psymm_inplace(
'L',
'L', C2, L, B, alpha, beta, options);
57 Precision error = frobenius(C1-C2)/frobenius(C1);
58 myra::out() <<
" |symm('L','L')-psymm('L','L')| = " << error << std::endl;
59 REQUIRE(error < tolerance);
66 symm_inplace(
'L',
'U', C1, U, B, alpha, beta);
67 psymm_inplace(
'L',
'U', C2, U, B, alpha, beta, options);
68 Precision error = frobenius(C1-C2)/frobenius(C1);
69 myra::out() <<
" |symm('L','U')-psymm('L','U')| = " << error << std::endl;
70 REQUIRE(error < tolerance);
77 symm_inplace(
'R',
'L', C1, L, B, alpha, beta);
78 psymm_inplace(
'R',
'L', C2, L, B, alpha, beta, options);
79 Precision error = frobenius(C1-C2)/frobenius(C1);
80 myra::out() <<
" |symm('R','L')-psymm('R','L')| = " << error << std::endl;
81 REQUIRE(error < tolerance);
88 symm_inplace(
'R',
'U', C1, U, B, alpha, beta);
89 psymm_inplace(
'R',
'U', C2, U, B, alpha, beta, options);
90 Precision error = frobenius(C1-C2)/frobenius(C1);
91 myra::out() <<
" |symm('R','U')-psymm('R','U')| = " << error << std::endl;
92 REQUIRE(error < tolerance);
98 ADD_TEST(
"psymm1",
"[pdense][parallel]")
102 test<NumberS> (I,J,1.0e-4f);
103 test<NumberD> (I,J,1.0e-8);
104 test<NumberC> (I,J,1.0e-4f);
105 test<NumberZ> (I,J,1.0e-8);
Interface class for representing subranges of dense Matrix's.
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
Options pack for routines in /pdense.
Definition: Options.h:24
Returns a transposed copy of a Matrix. The inplace version only works on a square operand...
Returns the lower triangle of a dense Matrix.
Returns the upper triangle of a dense Matrix.
Various utility functions/classes related to scalar Number types.
General purpose dense matrix container, O(i*j) storage.
Options pack for routines in /pdense.
Reflects Precision trait for a Number, scalar Number types should specialize it.
Definition: Number.h:33
Simplistic random number functions.
Routines for symmetric Matrix * dense Matrix multiplication.
Thread-parallel symmetric Matrix * dense Matrix multiplication.
float
|symm('L','L')-psymm('L','L')| = 2.58582e-07
|symm('L','U')-psymm('L','U')| = 3.31749e-07
|symm('R','L')-psymm('R','L')| = 3.79184e-07
|symm('R','U')-psymm('R','U')| = 3.78143e-07
double
|symm('L','L')-psymm('L','L')| = 4.82599e-16
|symm('L','U')-psymm('L','U')| = 6.09224e-16
|symm('R','L')-psymm('R','L')| = 7.00946e-16
|symm('R','U')-psymm('R','U')| = 6.97612e-16
std::complex<float>
|symm('L','L')-psymm('L','L')| = 2.99332e-07
|symm('L','U')-psymm('L','U')| = 3.5593e-07
|symm('R','L')-psymm('R','L')| = 4.04806e-07
|symm('R','U')-psymm('R','U')| = 4.05293e-07
std::complex<double>
|symm('L','L')-psymm('L','L')| = 5.51966e-16
|symm('L','U')-psymm('L','U')| = 6.58328e-16
|symm('R','L')-psymm('R','L')| = 7.21684e-16
|symm('R','U')-psymm('R','U')| = 7.19744e-16