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

don't assign a double value to rt myEps (where rt might be int)

[[Imported from SVN: r6923]]
parent b98a25d6
Branches master
No related tags found
No related merge requests found
......@@ -17,6 +17,13 @@
using Dune::FieldVector;
using std::complex;
template< class rt > struct Epsilon;
template<> struct Epsilon< int > { static int value () { return 0; } };
template<> struct Epsilon< float > { static float value () { return 1e-6f; } };
template<> struct Epsilon< double > { static double value () { return 1e-12; } };
template<class ft, class rt, int d>
struct FieldVectorMainTest
{
......@@ -85,10 +92,10 @@ struct FieldVectorMainTest
// test istream operator
std::stringstream s;
for (int i=0; i<d; i++)
for( int i = 0; i < d; ++i )
{
s << i << " ";
v[i] = i;
v[i] = rt( i );
}
s >> w;
assert(v == w);
......@@ -209,7 +216,7 @@ struct DotProductTest
{
DotProductTest() {
typedef std::complex<rt> ct;
const rt myEps(1e-6);
const rt myEps = Epsilon< rt >::value();
dune_static_assert(
( Dune::is_same< typename Dune::FieldTraits<rt>::real_type, rt>::value ),
......
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