Skip to content
Snippets Groups Projects
Commit de0b6e9e authored by Martin Nolte's avatar Martin Nolte
Browse files

use field_type( 1 ) instead of 1.0

This fixes FS#1317 for me (use invert for 2x2 matrix with
std::complex< long double >).
The problem is that 1.0 is a double, which can be converted implicitly
to a long double which, in turn, could be converted implicitly into a
std::complex< long double >. However, the compiler does not use two
implicit type conversions, so double cannot be divided by a
std::complex< long double >.
parent e4d80dbf
Branches
Tags
No related merge requests found
......@@ -867,7 +867,7 @@ namespace Dune
if (fvmeta::absreal((*this)[0][0])<FMatrixPrecision<>::absolute_limit())
DUNE_THROW(FMatrixError,"matrix is singular");
#endif
(*this)[0][0] = 1.0/(*this)[0][0];
(*this)[0][0] = field_type( 1 ) / (*this)[0][0];
}
else if (rows()==2) {
......@@ -877,7 +877,7 @@ namespace Dune
if (fvmeta::absreal(detinv)<FMatrixPrecision<>::absolute_limit())
DUNE_THROW(FMatrixError,"matrix is singular");
#endif
detinv = 1.0/detinv;
detinv = field_type( 1 ) / detinv;
field_type temp=(*this)[0][0];
(*this)[0][0] = (*this)[1][1]*detinv;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment