Mercurial > octave
diff liboctave/array/idx-vector.h @ 28638:98192ec1621f
replace Range with range<double>
* __magick_read__.cc, cellfun.cc, data.cc, ls-mat4.cc, max.cc,
pr-output.cc, pr-output.h, rand.cc, tril.cc, xpow.cc, xpow.h,
ov-base.cc, ov-base.h, ov-range.cc, ov-range.h, ov.cc, ov.h,
jit-typeinfo.cc, jit-typeinfo.h, pt-eval.cc, pt-jit.cc, idx-vector.cc,
idx-vector.h: Replace all uses of Range with range<double>.
* Range.h: Deprecated Range constructors.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 06 Aug 2020 16:28:30 -0400 |
parents | bd51beb6205e |
children | f8efd03a553e |
line wrap: on
line diff
--- a/liboctave/array/idx-vector.h Thu Aug 06 15:36:30 2020 -0400 +++ b/liboctave/array/idx-vector.h Thu Aug 06 16:28:30 2020 -0400 @@ -41,14 +41,21 @@ template <typename T> class Array; template <typename T> class Sparse; -class Range; + +namespace octave +{ + template <typename T> class range; +} // Design rationale: -// idx_vector is a reference-counting, polymorphic pointer, that can contain -// 4 types of index objects: a magic colon, a range, a scalar, or an index vector. -// Polymorphic methods for single element access are provided, as well as -// templates implementing "early dispatch", i.e., hoisting the checks for index -// type out of loops. +// +// idx_vector is a reference-counting, polymorphic pointer, that can +// contain 4 types of index objects: a magic colon, a range, a scalar, +// or an index vector. +// +// Polymorphic methods for single element access are provided, as well +// as templates implementing "early dispatch", i.e., hoisting the checks +// for index type out of loops. class OCTAVE_API @@ -173,7 +180,7 @@ idx_range_rep (octave_idx_type _start, octave_idx_type _limit, octave_idx_type _step); - idx_range_rep (const Range&); + idx_range_rep (const octave::range<double>&); // No copying! @@ -212,7 +219,7 @@ std::ostream& print (std::ostream& os) const; - Range unconvert (void) const; + octave::range<double> unconvert (void) const; Array<octave_idx_type> as_array (void); @@ -525,7 +532,7 @@ idx_vector (const Array<bool>& nda); - idx_vector (const Range& r) + idx_vector (const octave::range<double>& r) : rep (new idx_range_rep (r)) { chkerr (); } @@ -1013,7 +1020,7 @@ // Unconverts the index to a scalar, Range, double array or a mask. void unconvert (idx_class_type& iclass, - double& scalar, Range& range, + double& scalar, octave::range<double>& range, Array<double>& array, Array<bool>& mask) const; Array<octave_idx_type> as_array (void) const;