29 #include <myramath/multifrontal/detail/restriction.h> 37 #include <tests/myratest.h> 43 template<
class Precision>
48 int N = solver.size();
51 solver.solve(x.column());
52 Precision error = euclidean( gemv(A,x) - b );
53 myra::out() <<
"|A*x-b| = " << error << std::endl;
54 myra::out() <<
"A-flops = " << solver.tree().n_work_llt() << std::endl;
55 REQUIRE( error < tolerance );
58 template<
class Precision>
59 void test_saddle1(
int I,
int J,
int K, Precision tolerance)
68 for (
int k = 0; k < K; ++k)
69 Ri.push_back( random_int(N) );
72 using namespace multifrontal::detail;
83 Options options = Options::create().set_blocksize(1).set_globsize(1).set_nthreads(1);
85 myra::out() <<
"L-flops = " <<
AssemblyTree(L.
pattern(),P,options).n_work_llt() << std::endl;
90 std::vector<int> natural(N+K,-1);
91 for (
int n = 0; n < N+K; ++n)
94 test_saddle1(A,P0,options,tolerance);
97 std::vector<int> reversed(N+K,-1);
98 for (
int n = 0; n < N+K; ++n)
99 reversed[n] = N+K-1-n;
101 test_saddle1(A,P1,options,tolerance);
105 test_saddle1(A,P2,options,tolerance);
109 test_saddle1(A,P3,options,tolerance);
115 ADD_TEST(
"rldlt2_saddle1",
"[multifrontal]")
118 ::detail::test_saddle1<float >(IJK,IJK,IJK, 1.0e-4f);
119 ::detail::test_saddle1<double>(IJK,IJK,IJK, 1.0e-10);
Routines for computing euclidean norm of a Vector/VectorRange, or normalizing a Vector/VectorRange to...
Returns a transposed copy of a SparseMatrix.
Routines to concatenate SparseMatrix's in two-by-two fashion.
static Permutation from_iperm(const intCRange &iperm)
Delegates to one of the tagged constructors above.
Definition: Permutation.cpp:198
Options pack for routines in /multifrontal.
Definition: Options.h:24
static SparseMatrix< Number > zeros(int I, int J)
Generates a zero-valued SparseMatrix of specified size. Empty, no storage required.
Definition: SparseMatrix.cpp:501
Represents a Permutation matrix, used to reorder rows/columns/etc of various numeric containers...
Definition: Permutation.h:34
Symbolic analysis data structure for all multifrontal solvers.
Definition: AssemblyTree.h:38
Interface class for representing subranges of dense Vector's.
Sparse direct solver suitable for real symmetric indefinite systems.
Definition: SparseRLDLTSolver.h:61
Reduces a std::vector to its unique entries, and sorts it.
General purpose compressed-sparse-column (CSC) container.
void sortunique(std::vector< T > &v)
Reduces a std::vector to its unique entries, and sorts it.
Definition: sortunique.h:20
static Vector< Number > random(int N)
Generates a random Vector of specified size.
Definition: Vector.cpp:276
Permutation mmd(const PatternRange &A)
Reorders A for reduced fill-in using multiple minimum degree.
Definition: random.cpp:45
Various utility functions/classes related to scalar Number types.
Signatures for sparse matrix * dense vector multiplies. All delegate to gemm() under the hood...
PatternRange pattern() const
Returns the nonzero Pattern over all of A(:,:)
Definition: SparseMatrix.cpp:221
Range/Iterator types associated with Pattern.
Container for either a column vector or row vector (depends upon the usage context) ...
Container class for a sparse nonzero pattern, used in reordering/symbolic analysis.
Aggregates a (perm, iperm, swaps) triple into a vocabulary type.
Minimum degree algorithms, for computing fill-minimizing permutations.
Computes a fill-reducing Permutation for a structurally symmetric sparse A.
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.
Interface class for representing subranges of contiguous int's.