aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/array_for_matrix.cpp
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2016-11-14 18:47:02 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2016-11-14 18:47:02 +0100
commit2e334f5da0c37eea3bd91f0e80adb5f509d2416b (patch)
tree9ac6ff63601880397ca349286029aea640f1bb23 /test/array_for_matrix.cpp
parenta048aba14c69c286cc04ce3dc8acea8f3801a682 (diff)
bug #426: move operator && and || to MatrixBase and SparseMatrixBase.
Diffstat (limited to 'test/array_for_matrix.cpp')
-rw-r--r--test/array_for_matrix.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/array_for_matrix.cpp b/test/array_for_matrix.cpp
index 97e03be83..c1501947b 100644
--- a/test/array_for_matrix.cpp
+++ b/test/array_for_matrix.cpp
@@ -134,6 +134,12 @@ template<typename MatrixType> void comparisons(const MatrixType& m)
// count
VERIFY(((m1.array().abs()+1)>RealScalar(0.1)).count() == rows*cols);
+ // and/or
+ VERIFY( ((m1.array()<RealScalar(0)).matrix() && (m1.array()>RealScalar(0)).matrix()).count() == 0);
+ VERIFY( ((m1.array()<RealScalar(0)).matrix() || (m1.array()>=RealScalar(0)).matrix()).count() == rows*cols);
+ RealScalar a = m1.cwiseAbs().mean();
+ VERIFY( ((m1.array()<-a).matrix() || (m1.array()>a).matrix()).count() == (m1.cwiseAbs().array()>a).count());
+
typedef Matrix<typename MatrixType::Index, Dynamic, 1> VectorOfIndices;
// TODO allows colwise/rowwise for array