comparison liboctave/array/Range.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 fb37f50d5ba8
children 7ebe185e3818
comparison
equal deleted inserted replaced
28637:fb37f50d5ba8 28638:98192ec1621f
353 OCTAVE_API 353 OCTAVE_API
354 Range 354 Range
355 { 355 {
356 public: 356 public:
357 357
358 OCTAVE_DEPRECATED (7, "use the 'octave::range<double>' class instead")
358 Range (void) 359 Range (void)
359 : m_base (0), m_limit (0), m_inc (0), m_numel (0) 360 : m_base (0), m_limit (0), m_inc (0), m_numel (0)
360 { } 361 { }
361 362
362 // Assume range is already properly constructed, so just copy internal 363 // Assume range is already properly constructed, so just copy internal
363 // values. However, we set LIMIT to the computed final value because 364 // values. However, we set LIMIT to the computed final value because
364 // that mimics the behavior of the other Range class constructors that 365 // that mimics the behavior of the other Range class constructors that
365 // reset limit to the computed final value. 366 // reset limit to the computed final value.
366 367
368 OCTAVE_DEPRECATED (7, "use the 'octave::range<double>' class instead")
367 Range (const octave::range<double>& r) 369 Range (const octave::range<double>& r)
368 : m_base (r.base ()), m_limit (r.final_value ()), m_inc (r.increment ()), 370 : m_base (r.base ()), m_limit (r.final_value ()), m_inc (r.increment ()),
369 m_numel (r.numel ()) 371 m_numel (r.numel ())
370 { } 372 { }
371 373
373 375
374 Range& operator = (const Range& r) = default; 376 Range& operator = (const Range& r) = default;
375 377
376 ~Range (void) = default; 378 ~Range (void) = default;
377 379
380 OCTAVE_DEPRECATED (7, "use the 'octave::range<double>' class instead")
378 Range (double b, double l) 381 Range (double b, double l)
379 : m_base (b), m_limit (l), m_inc (1), m_numel (numel_internal ()) 382 : m_base (b), m_limit (l), m_inc (1), m_numel (numel_internal ())
380 { 383 {
381 if (! octave::math::isinf (m_limit)) 384 if (! octave::math::isinf (m_limit))
382 m_limit = limit_internal (); 385 m_limit = limit_internal ();
383 } 386 }
384 387
388 OCTAVE_DEPRECATED (7, "use the 'octave::range<double>' class instead")
385 Range (double b, double l, double i) 389 Range (double b, double l, double i)
386 : m_base (b), m_limit (l), m_inc (i), m_numel (numel_internal ()) 390 : m_base (b), m_limit (l), m_inc (i), m_numel (numel_internal ())
387 { 391 {
388 if (! octave::math::isinf (m_limit)) 392 if (! octave::math::isinf (m_limit))
389 m_limit = limit_internal (); 393 m_limit = limit_internal ();
393 // the arithmetic operators are removed. 397 // the arithmetic operators are removed.
394 398
395 // For operators' usage (to preserve element count) and to create 399 // For operators' usage (to preserve element count) and to create
396 // constant row vectors (obsolete usage). 400 // constant row vectors (obsolete usage).
397 401
402 OCTAVE_DEPRECATED (7, "use the 'octave::range<double>' class instead")
398 Range (double b, double i, octave_idx_type n) 403 Range (double b, double i, octave_idx_type n)
399 : m_base (b), m_limit (b + (n-1) * i), m_inc (i), m_numel (n) 404 : m_base (b), m_limit (b + (n-1) * i), m_inc (i), m_numel (n)
400 { 405 {
401 if (! octave::math::isinf (m_limit)) 406 if (! octave::math::isinf (m_limit))
402 m_limit = limit_internal (); 407 m_limit = limit_internal ();