diff src/ov-range.h @ 10613:e103fb2182ce

use internal variable instead of warning state to control whether to allow non-integer ranges as indices
author John W. Eaton <jwe@octave.org>
date Fri, 07 May 2010 15:58:51 -0400
parents 1834132fb50b
children d9e57045b9e1
line wrap: on
line diff
--- a/src/ov-range.h
+++ b/src/ov-range.h
@@ -231,17 +231,7 @@
 
   FloatComplex float_complex_value (bool = false) const;
 
-  boolNDArray bool_array_value (bool warn = false) const
-  {
-    Matrix m = range.matrix_value ();
-
-    if (m.any_element_is_nan ())
-      error ("invalid conversion from NaN to logical");
-    else if (warn && m.any_element_not_one_or_zero ())
-      gripe_logical_conversion ();
-
-    return boolNDArray (m);
-  }
+  boolNDArray bool_array_value (bool warn = false) const;
 
   ComplexMatrix complex_matrix_value (bool = false) const
     { return ComplexMatrix (range.matrix_value ()); }
@@ -322,4 +312,7 @@
   DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
 };
 
+// If TRUE, allow ranges with non-integer elements as array indices.
+extern bool Vallow_noninteger_range_as_index;
+
 #endif