26 #if ! defined (octave_Range_h)
27 #define octave_Range_h 1
29 #include "octave-config.h"
44 : rng_base (0), rng_limit (0), rng_inc (0), rng_numel (0), cache (1, 0) { }
53 : rng_base (b), rng_limit (l), rng_inc (1),
54 rng_numel (numel_internal ()), cache ()
56 rng_limit = limit_internal ();
59 Range (
double b,
double l,
double i)
60 : rng_base (b), rng_limit (l), rng_inc (i),
61 rng_numel (numel_internal ()), cache ()
63 rng_limit = limit_internal ();
68 : rng_base (b), rng_limit (b + (
n-1) * i), rng_inc (i),
69 rng_numel (
n), cache ()
79 rng_limit = limit_internal ();
83 double base (
void)
const {
return rng_base; }
84 double limit (
void)
const {
return rng_limit; }
85 double inc (
void)
const {
return rng_inc; }
98 bool all_elements_are_ints (
void)
const;
100 Matrix matrix_value (
void)
const;
102 double min (
void)
const;
103 double max (
void)
const;
105 void sort_internal (
bool ascending =
true);
129 {
return elem (i, j); }
133 void set_base (
double b);
135 void set_limit (
double l);
137 void set_inc (
double i);
139 friend OCTAVE_API std::ostream&
operator << (std::ostream& os,
163 double limit_internal (
void)
const;
173 : rng_base (b), rng_limit (l), rng_inc (i),
174 rng_numel (
n), cache ()
template OCTAVE_API std::ostream & operator<<(std::ostream &, const Array< bool > &)
OCTAVE_API Range operator+(double x, const Range &r)
OCTAVE_API Range operator*(double x, const Range &r)
OCTAVE_API Range operator-(const Range &r)
std::istream & operator>>(std::istream &is, SparseBoolMatrix &a)
charNDArray max(char d, const charNDArray &m)
charNDArray min(char d, const charNDArray &m)
void resize(octave_idx_type nr, octave_idx_type nc, double rfv=0)
void clear_cache(void) const
octave_idx_type rows(void) const
dim_vector dims(void) const
Range(const Range &r)=default
octave_idx_type cols(void) const
Range(double b, double l)
Range(double b, double l, double i, octave_idx_type n)
octave_idx_type rng_numel
Range(double b, double i, octave_idx_type n)
octave_idx_type columns(void) const
octave_idx_type numel(void) const
Range(double b, double l, double i)
double elem(octave_idx_type, octave_idx_type j) const
Vector representing the dimensions (size) of an Array.
F77_RET_T const F77_DBLE * x
T::size_type numel(const T &str)