diff liboctave/util/nz-iterators.h @ 19009:8d47ce2053f2 draft

Added safety checks to Array::xelem There's no reason to have a method which never checks invariants, ever. Added debugging checks to Array::xelem to help catch and debug out-of-bounds errors and reference overlap * configure.ac: Added configuration option for uniqueness-checking with xelem * jit-typeinfo.cc (octave_jit_paren_scalar): Call const Array::xelem rather than Array::xelem * Array-util.h, Array-util.cc (check_out_of_range): Extract common pattern to method (check_index): Methods to check index is in-bounds (compute_index): Added bool parameter check. does not check bounds when check is false and BOUNDS_CHECKING is off * Array.h, Array.cc (xelem): Use methods from Array-util.h to compute indices (is_unique): Check if this is the only reference to data * CmplxQR.cc, dbleQR.cc, fCmplxQR.cc, floatQR.cc (form): Move second assignment to after the call to xelem * lo-array-gripes.h, lo-array-gripes.cc (gripe_modifying_nonunique): Added error message for when non-const xelem is called on non-unique array
author David Spies <dnspies@gmail.com>
date Mon, 14 Jul 2014 13:07:59 -0600
parents 2e0613dadfee
children 3fb030666878
line wrap: on
line diff
--- a/liboctave/util/nz-iterators.h	Sat Jun 21 13:13:05 2014 -0600
+++ b/liboctave/util/nz-iterators.h	Mon Jul 14 13:07:59 2014 -0600
@@ -245,7 +245,7 @@
   double
   interp_idx (void) const
   {
-    return to_interp_idx (row (), col (), mat.rows ());
+    return to_interp_idx (row (), col (), mat.dims ());
   }
   octave_idx_type
   col (void) const
@@ -313,7 +313,7 @@
   double
   interp_idx (void) const
   {
-    return to_interp_idx (row (), col (), mat.rows ());
+    return to_interp_idx (row (), col (), mat.dims ());
   }
   octave_idx_type
   col (void) const
@@ -369,7 +369,7 @@
   octave_idx_type
   interp_idx (void) const
   {
-    return to_interp_idx (row (), col (), mat.rows ());
+    return to_interp_idx (row (), col (), mat.dims ());
   }
   octave_idx_type
   col (void) const