39 #include <tests/myratest.h> 47 myra::out() << typestring<Number>() << std::endl;
60 solver.refine(x,
'L',
'N');
61 Precision residual = frobenius(A*x-b) / frobenius(b);
62 myra::out() <<
" |A*b-x| = " << residual << std::endl;
63 REQUIRE(residual < tolerance);
69 solver.refine(x,
'L',
'T');
70 Precision residual = frobenius(transpose(A)*x-b) / frobenius(b);
71 myra::out() <<
" |A^T*x-b| = " << residual << std::endl;
72 REQUIRE(residual < tolerance);
78 solver.refine(x,
'L',
'H');
79 Precision residual = frobenius(hermitian(A)*x-b) / frobenius(b);
80 myra::out() <<
" |A^H*x-b| = " << residual << std::endl;
81 REQUIRE(residual < tolerance);
87 solver.refine(x,
'L',
'C');
88 Precision residual = frobenius(conjugate(A)*x-b) / frobenius(b);
89 myra::out() <<
" |A^C*b-x| = " << residual << std::endl;
90 REQUIRE(residual < tolerance);
96 solver.refine(x,
'R',
'N');
97 Precision residual = frobenius(x*A-b) / frobenius(b);
98 myra::out() <<
" |x*A-b| = " << residual << std::endl;
99 REQUIRE(residual < tolerance);
105 solver.refine(x,
'R',
'T');
106 Precision residual = frobenius(x*transpose(A)-b) / frobenius(b);
107 myra::out() <<
" |x*A^T-b| = " << residual << std::endl;
108 REQUIRE(residual < tolerance);
114 solver.refine(x,
'R',
'H');
115 Precision residual = frobenius(x*hermitian(A)-b) / frobenius(b);
116 myra::out() <<
" |x*A^H-b| = " << residual << std::endl;
117 REQUIRE(residual < tolerance);
123 solver.refine(x,
'R',
'C');
124 Precision residual = frobenius(x*conjugate(A)-b) / frobenius(b);
125 myra::out() <<
" |x*A^C-b| = " << residual << std::endl;
126 REQUIRE(residual < tolerance);
130 Solver copy = solver;
133 solver.refine(x,
'L',
'N');
134 Precision residual = frobenius(A*x-b) / frobenius(b);
135 myra::out() <<
" |inv(A)*b-x| (copy) = " << residual << std::endl;
136 REQUIRE(residual < tolerance);
145 saved.refine(x,
'L',
'N');
146 Precision residual = frobenius(A*x-b) / frobenius(b);
147 myra::out() <<
" |A*x-b| (saved) = " << residual << std::endl;
148 REQUIRE(residual < tolerance);
154 ADD_TEST(
"lu2_solver",
"[multifrontal][parallel]")
161 test<NumberD>(I,J,1.0e-8);
162 test<NumberZ>(I,J,1.0e-8);
Returns a transposed copy of a SparseMatrix.
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.
static Matrix< Number > random(int I, int J)
Generates a random Matrix of specified size.
Definition: Matrix.cpp:353
static SparseMatrix< Number > random(int I, int J, int N)
Generates a random SparseMatrix with size IxJ and (approximately) N nonzeros.
Definition: SparseMatrix.cpp:493
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.
Various utility functions/classes related to scalar Number types.
Signatures for sparse matrix * dense vector multiplies. All delegate to gemm() under the hood...
Sparse direct solver suitable for symmetric-pattern nonsymmetric-value A.
A stream that serialize/deserializes to std::vector<char> buffer.
General purpose dense matrix container, O(i*j) storage.
Range/Iterator types associated with Pattern.
Container for either a column vector or row vector (depends upon the usage context) ...
Sparse direct solver suitable for symmetric-pattern nonsymmetric-valued A.
Definition: SparseLUSolver.h:57
Holds the nonzero pattern of a sparse matrix.
Definition: Pattern.h:55
Reflects Precision trait for a Number, scalar Number types should specialize it.
Definition: Number.h:33
Container class for a sparse nonzero pattern, used in reordering/symbolic analysis.
Aggregates a (perm, iperm, swaps) triple into a vocabulary type.
Returns a conjugated copy of a SparseMatrix.
Returns a hermitian copy of a SparseMatrix.
Helper routines for reordering/filling 2D structured grids. Used by many unit tests.
Range/Iterator types associated with SparseMatrix.