29 #include <tests/myratest.h>    36 template<
class Precision> 
void test(
int I, 
int J, Precision tolerance)
    38   typedef std::complex<Precision> Number;
    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     hemm_inplace(
'L', 
'L', C1, L, B, alpha, beta);
    56     phemm_inplace(
'L', 
'L', C2, L, B, alpha, beta, options);
    57     Precision error = frobenius(C1-C2)/frobenius(C1);
    58     myra::out() << 
"  |hemm('L','L')-phemm('L','L')| = " << error << std::endl;
    59     REQUIRE(error < tolerance);
    66     hemm_inplace(
'L', 
'U', C1, U, B, alpha, beta);
    67     phemm_inplace(
'L', 
'U', C2, U, B, alpha, beta, options);
    68     Precision error = frobenius(C1-C2)/frobenius(C1);
    69     myra::out() << 
"  |hemm('L','U')-phemm('L','U')| = " << error << std::endl;
    70     REQUIRE(error < tolerance);
    77     hemm_inplace(
'R', 
'L', C1, L, B, alpha, beta);
    78     phemm_inplace(
'R', 
'L', C2, L, B, alpha, beta, options);
    79     Precision error = frobenius(C1-C2)/frobenius(C1);
    80     myra::out() << 
"  |hemm('R','L')-phemm('R','L')| = " << error << std::endl;
    81     REQUIRE(error < tolerance);
    88     hemm_inplace(
'R', 
'U', C1, U, B, alpha, beta);
    89     phemm_inplace(
'R', 
'U', C2, U, B, alpha, beta, options);
    90     Precision error = frobenius(C1-C2)/frobenius(C1);
    91     myra::out() << 
"  |hemm('R','U')-phemm('R','U')| = " << error << std::endl;
    92     REQUIRE(error < tolerance);
    98 ADD_TEST(
"phemm1",
"[pdense][parallel]")
   102   test<float > (I,J,1.0e-4f);
   103   test<double> (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
Thread-parallel version of dense/phemm.h, hermitian Matrix * dense Matrix multiplication. 
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
Routines for hermitian Matrix * dense Matrix multiplication. 
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. 
Returns a hermitian copy of a Matrix. The inplace version only works on a square operand. 
Simplistic random number functions. 
std::complex<float>
  |hemm('L','L')-phemm('L','L')| = 2.90252e-07
  |hemm('L','U')-phemm('L','U')| = 3.46372e-07
  |hemm('R','L')-phemm('R','L')| = 4.68456e-07
  |hemm('R','U')-phemm('R','U')| = 4.69157e-07
std::complex<double>
  |hemm('L','L')-phemm('L','L')| = 5.53697e-16
  |hemm('L','U')-phemm('L','U')| = 6.61817e-16
  |hemm('R','L')-phemm('R','L')| = 7.2084e-16
  |hemm('R','U')-phemm('R','U')| = 7.23341e-16