diff src/ov-re-sparse.cc @ 5943:c038c2947ee1

[project @ 2006-08-18 21:27:03 by jwe]
author jwe
date Fri, 18 Aug 2006 21:27:04 +0000
parents 11bb9bf343a0
children c68896f193e3
line wrap: on
line diff
--- a/src/ov-re-sparse.cc
+++ b/src/ov-re-sparse.cc
@@ -137,9 +137,14 @@
 }
 
 boolNDArray
-octave_sparse_matrix::bool_array_value (void) const
+octave_sparse_matrix::bool_array_value (bool warn) const
 {
-  return boolNDArray (matrix.matrix_value ());
+  NDArray m = matrix.matrix_value ();
+
+  if (warn && m.any_element_not_one_or_zero ())
+    gripe_logical_conversion ();
+
+  return boolNDArray (m);
 }
 
 ComplexMatrix