35 #include <tests/myratest.h> 45 myra::out() << typestring<Number>() << std::endl;
51 auto B = psymm(
'L',L,X);
54 auto options = Options::create().set_nthreads(4).set_blocksize(128);
60 auto PQRI_serial = sytrf_inplace(L_serial);
62 swap_rows(PQRI_serial.P_swaps,X_serial);
63 trsm_inplace(
'L',
'N', L_serial, X_serial);
64 PQRI_serial.R.solve(X_serial,
'L',
'N');
65 swap_rows(PQRI_serial.Q_swaps,X_serial);
66 X_serial.bottom(PQRI_serial.n_minus) *= -one;
67 iswap_rows(PQRI_serial.Q_swaps,X_serial);
68 PQRI_serial.R.solve(X_serial,
'L',
'T');
69 trsm_inplace(
'L',
'T', L_serial, X_serial);
70 iswap_rows(PQRI_serial.P_swaps,X_serial);
71 Precision e_serial = frobenius(A*X_serial-B) / frobenius(B);
75 auto PQRI_parallel = psytrf_inplace(L_parallel);
77 swap_rows(PQRI_parallel.P_swaps,X_parallel);
78 ptrsm_inplace(
'L',
'N', L_parallel, X_parallel,
'N', one, options);
79 PQRI_parallel.R.solve(X_parallel,
'L',
'N');
80 swap_rows(PQRI_parallel.Q_swaps,X_parallel);
81 X_parallel.bottom(PQRI_parallel.n_minus) *= -one;
82 iswap_rows(PQRI_parallel.Q_swaps,X_parallel);
83 PQRI_parallel.R.solve(X_parallel,
'L',
'T');
84 ptrsm_inplace(
'L',
'T', L_parallel, X_parallel,
'N', one, options);
85 iswap_rows(PQRI_parallel.P_swaps,X_parallel);
86 Precision e_parallel = frobenius(A*X_parallel-B) / frobenius(B);
88 myra::out() <<
" |L*L'*X-B|, serial = " << e_serial << std::endl;
89 myra::out() <<
" |L*L'*X-B|, parallel = " << e_parallel << std::endl;
90 REQUIRE(e_serial < tolerance);
91 REQUIRE(e_parallel < tolerance);
97 ADD_TEST(
"psytrf2",
"[pdense][parallel]")
101 test<NumberS> (I,J,1.0e-4f);
102 test<NumberD> (I,J,1.0e-10);
103 test<NumberC> (I,J,1.0e-4f);
104 test<NumberZ> (I,J,1.0e-10);
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.
Range construct for a lower triangular matrix stored in rectangular packed format.
Routines for backsolving by a triangular Matrix or LowerMatrix.
LDL' decompositions for real symmetric Matrix A (indefinite is fine).
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...
Thread-parallel version of dense/sytrf.h, LDL' decomposition of a symmetric indefinite Matrix...
Various utility functions/classes related to scalar Number types.
Routines related to swap sequences, often used during pivoting.
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.
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.
Thread-parallel symmetric Matrix * dense Matrix multiplication.
Interface class for representing subranges of contiguous int's.
float
|L*L'*X-B|, serial = 1.45642e-05
|L*L'*X-B|, parallel = 1.40478e-05
double
|L*L'*X-B|, serial = 3.43104e-14
|L*L'*X-B|, parallel = 2.70661e-14
std::complex<float>
|L*L'*X-B|, serial = 2.022e-05
|L*L'*X-B|, parallel = 1.87708e-05
std::complex<double>
|L*L'*X-B|, serial = 3.37046e-14
|L*L'*X-B|, parallel = 2.93221e-14