GNU Octave  8.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
Range.cc File Reference
#include <cmath>
#include <istream>
#include <limits>
#include <ostream>
#include "Array-util.h"
#include "Range.h"
#include "lo-error.h"
#include "lo-mappers.h"
#include "lo-utils.h"
Include dependency graph for Range.cc:

Go to the source code of this file.

Functions

Range operator* (const Range &r, double x)
 
Range operator* (double x, const Range &r)
 
Range operator+ (const Range &r, double x)
 
Range operator+ (double x, const Range &r)
 
Range operator- (const Range &r)
 
Range operator- (const Range &r, double x)
 
Range operator- (double x, const Range &r)
 
std::ostream & operator<< (std::ostream &os, const Range &a)
 
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)
 
template<typename T >
bool xall_elements_are_ints (T base, T inc, T final_val, octave_idx_type nel)
 
template<typename T >
xfinal_value (T base, T limit, T inc, octave_idx_type nel)
 
template<typename T >
void xinit (const octave_int< T > &base, const octave_int< T > &limit, const octave_int< T > &inc, bool reverse, octave_int< T > &final_val, octave_idx_type &nel)
 
template<typename T >
void xinit (T base, T limit, T inc, bool reverse, T &final_val, octave_idx_type &nel)
 
template<typename T >
bool xis_storable (T base, T limit, octave_idx_type nel)
 
template<typename T >
octave_idx_type xnnz (T base, T limit, T inc, T final_val, octave_idx_type nel)
 
template<typename T >
octave_idx_type xnumel_internal (T base, T limit, T inc)
 
template<typename T >
bool xteq (T u, T v, T ct=3 *std::numeric_limits< T >::epsilon())
 
template<typename T >
xtfloor (T x, T ct)
 

Function Documentation

◆ operator*() [1/2]

Range operator* ( const Range r,
double  x 
)

Definition at line 858 of file Range.cc.

◆ operator*() [2/2]

Range operator* ( double  x,
const Range r 
)

Definition at line 852 of file Range.cc.

◆ operator+() [1/2]

Range operator+ ( const Range r,
double  x 
)

Definition at line 834 of file Range.cc.

◆ operator+() [2/2]

Range operator+ ( double  x,
const Range r 
)

Definition at line 828 of file Range.cc.

◆ operator-() [1/3]

Range operator- ( const Range r)

Definition at line 822 of file Range.cc.

◆ operator-() [2/3]

Range operator- ( const Range r,
double  x 
)

Definition at line 846 of file Range.cc.

◆ operator-() [3/3]

Range operator- ( double  x,
const Range r 
)

Definition at line 840 of file Range.cc.

◆ operator<<()

std::ostream& operator<< ( std::ostream &  os,
const Range a 
)

Definition at line 781 of file Range.cc.

◆ operator>>()

std::istream& operator>> ( std::istream &  is,
Range a 
)

Definition at line 803 of file Range.cc.

◆ teq()

static bool teq ( double  u,
double  v,
double  ct = 3.0 * std::numeric_limits<double>::epsilon () 
)
inlinestatic

Definition at line 926 of file Range.cc.

References abs().

Referenced by Range::numel_internal().

◆ tfloor()

static double tfloor ( double  x,
double  ct 
)
inlinestatic

Definition at line 896 of file Range.cc.

References floor(), and x.

Referenced by Range::numel_internal().

◆ xall_elements_are_ints()

template<typename T >
bool xall_elements_are_ints ( base,
inc,
final_val,
octave_idx_type  nel 
)

Definition at line 136 of file Range.cc.

References isnan(), and nint_big().

Referenced by xfinal_value().

◆ xfinal_value()

template<typename T >
T xfinal_value ( base,
limit,
inc,
octave_idx_type  nel 
)

Definition at line 158 of file Range.cc.

References round(), and xall_elements_are_ints().

Referenced by xinit().

◆ xinit() [1/2]

template<typename T >
void xinit ( const octave_int< T > &  base,
const octave_int< T > &  limit,
const octave_int< T > &  inc,
bool  reverse,
octave_int< T > &  final_val,
octave_idx_type nel 
)

Definition at line 262 of file Range.cc.

References octave_int< T >::value().

◆ xinit() [2/2]

template<typename T >
void xinit ( base,
limit,
inc,
bool  reverse,
T &  final_val,
octave_idx_type nel 
)

Definition at line 195 of file Range.cc.

References isinf(), isnan(), max(), NaN, xfinal_value(), and xnumel_internal().

◆ xis_storable()

template<typename T >
bool xis_storable ( base,
limit,
octave_idx_type  nel 
)

Definition at line 298 of file Range.cc.

References isinf().

◆ xnnz()

template<typename T >
octave_idx_type xnnz ( base,
limit,
inc,
final_val,
octave_idx_type  nel 
)

Definition at line 409 of file Range.cc.

References mod().

◆ xnumel_internal()

template<typename T >
octave_idx_type xnumel_internal ( base,
limit,
inc 
)

Definition at line 84 of file Range.cc.

References isfinite(), isinf(), isnan(), max(), xteq(), and xtfloor().

Referenced by xinit().

◆ xteq()

template<typename T >
bool xteq ( u,
v,
ct = 3 * std::numeric_limits<T>::epsilon () 
)

Definition at line 75 of file Range.cc.

References abs().

Referenced by xnumel_internal().

◆ xtfloor()

template<typename T >
T xtfloor ( x,
ct 
)

Definition at line 45 of file Range.cc.

References floor(), and x.

Referenced by xnumel_internal().