diff 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
line wrap: on
line diff
--- a/liboctave/array/Range.h	Thu Aug 06 16:28:30 2020 -0400
+++ b/liboctave/array/Range.h	Thu Aug 06 23:57:40 2020 -0400
@@ -109,6 +109,12 @@
         m_final (limit), m_numel (numel)
     { }
 
+    range (const T& base, const T& increment, const T& limit,
+           const T& final, octave_idx_type numel)
+      : m_base (base), m_increment (increment), m_limit (limit),
+        m_final (final), m_numel (numel)
+    { }
+
     // We don't use a constructor for this because it will conflict with
     // range<T> (base, limit) when T is octave_idx_type.