29 f[ 0 ] =
z[ 0 ] *
z[ 0 ] *
z[ 0 ] - 1.0;
43 cout <<
"=== Exception checks: testing forced failures =======\n";
47 int exceptions_caught( 0 );
69 catch (
const std::exception & e )
72 cout <<
" Caught a runtime exception in the native linear solver \n\n";
87 catch ( std::exception & e )
90 cout <<
" Caught a geometry exception when adding two matrices. \n\n";
107 catch ( std::exception & e )
110 cout <<
" Caught an iteration exception in a scalar Newton problem. \n\n";
114 if ( tests != exceptions_caught )
116 cout <<
"\033[1;31;48m * FAILED \033[0m\n";
117 cout << tests <<
" checks were run but only " << exceptions_caught
118 <<
" exceptions were caught!\n";
123 cout <<
"\033[1;32;48m * PASSED \033[0m\n";
Specification of the linear system class.
A shorter bundled include file for Newton iteration problems.
A linear system class for vector right-hand sides.
void solve()
Solve the sparse system.
A matrix class that constructs a DENSE matrix as a row major std::vector of DenseVectors.
void add(const DenseMatrix< _Type > &b)
Add a DENSE matrix to this object.
An DenseVector class – a dense vector object.
The problem to be solved, here z^3 -1 in complex form.
void residual_fn(const DenseVector< D_complex > &z, DenseVector< D_complex > &f) const
The residual function for z^3 -1.
A vector NEWTON iteration class.
void iterate(DenseVector< _Type > &x)
The Newton iteration method.
A base class to be inherited by objects that define residuals.
A collection of OO numerical routines aimed at simple (typical) applied problems in continuum mechani...
std::complex< double > D_complex
A complex double precision number using std::complex.