mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
bug #86 : use internal:: namespace instead of ei_ prefix
This commit is contained in:
@@ -42,8 +42,8 @@ template<typename MatrixType> void array_for_matrix(const MatrixType& m)
|
||||
ColVectorType cv1 = ColVectorType::Random(rows);
|
||||
RowVectorType rv1 = RowVectorType::Random(cols);
|
||||
|
||||
Scalar s1 = ei_random<Scalar>(),
|
||||
s2 = ei_random<Scalar>();
|
||||
Scalar s1 = internal::random<Scalar>(),
|
||||
s2 = internal::random<Scalar>();
|
||||
|
||||
// scalar addition
|
||||
VERIFY_IS_APPROX(m1.array() + s1, s1 + m1.array());
|
||||
@@ -59,9 +59,9 @@ template<typename MatrixType> void array_for_matrix(const MatrixType& m)
|
||||
// reductions
|
||||
VERIFY_IS_APPROX(m1.colwise().sum().sum(), m1.sum());
|
||||
VERIFY_IS_APPROX(m1.rowwise().sum().sum(), m1.sum());
|
||||
if (!ei_isApprox(m1.sum(), (m1+m2).sum()))
|
||||
if (!internal::isApprox(m1.sum(), (m1+m2).sum()))
|
||||
VERIFY_IS_NOT_APPROX(((m1+m2).rowwise().sum()).sum(), m1.sum());
|
||||
VERIFY_IS_APPROX(m1.colwise().sum(), m1.colwise().redux(ei_scalar_sum_op<Scalar>()));
|
||||
VERIFY_IS_APPROX(m1.colwise().sum(), m1.colwise().redux(internal::scalar_sum_op<Scalar>()));
|
||||
|
||||
// vector-wise ops
|
||||
m3 = m1;
|
||||
@@ -88,8 +88,8 @@ template<typename MatrixType> void comparisons(const MatrixType& m)
|
||||
Index rows = m.rows();
|
||||
Index cols = m.cols();
|
||||
|
||||
Index r = ei_random<Index>(0, rows-1),
|
||||
c = ei_random<Index>(0, cols-1);
|
||||
Index r = internal::random<Index>(0, rows-1),
|
||||
c = internal::random<Index>(0, cols-1);
|
||||
|
||||
MatrixType m1 = MatrixType::Random(rows, cols),
|
||||
m2 = MatrixType::Random(rows, cols),
|
||||
@@ -117,7 +117,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) = ei_abs(m1(i,j))<mid ? 0 : m1(i,j);
|
||||
m3(i,j) = internal::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:
|
||||
@@ -144,8 +144,8 @@ template<typename VectorType> void lpNorm(const VectorType& v)
|
||||
|
||||
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>(), ei_sqrt(u.array().abs().square().sum()));
|
||||
VERIFY_IS_APPROX(ei_pow(u.template lpNorm<5>(), typename VectorType::RealScalar(5)), u.array().abs().pow(5).sum());
|
||||
VERIFY_IS_APPROX(u.template lpNorm<2>(), internal::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());
|
||||
}
|
||||
|
||||
void test_array_for_matrix()
|
||||
|
||||
Reference in New Issue
Block a user