aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/array_for_matrix.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 /test/array_for_matrix.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 'test/array_for_matrix.cpp')
-rw-r--r--test/array_for_matrix.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/array_for_matrix.cpp b/test/array_for_matrix.cpp
index 5a599c321..cd8ef03a0 100644
--- a/test/array_for_matrix.cpp
+++ b/test/array_for_matrix.cpp
@@ -73,6 +73,7 @@ template<typename MatrixType> void array_for_matrix(const MatrixType& m)
template<typename MatrixType> void comparisons(const MatrixType& m)
{
+ using std::abs;
typedef typename MatrixType::Index Index;
typedef typename MatrixType::Scalar Scalar;
typedef typename NumTraits<Scalar>::Real RealScalar;
@@ -110,7 +111,7 @@ template<typename MatrixType> void comparisons(const MatrixType& m)
Scalar mid = (m1.cwiseAbs().minCoeff() + m1.cwiseAbs().maxCoeff())/Scalar(2);
for (int j=0; j<cols; ++j)
for (int i=0; i<rows; ++i)
- m3(i,j) = internal::abs(m1(i,j))<mid ? 0 : m1(i,j);
+ m3(i,j) = abs(m1(i,j))<mid ? 0 : m1(i,j);
VERIFY_IS_APPROX( (m1.array().abs()<MatrixType::Constant(rows,cols,mid).array())
.select(MatrixType::Zero(rows,cols),m1), m3);
// shorter versions:
@@ -133,11 +134,12 @@ template<typename MatrixType> void comparisons(const MatrixType& m)
template<typename VectorType> void lpNorm(const VectorType& v)
{
+ using std::sqrt;
VectorType u = VectorType::Random(v.size());
VERIFY_IS_APPROX(u.template lpNorm<Infinity>(), u.cwiseAbs().maxCoeff());
VERIFY_IS_APPROX(u.template lpNorm<1>(), u.cwiseAbs().sum());
- VERIFY_IS_APPROX(u.template lpNorm<2>(), internal::sqrt(u.array().abs().square().sum()));
+ VERIFY_IS_APPROX(u.template lpNorm<2>(), sqrt(u.array().abs().square().sum()));
VERIFY_IS_APPROX(internal::pow(u.template lpNorm<5>(), typename VectorType::RealScalar(5)), u.array().abs().pow(5).sum());
}