24 #include <tests/myratest.h> 30 template<
class Precision>
void test(
int I,
int J, Precision tolerance)
32 typedef std::complex<Precision> Number;
33 myra::out() << typestring<Number>() << std::endl;
37 Number alpha = random<Number>();
38 Number beta = random<Number>();
41 for (
int j = 0; j < I; ++j)
42 for (
int i = 0; i < j; ++i)
43 L(i,j) = random<Number>();
49 gemm_inplace(C1, A,
'N', B,
'N', alpha, beta);
50 hemm_inplace(
'L',
'L', C2, L, B, alpha, beta);
51 Precision error = frobenius(C1-C2);
52 myra::out() <<
" |hemm('L','L')-gemm()| = " << error << std::endl;
53 REQUIRE(error < tolerance);
60 gemm_inplace(C1, B,
'N', A,
'N', alpha, beta);
61 hemm_inplace(
'R',
'L', C2, L, B, alpha, beta);
62 Precision error = frobenius(C1-C2);
63 myra::out() <<
" |hemm('R','L')-gemm()| = " << error << std::endl;
64 REQUIRE(error < tolerance);
70 ADD_TEST(
"chemmL",
"[dense][blas]")
71 { test<float> (53,28, 1.0e-4f); }
73 ADD_TEST(
"zhemmL",
"[dense][blas]")
74 { test<double> (53,28, 1.0e-8); }
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
Routines for hermitian Matrix * dense Matrix multiplication.
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.
Returns a hermitian copy of a Matrix. The inplace version only works on a square operand.
Simplistic random number functions.
Variety of routines all for dense Matrix*Matrix multiplies. Delegates to the BLAS.
std::complex<double>
|hemm('L','L')-gemm()| = 1.24231e-13
|hemm('R','L')-gemm()| = 1.2981e-13