Complete rework of global math functions and NumTraits.

* Now completely generic so all standard integer types (like char...) are supported.
** add unit test for that (integer_types).
* NumTraits does no longer inherit numeric_limits
* All math functions are now templated
* Better guard (static asserts) against using certain math functions on integer types.
This commit is contained in:
Benoit Jacob
2010-04-28 18:51:38 -04:00
parent 4f83d6ad19
commit e277586958
26 changed files with 900 additions and 498 deletions

View File

@@ -131,7 +131,7 @@ class PolynomialSolverBase
{
hasArealRoot = false;
int res=0;
RealScalar abs2;
RealScalar abs2(0);
for( int i=0; i<m_roots.size(); ++i )
{
@@ -159,7 +159,7 @@ class PolynomialSolverBase
res = i; }
}
}
return m_roots[res].real();
return ei_real_ref(m_roots[res]);
}
@@ -171,7 +171,7 @@ class PolynomialSolverBase
{
hasArealRoot = false;
int res=0;
RealScalar val;
RealScalar val(0);
for( int i=0; i<m_roots.size(); ++i )
{
@@ -199,7 +199,7 @@ class PolynomialSolverBase
res = i; }
}
}
return m_roots[res].real();
return ei_real_ref(m_roots[res]);
}
public: