29 #include <tests/myratest.h> 39 myra::out() << typestring<Number>() << std::endl;
43 Number alpha = random<Number>();
44 Precision beta = random<Precision>();
49 C1 = C1 + hermitian(C1);
51 gemm_inplace(C1,A,
'N',B,
'H',alpha,beta);
52 gemm_inplace(C1,B,
'N',A,
'H',conjugate(alpha),one);
53 her2k_inplace(C2,A,B,
'N',alpha,beta);
54 Precision error = frobenius(C2.make_Matrix(
'H')-C1);
55 myra::out() <<
" |her2k('N')-gemm('N','H')| = " << error << std::endl;
56 REQUIRE(error < tolerance);
61 C1 = C1 + hermitian(C1);
63 gemm_inplace(C1,A,
'T',B,
'C',alpha,beta);
64 gemm_inplace(C1,B,
'T',A,
'C',conjugate(alpha),one);
65 her2k_inplace(C2,A,B,
'T',alpha,beta);
66 Precision error = frobenius(C2.make_Matrix(
'H')-C1);
67 myra::out() <<
" |her2k('T')-gemm('T','C')| = " << error << std::endl;
68 REQUIRE(error < tolerance);
73 C1 = C1 + hermitian(C1);
75 gemm_inplace(C1,A,
'H',B,
'N',alpha,beta);
76 gemm_inplace(C1,B,
'H',A,
'N',conjugate(alpha),one);
77 her2k_inplace(C2,A,B,
'H',alpha,beta);
78 Precision error = frobenius(C2.make_Matrix(
'H')-C1);
79 myra::out() <<
" |her2k('H')-gemm('H','N')| = " << error << std::endl;
80 REQUIRE(error < tolerance);
85 C1 = C1 + hermitian(C1);
87 gemm_inplace(C1,A,
'C',B,
'T',alpha,beta);
88 gemm_inplace(C1,B,
'C',A,
'T',conjugate(alpha),one);
89 her2k_inplace(C2,A,B,
'C',alpha,beta);
90 Precision error = frobenius(C2.make_Matrix(
'H')-C1);
91 myra::out() <<
" |her2k('C')-gemm('C','T')| = " << error << std::endl;
92 REQUIRE(error < tolerance);
98 ADD_TEST(
"sher2kLower",
"[dense][blas]")
99 { test<NumberS>(57,24,1.0e-4f); }
101 ADD_TEST(
"dher2kLower",
"[dense][blas]")
102 { test<NumberD>(57,24,1.0e-8); }
104 ADD_TEST(
"cher2kLower",
"[dense][blas]")
105 { test<NumberC>(57,24,1.0e-4f); }
107 ADD_TEST(
"zher2kLower",
"[dense][blas]")
108 { test<NumberZ>(57,24,1.0e-8); }
Returns a conjugated copy of a Matrix or Vector. Or, conjugate one inplace.
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 rank-2k updates, a specialized form of Matrix*Matrix multiplication.
Range construct for a lower triangular matrix stored in rectangular packed format.
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.
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.
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.
double
|her2k('N')-gemm('N','H')| = 7.15325e-15
|her2k('T')-gemm('T','C')| = 4.8503e-15
|her2k('H')-gemm('H','N')| = 4.98993e-15
|her2k('C')-gemm('C','T')| = 7.15488e-15