diff src/ov-range.h @ 5943:c038c2947ee1

[project @ 2006-08-18 21:27:03 by jwe]
author jwe
date Fri, 18 Aug 2006 21:27:04 +0000
parents c20eb7330d13
children cdef72fcd206
line wrap: on
line diff
--- a/src/ov-range.h	Fri Aug 18 18:57:06 2006 +0000
+++ b/src/ov-range.h	Fri Aug 18 21:27:04 2006 +0000
@@ -160,8 +160,15 @@
 
   Complex complex_value (bool = false) const;
 
-  boolNDArray bool_array_value (void) const
-    { return boolNDArray (range.matrix_value ()); }
+  boolNDArray bool_array_value (bool warn = false) const
+  {
+    Matrix m = range.matrix_value ();
+
+    if (warn && m.any_element_not_one_or_zero ())
+      gripe_logical_conversion ();
+
+    return boolNDArray (m);
+  }
 
   ComplexMatrix complex_matrix_value (bool = false) const
     { return ComplexMatrix (range.matrix_value ()); }