aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/test/polynomialsolver.cpp
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2012-11-06 15:25:50 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2012-11-06 15:25:50 +0100
commita76fbbf39777827200455477a9e3557b6063913f (patch)
tree6a03f8fcb163fa2c3dc2267c52fd1204f5490309 /unsupported/test/polynomialsolver.cpp
parent959ef37006e60f68b9a9e667bf9da2e14eb0e8af (diff)
Fix bug #314:
- remove most of the metaprogramming kung fu in MathFunctions.h (only keep functions that differs from the std) - remove the overloads for array expression that were in the std namespace
Diffstat (limited to 'unsupported/test/polynomialsolver.cpp')
-rw-r--r--unsupported/test/polynomialsolver.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/unsupported/test/polynomialsolver.cpp b/unsupported/test/polynomialsolver.cpp
index fefeaff01..c31104f14 100644
--- a/unsupported/test/polynomialsolver.cpp
+++ b/unsupported/test/polynomialsolver.cpp
@@ -92,6 +92,7 @@ void evalSolver( const POLYNOMIAL& pols )
template< int Deg, typename POLYNOMIAL, typename ROOTS, typename REAL_ROOTS >
void evalSolverSugarFunction( const POLYNOMIAL& pols, const ROOTS& roots, const REAL_ROOTS& real_roots )
{
+ using std::sqrt;
typedef typename POLYNOMIAL::Scalar Scalar;
typedef PolynomialSolver<Scalar, Deg > PolynomialSolverType;
@@ -115,7 +116,7 @@ void evalSolverSugarFunction( const POLYNOMIAL& pols, const ROOTS& roots, const
psolve.realRoots( calc_realRoots );
VERIFY( calc_realRoots.size() == (size_t)real_roots.size() );
- const Scalar psPrec = internal::sqrt( test_precision<Scalar>() );
+ const Scalar psPrec = sqrt( test_precision<Scalar>() );
for( size_t i=0; i<calc_realRoots.size(); ++i )
{
@@ -130,24 +131,24 @@ void evalSolverSugarFunction( const POLYNOMIAL& pols, const ROOTS& roots, const
//Test greatestRoot
VERIFY( internal::isApprox( roots.array().abs().maxCoeff(),
- internal::abs( psolve.greatestRoot() ), psPrec ) );
+ abs( psolve.greatestRoot() ), psPrec ) );
//Test smallestRoot
VERIFY( internal::isApprox( roots.array().abs().minCoeff(),
- internal::abs( psolve.smallestRoot() ), psPrec ) );
+ abs( psolve.smallestRoot() ), psPrec ) );
bool hasRealRoot;
//Test absGreatestRealRoot
Real r = psolve.absGreatestRealRoot( hasRealRoot );
VERIFY( hasRealRoot == (real_roots.size() > 0 ) );
if( hasRealRoot ){
- VERIFY( internal::isApprox( real_roots.array().abs().maxCoeff(), internal::abs(r), psPrec ) ); }
+ VERIFY( internal::isApprox( real_roots.array().abs().maxCoeff(), abs(r), psPrec ) ); }
//Test absSmallestRealRoot
r = psolve.absSmallestRealRoot( hasRealRoot );
VERIFY( hasRealRoot == (real_roots.size() > 0 ) );
if( hasRealRoot ){
- VERIFY( internal::isApprox( real_roots.array().abs().minCoeff(), internal::abs( r ), psPrec ) ); }
+ VERIFY( internal::isApprox( real_roots.array().abs().minCoeff(), abs( r ), psPrec ) ); }
//Test greatestRealRoot
r = psolve.greatestRealRoot( hasRealRoot );