29 #include <tests/myratest.h> 39 myra::out() << typestring<Number>() << std::endl;
42 auto A = pgemm(G,G,
'H');
43 for (
int i = 0; i < I; ++i)
49 auto options = Options::create().set_nthreads(4).set_blocksize(128);
55 potrf_inplace(
'L',
'R',L_serial);
56 trsm_inplace(
'L',
'L',
'N',L_serial,X_serial);
57 trsm_inplace(
'L',
'L',
'H',L_serial,X_serial);
58 Precision e_serial = frobenius(A*X_serial-B) / frobenius(B);
62 ppotrf_inplace(
'L',L_parallel,options);
63 ptrsm_inplace(
'L',
'L',
'N',L_parallel,X_parallel,
'N',one,options);
64 ptrsm_inplace(
'L',
'L',
'H',L_parallel,X_parallel,
'N',one,options);
65 Precision e_parallel = frobenius(A*X_parallel-B) / frobenius(B);
67 myra::out() <<
" |L*L'*X-B|, serial = " << e_serial << std::endl;
68 myra::out() <<
" |L*L'*X-B|, parallel = " << e_parallel << std::endl;
69 REQUIRE(e_serial < tolerance);
70 REQUIRE(e_parallel < tolerance);
77 potrf_inplace(
'U',
'R',U_serial);
78 trsm_inplace(
'L',
'U',
'N',U_serial,X_serial);
79 trsm_inplace(
'L',
'U',
'H',U_serial,X_serial);
80 Precision e_serial = frobenius(A*X_serial-B) / frobenius(B);
84 ppotrf_inplace(
'U',U_parallel,options);
85 ptrsm_inplace(
'L',
'U',
'N',U_parallel,X_parallel,
'N',one,options);
86 ptrsm_inplace(
'L',
'U',
'H',U_parallel,X_parallel,
'N',one,options);
87 Precision e_parallel = frobenius(A*X_parallel-B) / frobenius(B);
89 myra::out() <<
" |U*U'*X-B|, serial = " << e_serial << std::endl;
90 myra::out() <<
" |U*U'*X-B|, parallel = " << e_parallel << std::endl;
91 REQUIRE(e_serial < tolerance);
92 REQUIRE(e_parallel < tolerance);
98 ADD_TEST(
"ppotrf1",
"[pdense][parallel]")
102 test<NumberS> (I,J,1.0e-4f);
103 test<NumberD> (I,J,1.0e-8);
104 test<NumberC> (I,J,1.0e-4f);
105 test<NumberZ> (I,J,1.0e-8);
Cholesky factorization routines for positive definite matrices.
Thread-parallel version of dense/potrf.h, Cholesky decomposition of a symmetric positive Matrix...
Interface class for representing subranges of dense Matrix's.
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
Thread-parallel version of dense/trsm.h, triangular Matrix \ dense Matrix backsolution.
Routines for backsolving by a triangular Matrix or LowerMatrix.
Various utility functions/classes related to scalar Number types.
General purpose dense matrix container, O(i*j) storage.
Options pack for routines in /pdense.
Reflects Precision trait for a Number, scalar Number types should specialize it.
Definition: Number.h:33
Thread-parallel version of dense/gemm.h, Matrix*Matrix multiplication.
Variety of routines all for dense Matrix*Matrix multiplies. Delegates to the BLAS.
float
|L*L'*X-B|, serial = 3.8177e-07
|L*L'*X-B|, parallel = 2.90744e-07
|U*U'*X-B|, serial = 3.62301e-07
|U*U'*X-B|, parallel = 2.86831e-07
double
|L*L'*X-B|, serial = 6.62325e-16
|L*L'*X-B|, parallel = 4.28738e-16
|U*U'*X-B|, serial = 6.24621e-16
|U*U'*X-B|, parallel = 4.26244e-16
std::complex<float>
|L*L'*X-B|, serial = 3.82463e-07
|L*L'*X-B|, parallel = 3.02693e-07
|U*U'*X-B|, serial = 3.61825e-07
|U*U'*X-B|, parallel = 2.9542e-07
std::complex<double>
|L*L'*X-B|, serial = 6.65187e-16
|L*L'*X-B|, parallel = 4.56632e-16
|U*U'*X-B|, serial = 6.26351e-16
|U*U'*X-B|, parallel = 4.52292e-16