Skip to content
Snippets Groups Projects
Commit d45962ff authored by Oliver Sander's avatar Oliver Sander
Browse files

Test matrix inversion for float matrices.

Backported from Martin's development branch.

[[Imported from SVN: r6713]]
parent c0cbc81d
No related branches found
No related tags found
No related merge requests found
......@@ -488,6 +488,15 @@ void test_ev()
std::cout << "Eigenvalues of Rosser matrix: " << eig << std::endl;
}
template< class K, int n >
void test_invert ()
{
Dune::FieldMatrix< K, n, n > A( 1e-15 );
for( int i = 0; i < n; ++i )
A[ i ][ i ] = K( 1 );
A.invert();
}
int main()
{
try {
......@@ -508,9 +517,8 @@ int main()
#endif
// test high level methods
test_determinant();
Dune::FieldMatrix<double, 34, 34> A(1e-15);
for (int i=0; i<34; i++) A[i][i] = 1;
A.invert();
test_invert< float, 34 >();
test_invert< double, 34 >();
return test_invert_solve();
}
catch (Dune::Exception & e)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment