35 #include <tests/myratest.h> 42 template<
class Precision>
void test(
int I,
int J, Precision tolerance)
44 myra::out() << typestring<Precision>() << std::endl;
48 Precision shift = 5.5;
49 for (
int n = 0; n < N; ++n)
54 myra::out() <<
"inertia = " << solver.inertia() << std::endl;
63 solver.solve(x.column(),
'L',
'N');
64 Precision residual = frobenius(A*x-b) / frobenius(b);
65 myra::out() <<
" |A*x-b| (solve) = " << residual << std::endl;
73 auto history = solver.refine(x.column(),
'L',
'N');
74 Precision residual = frobenius(A*x-b) / frobenius(b);
75 myra::out() <<
" |A*x-b| (refine) = " << residual << std::endl;
76 myra::out() <<
" history = " << history << std::endl;
78 REQUIRE(residual < tolerance);
84 auto history = solver.refine(x.row(),
'R',
'N');
85 Precision residual = frobenius(x*A-b) / frobenius(b);
86 myra::out() <<
" |x*A-b| (refine) = " << residual << std::endl;
87 REQUIRE(residual < tolerance);
94 auto history = solver.refine(x.column(),
'L',
'N');
95 Precision residual = frobenius(A*x-b) / frobenius(b);
96 myra::out() <<
" |inv(A)*b-x| (copy) = " << residual << std::endl;
97 REQUIRE(residual < tolerance);
106 auto history = saved.refine(x.column(),
'L',
'N');
107 Precision residual = frobenius(A*x-b) / frobenius(b);
108 myra::out() <<
" |A*x-b| (saved) = " << residual << std::endl;
109 REQUIRE(residual < tolerance);
115 ADD_TEST(
"rldlt2_solver",
"[multifrontal][parallel]")
122 test<float >(I,J,1.0e-4f);
123 test<double>(I,J,1.0e-8);
Interface class for representing subranges of dense Matrix's.
Interface class for representing subranges of dense Vector's.
Variety of routines for mixed dense*sparse or dense*sparse matrix multiplies. The dense*dense case is...
Routines for computing Frobenius norms of various algebraic containers.
Sparse direct solver suitable for real symmetric indefinite systems.
Definition: SparseRLDLTSolver.h:61
Wraps a std::vector<char>, presents it as both an InputStream and OutputStream. Useful for hygienic u...
Definition: VectorStream.h:22
General purpose compressed-sparse-column (CSC) container.
static Vector< Number > random(int N)
Generates a random Vector of specified size.
Definition: Vector.cpp:276
Definition: stlprint.h:32
Routines for printing the contents of various std::container's to a std::ostream using operator <<...
Various utility functions/classes related to scalar Number types.
Signatures for sparse matrix * dense vector multiplies. All delegate to gemm() under the hood...
A stream that serialize/deserializes to std::vector<char> buffer.
General purpose dense matrix container, O(i*j) storage.
Container for either a column vector or row vector (depends upon the usage context) ...
Aggregates a (perm, iperm, swaps) triple into a vocabulary type.
Sparse direct solver suitable for real symmetric indefinite systems.
Stores an IxJ matrix A in compressed sparse column format.
Definition: bothcat.h:23
Helper routines for reordering/filling 2D structured grids. Used by many unit tests.
Range/Iterator types associated with SparseMatrix.
float
inertia = {1531,2565}
|A*x-b| (solve) = 0.00093264
|A*x-b| (refine) = 1.24751e-05
history = [ 0.00300359 1.25741e-05 ] (2)
|x*A-b| (refine) = 5.98628e-06
|inv(A)*b-x| (copy) = 3.85729e-06
|A*x-b| (saved) = 8.37572e-06
double
inertia = {1531,2565}
|A*x-b| (solve) = 4.18021e-13
|A*x-b| (refine) = 4.91717e-15
history = [ 2.30188e-13 4.88419e-15 ] (2)
|x*A-b| (refine) = 1.23369e-14
|inv(A)*b-x| (copy) = 1.14628e-14
|A*x-b| (saved) = 1.33477e-14