Mercurial > octave
comparison liboctave/array/Range.h @ 28639:7ebe185e3818
new octave_value constructors for integer and float ranges.
* ov-range.h (octave::octave_range): New constructors that accept
range<T> for T = float and integer types.
(make_double_range): New template function.
(octave_range::octave_range): Use it to convert range<T> arguments to
range<double> for T = float and integer types.
(octave_float_range, octave_double_range, octave_int8_range,
octave_int16_range, octave_int32_range, octave_int64_range,
octave_uint8_range, octave_uint16_range, octave_uint32_range,
octave_uint64_range): New typedefs.
* ov.h, ov.cc (octave_value::octave_value): New constructors that
accept range<T> for T = float and integer types.
(make_range): Return range<T> instead of range<double> for float,
double, and integer types.
* Range.h (range<T>::range): New constructor accepting base,
increment, limit, final, and numel values.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 06 Aug 2020 23:57:40 -0400 |
parents | 98192ec1621f |
children | e26201931ea3 |
comparison
equal
deleted
inserted
replaced
28638:98192ec1621f | 28639:7ebe185e3818 |
---|---|
105 | 105 |
106 range (const T& base, const T& increment, const T& limit, | 106 range (const T& base, const T& increment, const T& limit, |
107 octave_idx_type numel) | 107 octave_idx_type numel) |
108 : m_base (base), m_increment (increment), m_limit (limit), | 108 : m_base (base), m_increment (increment), m_limit (limit), |
109 m_final (limit), m_numel (numel) | 109 m_final (limit), m_numel (numel) |
110 { } | |
111 | |
112 range (const T& base, const T& increment, const T& limit, | |
113 const T& final, octave_idx_type numel) | |
114 : m_base (base), m_increment (increment), m_limit (limit), | |
115 m_final (final), m_numel (numel) | |
110 { } | 116 { } |
111 | 117 |
112 // We don't use a constructor for this because it will conflict with | 118 // We don't use a constructor for this because it will conflict with |
113 // range<T> (base, limit) when T is octave_idx_type. | 119 // range<T> (base, limit) when T is octave_idx_type. |
114 | 120 |