aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/redux.cpp
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2013-06-10 23:40:56 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2013-06-10 23:40:56 +0200
commit62670c83a0ba7cb4f45a734a4817a818a7c92bba (patch)
tree67a8f3fa859f51c59be420acd9dede0c1f820d3a /test/redux.cpp
parent827843bbbdb5a27019d7d679f371a3a69053c762 (diff)
Fix bug #314: move remaining math functions from internal to numext namespace
Diffstat (limited to 'test/redux.cpp')
-rw-r--r--test/redux.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/test/redux.cpp b/test/redux.cpp
index dd6edd1bd..bf68d2212 100644
--- a/test/redux.cpp
+++ b/test/redux.cpp
@@ -26,22 +26,22 @@ template<typename MatrixType> void matrixRedux(const MatrixType& m)
VERIFY_IS_MUCH_SMALLER_THAN(MatrixType::Zero(rows, cols).sum(), Scalar(1));
VERIFY_IS_APPROX(MatrixType::Ones(rows, cols).sum(), Scalar(float(rows*cols))); // the float() here to shut up excessive MSVC warning about int->complex conversion being lossy
- Scalar s(0), p(1), minc(internal::real(m1.coeff(0))), maxc(internal::real(m1.coeff(0)));
+ Scalar s(0), p(1), minc(numext::real(m1.coeff(0))), maxc(numext::real(m1.coeff(0)));
for(int j = 0; j < cols; j++)
for(int i = 0; i < rows; i++)
{
s += m1(i,j);
p *= m1_for_prod(i,j);
- minc = (std::min)(internal::real(minc), internal::real(m1(i,j)));
- maxc = (std::max)(internal::real(maxc), internal::real(m1(i,j)));
+ minc = (std::min)(numext::real(minc), numext::real(m1(i,j)));
+ maxc = (std::max)(numext::real(maxc), numext::real(m1(i,j)));
}
const Scalar mean = s/Scalar(RealScalar(rows*cols));
VERIFY_IS_APPROX(m1.sum(), s);
VERIFY_IS_APPROX(m1.mean(), mean);
VERIFY_IS_APPROX(m1_for_prod.prod(), p);
- VERIFY_IS_APPROX(m1.real().minCoeff(), internal::real(minc));
- VERIFY_IS_APPROX(m1.real().maxCoeff(), internal::real(maxc));
+ VERIFY_IS_APPROX(m1.real().minCoeff(), numext::real(minc));
+ VERIFY_IS_APPROX(m1.real().maxCoeff(), numext::real(maxc));
// test slice vectorization assuming assign is ok
Index r0 = internal::random<Index>(0,rows-1);
@@ -73,13 +73,13 @@ template<typename VectorType> void vectorRedux(const VectorType& w)
for(int i = 1; i < size; i++)
{
Scalar s(0), p(1);
- RealScalar minc(internal::real(v.coeff(0))), maxc(internal::real(v.coeff(0)));
+ RealScalar minc(numext::real(v.coeff(0))), maxc(numext::real(v.coeff(0)));
for(int j = 0; j < i; j++)
{
s += v[j];
p *= v_for_prod[j];
- minc = (std::min)(minc, internal::real(v[j]));
- maxc = (std::max)(maxc, internal::real(v[j]));
+ minc = (std::min)(minc, numext::real(v[j]));
+ maxc = (std::max)(maxc, numext::real(v[j]));
}
VERIFY_IS_MUCH_SMALLER_THAN(abs(s - v.head(i).sum()), Scalar(1));
VERIFY_IS_APPROX(p, v_for_prod.head(i).prod());
@@ -90,13 +90,13 @@ template<typename VectorType> void vectorRedux(const VectorType& w)
for(int i = 0; i < size-1; i++)
{
Scalar s(0), p(1);
- RealScalar minc(internal::real(v.coeff(i))), maxc(internal::real(v.coeff(i)));
+ RealScalar minc(numext::real(v.coeff(i))), maxc(numext::real(v.coeff(i)));
for(int j = i; j < size; j++)
{
s += v[j];
p *= v_for_prod[j];
- minc = (std::min)(minc, internal::real(v[j]));
- maxc = (std::max)(maxc, internal::real(v[j]));
+ minc = (std::min)(minc, numext::real(v[j]));
+ maxc = (std::max)(maxc, numext::real(v[j]));
}
VERIFY_IS_MUCH_SMALLER_THAN(abs(s - v.tail(size-i).sum()), Scalar(1));
VERIFY_IS_APPROX(p, v_for_prod.tail(size-i).prod());
@@ -107,13 +107,13 @@ template<typename VectorType> void vectorRedux(const VectorType& w)
for(int i = 0; i < size/2; i++)
{
Scalar s(0), p(1);
- RealScalar minc(internal::real(v.coeff(i))), maxc(internal::real(v.coeff(i)));
+ RealScalar minc(numext::real(v.coeff(i))), maxc(numext::real(v.coeff(i)));
for(int j = i; j < size-i; j++)
{
s += v[j];
p *= v_for_prod[j];
- minc = (std::min)(minc, internal::real(v[j]));
- maxc = (std::max)(maxc, internal::real(v[j]));
+ minc = (std::min)(minc, numext::real(v[j]));
+ maxc = (std::max)(maxc, numext::real(v[j]));
}
VERIFY_IS_MUCH_SMALLER_THAN(abs(s - v.segment(i, size-2*i).sum()), Scalar(1));
VERIFY_IS_APPROX(p, v_for_prod.segment(i, size-2*i).prod());