26 #if defined (HAVE_CONFIG_H)
259 || (! ascending && rng_base < rng_limit && rng_inc > 0.0))
276 bool reverse =
false;
279 || (! ascending && rng_base < rng_limit && rng_inc > 0.0))
308 retval.sort_internal (
true);
310 retval.sort_internal (
false);
313 (*current_liboctave_error_handler) (
"Range::sort: invalid dimension");
327 retval.sort_internal (sidx,
true);
329 retval.sort_internal (sidx,
false);
332 (*current_liboctave_error_handler) (
"Range::sort: invalid dimension");
386 double b = a.
base ();
387 double increment = a.
inc ();
395 os << b + i * increment <<
' ';
410 double tmp_rng_limit;
426 return Range (-
r.base (), -
r.limit (), -
r.inc (),
r.numel ());
431 Range result (
x +
r.base (),
x +
r.limit (),
r.inc (),
r.numel ());
436 result.
cache =
x +
r.matrix_value ();
443 Range result (
r.base () +
x,
r.limit () +
x,
r.inc (),
r.numel ());
445 result.
cache =
r.matrix_value () +
x;
452 Range result (
x -
r.base (),
x -
r.limit (), -
r.inc (),
r.numel ());
454 result.
cache =
x -
r.matrix_value ();
461 Range result (
r.base () -
x,
r.limit () -
x,
r.inc (),
r.numel ());
463 result.
cache =
r.matrix_value () -
x;
470 Range result (
x *
r.base (),
x *
r.limit (),
x *
r.inc (),
r.numel ());
472 result.
cache =
x *
r.matrix_value ();
479 Range result (
r.base () *
x,
r.limit () *
x,
r.inc () *
x,
r.numel ());
481 result.
cache =
r.matrix_value () *
x;
534 double rmax = q / (2.0 - ct);
537 t1 = (ct / q) * (t1 < 0.0 ? -t1 : t1);
538 t1 = (rmax < t1 ? rmax : t1);
539 t1 = (ct > t1 ? ct : t1);
542 if (
x <= 0.0 || (t1 -
x) < rmax)
550 double ct = 3.0 * std::numeric_limits<double>::epsilon ())
555 return std::abs (u - v) < ((tu > tv ? tu : tv) * ct);
565 || (rng_limit < rng_base && rng_inc > 0))
571 double ct = 3.0 * std::numeric_limits<double>::epsilon ();
Range operator*(double x, const Range &r)
std::ostream & operator<<(std::ostream &os, const Range &a)
Range operator-(const Range &r)
Range operator+(double x, const Range &r)
std::istream & operator>>(std::istream &is, Range &a)
static bool teq(double u, double v, double ct=3.0 *std::numeric_limits< double >::epsilon())
static double tfloor(double x, double ct)
charNDArray max(char d, const charNDArray &m)
void resize(const dim_vector &dv, const T &rfv)
Size of the specified dimension.
T & xelem(octave_idx_type n)
Size of the specified dimension.
const T * fortran_vec(void) const
Size of the specified dimension.
bool isempty(void) const
Size of the specified dimension.
MArray< T > reshape(const dim_vector &new_dims) const
Matrix diag(octave_idx_type k=0) const
void resize(octave_idx_type nr, octave_idx_type nc, double rfv=0)
octave_idx_type numel_internal(void) const
void clear_cache(void) const
dim_vector dims(void) const
sortmode issorted(sortmode mode=ASCENDING) const
double elem(octave_idx_type i) const
Range sort(octave_idx_type dim=0, sortmode mode=ASCENDING) const
Matrix diag(octave_idx_type k=0) const
octave_idx_type nnz(void) const
double limit_internal(void) const
octave_idx_type rng_numel
Matrix matrix_value(void) const
void sort_internal(bool ascending=true)
bool all_elements_are_ints(void) const
octave_idx_type numel(void) const
Array< double > index(const idx_vector &i) const
double checkelem(octave_idx_type i) const
__rangeidx_helper(double *a, double b, double i, double l, octave_idx_type n)
void operator()(octave_idx_type i)
Vector representing the dimensions (size) of an Array.
bool isvector(void) const
bool is_colon(void) const
void loop(octave_idx_type n, Functor body) const
octave_idx_type length(octave_idx_type n=0) const
dim_vector orig_dimensions(void) const
octave_idx_type extent(octave_idx_type n) const
F77_RET_T const F77_DBLE * x
octave_idx_type nint_big(double x)
std::complex< T > floor(const std::complex< T > &x)
void err_index_out_of_range(int nd, int dim, octave_idx_type idx, octave_idx_type ext, const dim_vector &dv)
octave_value::octave_value(const Array< char > &chm, char type) return retval