21int main(
int argc,
char *argv[])
23 PetscSession::getInstance(argc,argv);
26 cout <<
"=== Matrix: Example linear (double) sparse solver ===\n";
31 const double tol = 1.e-10;
35 cout <<
"=== Matrix: double ===============================\n";
53 catch (
const std::runtime_error &error )
55 cout <<
" \033[1;31;48m * FAILED THROUGH EXCEPTION BEING RAISED \033[0m\n";
64 std::cout <<
"\033[1;31;48m Simple 2x2 double sparse system was not solved correctly\033[0m\n";
65 std::cout <<
" residual vector's inf_norm = " << B.
inf_norm() <<
"\n";
70 std::cout <<
" Simple 2x2 double sparse solve works.\n";
80 catch (
const std::runtime_error &error )
82 cout <<
" \033[1;31;48m * FAILED THROUGH EXCEPTION BEING RAISED \033[0m\n";
91 std::cout <<
"\033[1;31;48m Simple 2x2 double sparse system was not solved correctly\033[0m\n";
92 std::cout <<
" residual vector's inf_norm = " << B.
inf_norm() <<
"\n";
97 std::cout <<
" Simple 2x2 double sparse solve_using_factorisation works.\n";
106 cout <<
"\033[1;31;48m * FAILED \033[0m\n";
111 cout <<
"\033[1;32;48m * PASSED \033[0m\n";
Specification of a sparse-storage linear system class.
A spec for the CppNoddy Timer object.
A spec for a collection of utility functions.
An DenseVector class – a dense vector object.
double inf_norm() const
Infinity norm.
void sub(const DenseVector< _Type > &x)
Subtract a vector, element wise, equivalent to -=.
A linear system class for vector right-hand sides.
void factorise()
Factorise the Ax=B system.
void solve_using_factorisation()
Resolve the same system using the same factorisation.
A matrix class that constructs a SPARSE matrix as a row major std::vector of SparseVectors.
A collection of OO numerical routines aimed at simple (typical) applied problems in continuum mechani...