33 #include <tests/myratest.h> 42 myra::out() << typestring<Number>() << std::endl;
48 potrf_inplace(
'L',
'R',A);
51 Number alpha = random<Number>();
58 trmm_inplace(
'L',
'N',L,X2,diag,alpha);
59 trsm_inplace(
'L',
'N',L,X2,diag,one/alpha);
60 Precision error = frobenius(X-X2)/frobenius(X);
61 myra::out() <<
" |L\\L*X-X| = " << error << std::endl;
62 REQUIRE(error < tolerance);
68 trmm_inplace(
'L',
'T',L,X2,diag,alpha);
69 trsm_inplace(
'L',
'T',L,X2,diag,one/alpha);
70 Precision error = frobenius(X-X2)/frobenius(X);
71 myra::out() <<
" |transpose(L)\\transpose(L)*X-X| = " << error << std::endl;
72 REQUIRE(error < tolerance);
78 trmm_inplace(
'L',
'H',L,X2,diag,alpha);
79 trsm_inplace(
'L',
'H',L,X2,diag,one/alpha);
80 Precision error = frobenius(X-X2)/frobenius(X);
81 myra::out() <<
" |hermitian(L)\\hermitian(L)*X-X| = " << error << std::endl;
82 REQUIRE(error < tolerance);
88 trmm_inplace(
'L',
'C',L,X2,diag,alpha);
89 trsm_inplace(
'L',
'C',L,X2,diag,one/alpha);
90 Precision error = frobenius(X-X2)/frobenius(X);
91 myra::out() <<
" |conjugate(L)\\conjugate(L)*X-X| = " << error << std::endl;
92 REQUIRE(error < tolerance);
98 trmm_inplace(
'R',
'N',L,X2,diag,alpha);
99 trsm_inplace(
'R',
'N',L,X2,diag,one/alpha);
100 Precision error = frobenius(X-X2)/frobenius(X);
101 myra::out() <<
" |X*L/L-X| = " << error << std::endl;
102 REQUIRE(error < tolerance);
108 trmm_inplace(
'R',
'T',L,X2,diag,alpha);
109 trsm_inplace(
'R',
'T',L,X2,diag,one/alpha);
110 Precision error = frobenius(X-X2)/frobenius(X);
111 myra::out() <<
" |X*transpose(L)/transpose(L)-X| = " << error << std::endl;
112 REQUIRE(error < tolerance);
118 trmm_inplace(
'R',
'H',L,X2,diag,alpha);
119 trsm_inplace(
'R',
'H',L,X2,diag,one/alpha);
120 Precision error = frobenius(X-X2)/frobenius(X);
121 myra::out() <<
" |X*hermitian(L)/hermitian(L)-X| = " << error << std::endl;
122 REQUIRE(error < tolerance);
128 trmm_inplace(
'R',
'C',L,X2,diag,alpha);
129 trsm_inplace(
'R',
'C',L,X2,diag,one/alpha);
130 Precision error = frobenius(X-X2)/frobenius(X);
131 myra::out() <<
" |X*conjugate(L)/conjugate(L)-X| = " << error << std::endl;
132 REQUIRE(error < tolerance);
138 ADD_TEST(
"strsmtrmm",
"[dense][lapack]")
139 { test<NumberS>(1.0e-4f); }
141 ADD_TEST(
"dtrsmtrmm",
"[dense][lapack]")
142 { test<NumberD>(1.0e-10); }
144 ADD_TEST(
"ctrsmtrmm",
"[dense][lapack]")
145 { test<NumberC>(1.0e-4f); }
147 ADD_TEST(
"ztrsmtrmm",
"[dense][lapack]")
148 { test<NumberZ>(1.0e-10); }
Returns a conjugated copy of a Matrix or Vector. Or, conjugate one inplace.
Cholesky factorization routines for positive definite matrices.
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
Range construct for a lower triangular matrix stored in rectangular packed format.
Routines for backsolving by a triangular Matrix or LowerMatrix.
Routines for multiplying by a triangular Matrix or LowerMatrix.
Specialized container for a lower triangular matrix, O(N^2/2) storage. Used by symmetry exploiting ma...
Returns a transposed copy of a Matrix. The inplace version only works on a square operand...
Returns the lower triangle of a dense Matrix.
Various utility functions/classes related to scalar Number types.
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.
Simplistic random number functions.
Stores a lower triangular matrix in rectangular packed format.
Definition: conjugate.h:22
Variety of routines all for dense Matrix*Matrix multiplies. Delegates to the BLAS.
std::complex<float>
|L\L*X-X| = 6.84072e-07
|transpose(L)\transpose(L)*X-X| = 2.9641e-07
|hermitian(L)\hermitian(L)*X-X| = 2.86997e-07
|conjugate(L)\conjugate(L)*X-X| = 8.03142e-07
|X*L/L-X| = 2.89673e-07
|X*transpose(L)/transpose(L)-X| = 6.94173e-07
|X*hermitian(L)/hermitian(L)-X| = 7.42902e-07
|X*conjugate(L)/conjugate(L)-X| = 2.85886e-07