GNU Octave  4.4.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
Range Class Reference

#include "Range.h"

Collaboration diagram for Range:

Public Member Functions

 Range (void)
 
 Range (const Range &r)
 
 Range (double b, double l)
 
 Range (double b, double l, double i)
 
 Range (double b, double i, octave_idx_type n)
 
bool all_elements_are_ints (void) const
 
double base (void) const
 
double checkelem (octave_idx_type i) const
 
double checkelem (octave_idx_type i, octave_idx_type j) const
 
octave_idx_type cols (void) const
 
octave_idx_type columns (void) const
 
Matrix diag (octave_idx_type k=0) const
 
double elem (octave_idx_type i) const
 
double elem (octave_idx_type, octave_idx_type j) const
 
double inc (void) const
 
Array< doubleindex (const idx_vector &i) const
 
bool is_empty (void) const
 
sortmode is_sorted (sortmode mode=ASCENDING) const
 
bool isempty (void) const
 
sortmode issorted (sortmode mode=ASCENDING) const
 
double limit (void) const
 
Matrix matrix_value (void) const
 
double max (void) const
 
double min (void) const
 
octave_idx_type nelem (void) const
 
octave_idx_type nnz (void) const
 
octave_idx_type numel (void) const
 
double operator() (octave_idx_type i) const
 
double operator() (octave_idx_type i, octave_idx_type j) const
 
octave_idx_type rows (void) const
 
void set_base (double b)
 
void set_inc (double i)
 
void set_limit (double l)
 
Range sort (octave_idx_type dim=0, sortmode mode=ASCENDING) const
 
Range sort (Array< octave_idx_type > &sidx, octave_idx_type dim=0, sortmode mode=ASCENDING) const
 
void sort_internal (bool ascending=true)
 
void sort_internal (Array< octave_idx_type > &sidx, bool ascending=true)
 

Protected Member Functions

 Range (double b, double l, double i, octave_idx_type n)
 

Private Member Functions

void clear_cache (void) const
 
void init (void)
 
double limit_internal (void) const
 
octave_idx_type numel_internal (void) const
 

Private Attributes

Matrix cache
 
double rng_base
 
double rng_inc
 
double rng_limit
 
octave_idx_type rng_numel
 

Friends

OCTAVE_API Range operator* (double x, const Range &r)
 
OCTAVE_API Range operator* (const Range &r, double x)
 
OCTAVE_API Range operator+ (double x, const Range &r)
 
OCTAVE_API Range operator+ (const Range &r, double x)
 
OCTAVE_API Range operator- (const Range &r)
 
OCTAVE_API Range operator- (double x, const Range &r)
 
OCTAVE_API Range operator- (const Range &r, double x)
 
OCTAVE_API std::ostream & operator<< (std::ostream &os, const Range &r)
 
OCTAVE_API std::istream & operator>> (std::istream &is, Range &r)
 

Detailed Description

Definition at line 33 of file Range.h.

Constructor & Destructor Documentation

◆ Range() [1/6]

Range::Range ( void  )
inline

Definition at line 39 of file Range.h.

◆ Range() [2/6]

Range::Range ( const Range r)
inline

Definition at line 42 of file Range.h.

◆ Range() [3/6]

Range::Range ( double  b,
double  l 
)
inline

Definition at line 46 of file Range.h.

◆ Range() [4/6]

Range::Range ( double  b,
double  l,
double  i 
)
inline

Definition at line 53 of file Range.h.

◆ Range() [5/6]

Range::Range ( double  b,
double  i,
octave_idx_type  n 
)
inline

Definition at line 61 of file Range.h.

References b, i, and octave::math::isfinite().

◆ Range() [6/6]

Range::Range ( double  b,
double  l,
double  i,
octave_idx_type  n 
)
inlineprotected

Definition at line 177 of file Range.h.

References b, i, and octave::math::isfinite().

Member Function Documentation

◆ all_elements_are_ints()

◆ base()

◆ checkelem() [1/2]

double Range::checkelem ( octave_idx_type  i) const

Definition at line 106 of file Range.cc.

References octave::err_index_out_of_range(), i, rng_base, rng_inc, rng_limit, and rng_numel.

Referenced by checkelem().

◆ checkelem() [2/2]

double Range::checkelem ( octave_idx_type  i,
octave_idx_type  j 
) const

Definition at line 122 of file Range.cc.

References checkelem(), octave::err_index_out_of_range(), i, and rng_numel.

◆ clear_cache()

void Range::clear_cache ( void  ) const
inlineprivate

Definition at line 172 of file Range.h.

References Matrix::resize().

Referenced by init(), and sort_internal().

◆ cols()

octave_idx_type Range::cols ( void  ) const
inline

Definition at line 89 of file Range.h.

References numel().

◆ columns()

octave_idx_type Range::columns ( void  ) const
inline

Definition at line 90 of file Range.h.

References numel().

◆ diag()

Matrix Range::diag ( octave_idx_type  k = 0) const

Definition at line 290 of file Range.cc.

References Matrix::diag(), k, and matrix_value().

Referenced by octave_range::diag().

◆ elem() [1/2]

◆ elem() [2/2]

double Range::elem ( octave_idx_type  ,
octave_idx_type  j 
) const
inline

Definition at line 129 of file Range.h.

References elem.

◆ inc()

◆ index()

◆ init()

void Range::init ( void  )
private

◆ is_empty()

bool Range::is_empty ( void  ) const
inline

Definition at line 95 of file Range.h.

◆ is_sorted()

