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 = j+1; i < I; ++i)
    43       U(i,j) = random<Number>();
    50     gemm_inplace(C1, A, 
'N', B, 
'N', alpha, beta);
    51     hemm_inplace(
'L', 
'U', C2, U, B, alpha, beta);
    52     Precision error = frobenius(C1-C2);
    53     myra::out() << 
"  |hemm('L','U')-gemm()| = " << error << std::endl;
    54     REQUIRE(error < tolerance);
    62     gemm_inplace(C1, B, 
'N', A, 
'N', alpha, beta);
    63     hemm_inplace(
'R', 
'U', C2, U, B, alpha, beta);
    64     Precision error = frobenius(C1-C2);
    65     myra::out() << 
"  |hemm('R','U')-gemm()| = " << error << std::endl;
    66     REQUIRE(error < tolerance);
    72 ADD_TEST(
"chemmU",
"[dense][blas]")
    73   { test<float> (53,28, 1.0e-4f); }
    75 ADD_TEST(
"zhemmU",
"[dense][blas]")
    76   { 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 upper 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<float>
  |hemm('L','U')-gemm()| = 2.18314e-05
  |hemm('R','U')-gemm()| = 2.35195e-05