Mercurial > octave-nkf
comparison libinterp/octave-value/ov-intx.h @ 18129:e473c4853afc gui-release
enable non-integer ranges as indices by default and deprecate preference
* octave.cc (maximum_braindamage): Don't call
Fdo_brainded_shortcircuit_evaluation.
* error.cc (initialize_default_warning_state): Don't set
Octave:noninteger-range-as-index to "error".
* octave.cc (maximum_braindamage): Don't call
Fallow_noninteger_range_as_index. Don't set
Octave:noninteger-range-as-index to "on".
* ov-range.h, ov-range.cc (Vallow_noninteger_range_as_index):
Now static. Set default value to true.
* ov.h (octave_value::index_vector): New arg, require_integers.
* ov-base.cc, ov-base.h (octave_value::index_vector): Likewise.
* ov-base-diag.cc, ov-base-diag.h, ov-bool-mat.h, ov-bool-sparse.h,
ov-bool.h, ov-ch-mat.cc, ov-ch-mat.h, ov-class.cc, ov-class.h,
ov-colon.h, ov-complex.h, ov-float.h, ov-flt-re-mat.h, ov-intx.h,
ov-lazy-idx.h, ov-perm.cc, ov-perm.h, ov-range.cc, ov-range.h,
ov-re-mat.h, ov-re-sparse.cc, ov-re-sparse.h, ov-scalar.h:
Make corresponding changes in all derived methods.
* ov-range.cc (octave_range::index_vector): If new require_integers
argument is true, also require integer arguments regardless of the
setting of Vallow_noninteger_range_as_index.
* utils.cc (Fisindex): Don't temporarily set
Vallow_noninteger_range_as_index. Call index_vector with argument of
true.
* NEWS: Mention change in default value, warning state and deprecated
function.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 11 Dec 2013 23:35:34 -0500 |
parents | 175b392e91fe |
children | 1b6db9303933 |
comparison
equal
deleted
inserted
replaced
18128:4a4897cd6da1 | 18129:e473c4853afc |
---|---|
301 void changesign (void) | 301 void changesign (void) |
302 { | 302 { |
303 matrix_ref ().changesign (); | 303 matrix_ref ().changesign (); |
304 } | 304 } |
305 | 305 |
306 idx_vector index_vector (void) const | 306 idx_vector index_vector (bool /* require_integers */ = false) const |
307 { return idx_cache ? *idx_cache : set_idx_cache (idx_vector (matrix)); } | 307 { |
308 return idx_cache ? *idx_cache : set_idx_cache (idx_vector (matrix)); | |
309 } | |
308 | 310 |
309 int write (octave_stream& os, int block_size, | 311 int write (octave_stream& os, int block_size, |
310 oct_data_conv::data_type output_type, int skip, | 312 oct_data_conv::data_type output_type, int skip, |
311 oct_mach_info::float_format flt_fmt) const | 313 oct_mach_info::float_format flt_fmt) const |
312 { return os.write (matrix, block_size, output_type, skip, flt_fmt); } | 314 { return os.write (matrix, block_size, output_type, skip, flt_fmt); } |
604 void decrement (void) | 606 void decrement (void) |
605 { | 607 { |
606 scalar -= OCTAVE_INT_T (1); | 608 scalar -= OCTAVE_INT_T (1); |
607 } | 609 } |
608 | 610 |
609 idx_vector index_vector (void) const { return idx_vector (scalar); } | 611 idx_vector index_vector (bool /* require_integers */ = false) const { return idx_vector (scalar); } |
610 | 612 |
611 int write (octave_stream& os, int block_size, | 613 int write (octave_stream& os, int block_size, |
612 oct_data_conv::data_type output_type, octave_idx_type skip, | 614 oct_data_conv::data_type output_type, octave_idx_type skip, |
613 oct_mach_info::float_format flt_fmt) const | 615 oct_mach_info::float_format flt_fmt) const |
614 { | 616 { |