65 cache(i) = b + i * increment;
107 #if defined (BOUNDS_CHECKING)
142 if ((inc > 0 && end >=
limit) || (inc < 0 && end <=
limit))
245 else if (! ascending && rng_base < rng_limit && rng_inc > 0.0)
264 bool reverse =
false;
275 else if (! ascending && rng_base < rng_limit && rng_inc > 0.0)
302 Range retval = *
this;
312 (*current_liboctave_error_handler) (
"Range::sort: invalid dimension");
321 Range retval = *
this;
331 (*current_liboctave_error_handler) (
"Range::sort: invalid dimension");
352 double b = a.
base ();
353 double increment = a.
inc ();
361 os << b + i * increment <<
" ";
365 os << (increment > 0 ? a.
max () : a.
min ()) <<
"\n";
396 if (result.rng_nelem < 0)
405 if (result.rng_nelem < 0)
414 if (result.rng_nelem < 0)
423 if (result.rng_nelem < 0)
432 if (result.rng_nelem < 0)
441 if (result.rng_nelem < 0)
496 double rmax = q / (2.0 - ct);
499 t1 = (ct / q) * (t1 < 0.0 ? -t1 : t1);
500 t1 = rmax < t1 ? rmax : t1;
501 t1 = ct > t1 ? ct : t1;
504 if (x <= 0.0 || (t1 - x) < rmax)
518 double ct = 3.0 * std::numeric_limits<double>::epsilon ())
520 double tu = fabs (u);
521 double tv = fabs (v);
523 return fabs (u - v) < ((tu > tv ? tu : tv) * ct);
533 || (rng_limit < rng_base && rng_inc > 0))
539 double ct = 3.0 * std::numeric_limits<double>::epsilon ();
Matrix diag(octave_idx_type k=0) const
static bool teq(double u, double v, double ct=3.0 *std::numeric_limits< double >::epsilon())
std::ostream & operator<<(std::ostream &os, const Range &a)
octave_idx_type length(octave_idx_type n=0) const
void resize(octave_idx_type nr, octave_idx_type nc, double rfv=0)
bool is_vector(void) const
Range operator-(const Range &r)
octave_idx_type nelem(void) const
Range operator+(double x, const Range &r)
void operator()(octave_idx_type i)
octave_idx_type nelem(void) const
Number of elements in the array.
Range sort(octave_idx_type dim=0, sortmode mode=ASCENDING) const
void loop(octave_idx_type n, Functor body) const
dim_vector orig_dimensions(void) const
void sort_internal(bool ascending=true)
Range operator*(double x, const Range &r)
static void gripe_index_out_of_range(void)
Matrix diag(octave_idx_type k=0) const
void resize(const dim_vector &dv, const T &rfv)
double elem(octave_idx_type i) const
std::istream & operator>>(std::istream &is, Range &a)
sortmode is_sorted(sortmode mode=ASCENDING) const
Matrix matrix_value(void) const
Handles the reference counting for all the derived classes.
charNDArray max(char d, const charNDArray &m)
Array< double > index(const idx_vector &i) const
octave_idx_type extent(octave_idx_type n) const
static double tfloor(double x, double ct)
bool all_elements_are_ints(void) const
octave_idx_type rng_nelem
std::complex< T > floor(const std::complex< T > &x)
const T * fortran_vec(void) const
MArray< T > reshape(const dim_vector &new_dims) const
octave_idx_type NINTbig(double x)
double checkelem(octave_idx_type i) const
octave_idx_type nelem_internal(void) const
static double tceil(double x, double ct)
__rangeidx_helper(double *a, double b, double i, double l, octave_idx_type n)
bool is_colon(void) const
F77_RET_T const double * x
void clear_cache(void) const