Mercurial > hg > octave-nkf
diff liboctave/array/Range.h @ 20438:00cf2847355d
Deprecate Array::nelem() and Range::nelem() in favour of ::numel().
* liboctave/array/Array.h (Array::nelem) deprecate in favour of numel().
(Array::capacity, Array:: length): change to call numel() directly. These
methods will be deprecated soon.
* liboctave/array/PermMatrix.h (PermMatrix::nelem): deprecate in favour of
numel().
* liboctave/array/Range.h (Range::numel) new method to replace nelem().
(Range::nelem) deprecate in favour of the new method numel.
* liboctave/array/Sparse.h (Sparse::nelem) deprecate in favour of nzmax().
This one is secially bad because unlike the other classes, it is different
from numel().
* libinterp/corefcn/debug.cc, libinterp/corefcn/jit-typeinfo.cc,
libinterp/corefcn/ls-mat4.cc, libinterp/corefcn/lu.cc,
libinterp/corefcn/luinc.cc, libinterp/corefcn/max.cc,
libinterp/corefcn/pr-output.cc, libinterp/corefcn/rand.cc,
libinterp/corefcn/xpow.cc, libinterp/dldfcn/__magick_read__.cc,
libinterp/dldfcn/audioread.cc, libinterp/octave-value/ov-base-int.cc,
libinterp/octave-value/ov-bool-mat.cc, libinterp/octave-value/ov-flt-re-mat.cc,
libinterp/octave-value/ov-perm.cc, libinterp/octave-value/ov-range.cc,
libinterp/octave-value/ov-range.h, libinterp/octave-value/ov-re-mat.cc,
libinterp/parse-tree/pt-eval.cc, liboctave/array/Array.cc,
liboctave/array/CNDArray.cc, liboctave/array/Range.cc,
liboctave/array/dNDArray.cc, liboctave/array/fCNDArray.cc,
liboctave/array/fNDArray.cc, liboctave/array/idx-vector.cc,
liboctave/array/intNDArray.cc, liboctave/numeric/SparseCmplxLU.cc,
liboctave/numeric/SparsedbleLU.cc: replace use of nelem() with numel().
author | Carnë Draug <carandraug@octave.org> |
---|---|
date | Sun, 24 May 2015 02:41:37 +0100 |
parents | 4197fc428c7d |
children | 96153b16febe |
line wrap: on
line diff
--- a/liboctave/array/Range.h +++ b/liboctave/array/Range.h @@ -35,33 +35,34 @@ public: Range (void) - : rng_base (0), rng_limit (0), rng_inc (0), rng_nelem (0), cache (1, 0) { } + : rng_base (0), rng_limit (0), rng_inc (0), rng_numel (0), cache (1, 0) { } Range (const Range& r) : rng_base (r.rng_base), rng_limit (r.rng_limit), rng_inc (r.rng_inc), - rng_nelem (r.rng_nelem), cache (r.cache) { } + rng_numel (r.rng_numel), cache (r.cache) { } Range (double b, double l) : rng_base (b), rng_limit (l), rng_inc (1), - rng_nelem (nelem_internal ()), cache () { } + rng_numel (numel_internal ()), cache () { } Range (double b, double l, double i) : rng_base (b), rng_limit (l), rng_inc (i), - rng_nelem (nelem_internal ()), cache () { } + rng_numel (numel_internal ()), cache () { } // For operators' usage (to preserve element count). Range (double b, double i, octave_idx_type n) : rng_base (b), rng_limit (b + (n-1) * i), rng_inc (i), - rng_nelem (n), cache () + rng_numel (n), cache () { if (! xfinite (b) || ! xfinite (i) || ! xfinite (rng_limit)) - rng_nelem = -2; + rng_numel = -2; } double base (void) const { return rng_base; } double limit (void) const { return rng_limit; } double inc (void) const { return rng_inc; } - octave_idx_type nelem (void) const { return rng_nelem; } + GCC_ATTR_DEPRECATED octave_idx_type nelem (void) const { return numel (); } + octave_idx_type numel (void) const { return rng_numel; } bool all_elements_are_ints (void) const; @@ -137,11 +138,11 @@ double rng_limit; double rng_inc; - octave_idx_type rng_nelem; + octave_idx_type rng_numel; mutable Matrix cache; - octave_idx_type nelem_internal (void) const; + octave_idx_type numel_internal (void) const; void clear_cache (void) const { cache.resize (0, 0); } @@ -150,10 +151,10 @@ // For operators' usage (to allow all values to be set directly). Range (double b, double l, double i, octave_idx_type n) : rng_base (b), rng_limit (l), rng_inc (i), - rng_nelem (n), cache () + rng_numel (n), cache () { if (! xfinite (b) || ! xfinite (i) || ! xfinite (l)) - rng_nelem = -2; + rng_numel = -2; } };