Mercurial > hg > octave-lojdl
changeset 9606:a04352386a6b
clear index cache on ++,-- operators
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Thu, 03 Sep 2009 06:59:53 +0200 |
parents | dfc68e6d8741 |
children | 1be3c73ed7b5 |
files | src/ChangeLog src/ov-flt-re-mat.h src/ov-intx.h src/ov-re-mat.h |
diffstat | 4 files changed, 19 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2009-09-03 Jaroslav Hajek <highegg@gmail.com> + + * ov-re-mat.h (octave_matrix::increment, octave_matrix::decrement): + Use matrix_ref. + * ov-flt-re-mat.h (octave_float_matrix::increment, + octave_float_matrix::decrement): Use matrix_ref. + * ov-intx.h (OCTAVE_VALUE_INT_MATRIX_T::increment, + OCTAVE_VALUE_INT_MATRIX_T::decrement): + Use matrix_ref. + 2009-09-02 John W. Eaton <jwe@octave.org> * graphics.cc (axes::properties::calc_ticklabels):
--- a/src/ov-flt-re-mat.h +++ b/src/ov-flt-re-mat.h @@ -163,9 +163,10 @@ octave_value diag (octave_idx_type k = 0) const; - void increment (void) { matrix += 1.0; } + // Use matrix_ref here to clear index cache. + void increment (void) { matrix_ref () += 1.0; } - void decrement (void) { matrix -= 1.0; } + void decrement (void) { matrix_ref () -= 1.0; } octave_value convert_to_str_internal (bool pad, bool force, char type) const;
--- a/src/ov-intx.h +++ b/src/ov-intx.h @@ -299,9 +299,10 @@ return retval; } + // Use matrix_ref here to clear index cache. void increment (void) { - matrix += OCTAVE_INT_T (1); + matrix_ref() += OCTAVE_INT_T (1); if (OCTAVE_INT_T::get_math_trunc_flag ()) gripe_unop_integer_math_truncated ("++", type_name (). c_str ()); @@ -310,7 +311,7 @@ void decrement (void) { - matrix -= OCTAVE_INT_T (1); + matrix_ref() -= OCTAVE_INT_T (1); if (OCTAVE_INT_T::get_math_trunc_flag ()) gripe_unop_integer_math_truncated ("--", type_name (). c_str ()); OCTAVE_INT_T::clear_conv_flag ();
--- a/src/ov-re-mat.h +++ b/src/ov-re-mat.h @@ -177,9 +177,10 @@ octave_value diag (octave_idx_type k = 0) const; - void increment (void) { matrix += 1.0; } + // Use matrix_ref here to clear index cache. + void increment (void) { matrix_ref () += 1.0; } - void decrement (void) { matrix -= 1.0; } + void decrement (void) { matrix_ref () -= 1.0; } octave_value convert_to_str_internal (bool pad, bool force, char type) const;