sortmode Range::is_sorted ( sortmode  mode = ASCENDING) const
inline

Definition at line 118 of file Range.h.

References mode.

◆ isempty()

bool Range::isempty ( void  ) const
inline

Definition at line 92 of file Range.h.

References numel().

Referenced by octave_range::is_true(), and nnz().

◆ issorted()

sortmode Range::issorted ( sortmode  mode = ASCENDING) const

Definition at line 333 of file Range.cc.

References ASCENDING, DESCENDING, mode, rng_inc, rng_numel, and UNSORTED.

◆ limit()

◆ limit_internal()

double Range::limit_internal ( void  ) const
private

Definition at line 597 of file Range.cc.

References max(), min(), rng_inc, and rng_limit.

Referenced by init().

◆ matrix_value()

◆ max()

double Range::max ( void  ) const

Definition at line 224 of file Range.cc.

References retval, rng_base, rng_inc, rng_limit, and rng_numel.

Referenced by image_region::image_region(), and limit_internal().

◆ min()

double Range::min ( void  ) const

Definition at line 203 of file Range.cc.

References retval, rng_base, rng_inc, rng_limit, and rng_numel.

Referenced by limit_internal().

◆ nelem()

octave_idx_type Range::nelem ( void  ) const
inline

Definition at line 83 of file Range.h.

References numel().

◆ nnz()

octave_idx_type Range::nnz ( void  ) const

Definition at line 51 of file Range.cc.

References octave::math::floor(), isempty(), retval, rng_base, rng_inc, rng_limit, and rng_numel.

◆ numel()

◆ numel_internal()

octave_idx_type Range::numel_internal ( void  ) const
private

Definition at line 551 of file Range.cc.

References max(), retval, rng_base, rng_inc, rng_limit, teq(), tfloor(), and tmp.

Referenced by init().

◆ operator()() [1/2]

double Range::operator() ( octave_idx_type  i) const
inline

Definition at line 132 of file Range.h.

References elem, and i.

◆ operator()() [2/2]

double Range::operator() ( octave_idx_type  i,
octave_idx_type  j 
) const
inline

Definition at line 133 of file Range.h.

References elem, and i.

◆ rows()

octave_idx_type Range::rows ( void  ) const
inline

Definition at line 87 of file Range.h.

◆ set_base()

void Range::set_base ( double  b)

Definition at line 346 of file Range.cc.

References b, init(), and rng_base.

◆ set_inc()

void Range::set_inc ( double  i)

Definition at line 368 of file Range.cc.

References i, init(), and rng_inc.

◆ set_limit()

void Range::set_limit ( double  l)

Definition at line 357 of file Range.cc.

References init(), and rng_limit.

◆ sort() [1/2]

Range Range::sort ( octave_idx_type  dim = 0,
sortmode  mode = ASCENDING 
) const

Definition at line 296 of file Range.cc.

References ASCENDING, DESCENDING, mode, and retval.

◆ sort() [2/2]

Range Range::sort ( Array< octave_idx_type > &  sidx,
octave_idx_type  dim = 0,
sortmode  mode = ASCENDING 
) const

Definition at line 314 of file Range.cc.

References ASCENDING, DESCENDING, mode, and retval.

◆ sort_internal() [1/2]

void Range::sort_internal ( bool  ascending = true)

Definition at line 250 of file Range.cc.

References clear_cache(), rng_base, rng_inc, rng_limit, and swap.

◆ sort_internal() [2/2]

void Range::sort_internal ( Array< octave_idx_type > &  sidx,
bool  ascending = true 
)

Friends And Related Function Documentation

◆ operator* [1/2]

OCTAVE_API Range operator* ( double  x,
const Range r 
)
friend

Definition at line 460 of file Range.cc.

◆ operator* [2/2]

OCTAVE_API Range operator* ( const Range r,
double  x 
)
friend

Definition at line 469 of file Range.cc.

◆ operator+ [1/2]

OCTAVE_API Range operator+ ( double  x,
const Range r 
)
friend

Definition at line 424 of file Range.cc.

◆ operator+ [2/2]

OCTAVE_API Range operator+ ( const Range r,
double  x 
)
friend

Definition at line 433 of file Range.cc.

◆ operator- [1/3]

OCTAVE_API Range operator- ( const Range r)
friend

Definition at line 419 of file Range.cc.

◆ operator- [2/3]

OCTAVE_API Range operator- ( double  x,
const Range r 
)
friend

Definition at line 442 of file Range.cc.

◆ operator- [3/3]

OCTAVE_API Range operator- ( const Range r,
double  x 
)
friend

Definition at line 451 of file Range.cc.

◆ operator<<

OCTAVE_API std::ostream& operator<< ( std::ostream &  os,
const Range r 
)
friend

Definition at line 379 of file Range.cc.

◆ operator>>

OCTAVE_API std::istream& operator>> ( std::istream &  is,
Range r 
)
friend

Definition at line 400 of file Range.cc.

Member Data Documentation

◆ cache

Matrix Range::cache
mutableprivate

Definition at line 164 of file Range.h.

Referenced by matrix_value().

◆ rng_base

double Range::rng_base
private

◆ rng_inc

◆ rng_limit

double Range::rng_limit
private

◆ rng_numel

octave_idx_type Range::rng_numel
private

Definition at line 162 of file Range.h.

Referenced by all_elements_are_ints(), checkelem(), elem(), index(), init(), issorted(), matrix_value(), max(), min(), and nnz().


The documentation for this class was generated from the following files: