aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2011-05-31 22:17:34 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2011-05-31 22:17:34 +0200
commit35c1158ee376b31a740a538ac1251460102971dd (patch)
tree93109d172f2250e4b83667a7b33aa333994867cc /test
parentb495203310c53e80c240f349af06e359294e297a (diff)
add boolean || and && operators
Diffstat (limited to 'test')
-rw-r--r--test/array.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/array.cpp b/test/array.cpp
index fad835cb4..5b5c2ab30 100644
--- a/test/array.cpp
+++ b/test/array.cpp
@@ -149,6 +149,12 @@ template<typename ArrayType> void comparisons(const ArrayType& m)
// count
VERIFY(((m1.abs()+1)>RealScalar(0.1)).count() == rows*cols);
+ // and/or
+ VERIFY( (m1<RealScalar(0) && m1>RealScalar(0)).count() == 0);
+ VERIFY( (m1<RealScalar(0) || m1>=RealScalar(0)).count() == rows*cols);
+ RealScalar a = m1.abs().mean();
+ VERIFY( (m1<-a || m1>a).count() == (m1.abs()>a).count());
+
typedef Array<typename ArrayType::Index, Dynamic, 1> ArrayOfIndices;
// TODO allows colwise/rowwise for array