GNU Octave  4.2.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
Range Class Reference

#include "Range.h"

Collaboration diagram for Range:
Collaboration graph
[legend]

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
 
Matrix diag (octave_idx_type k=0) const
 
double elem (octave_idx_type i) const
 
double inc (void) const
 
Array< doubleindex (const idx_vector &i) const
 
bool is_empty (void) const
 
sortmode is_sorted (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 numel (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::Range ( void  )
inline

Definition at line 39 of file Range.h.

Range::Range ( const Range r)
inline

Definition at line 42 of file Range.h.

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

Definition at line 46 of file Range.h.

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

Definition at line 53 of file Range.h.

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

Definition at line 61 of file Range.h.

References octave::math::finite().

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

Definition at line 155 of file Range.h.

References octave::math::finite().

Member Function Documentation

bool Range::all_elements_are_ints ( void  ) const
double Range::base ( void  ) const
inline
double Range::checkelem ( octave_idx_type  i) const

Definition at line 74 of file Range.cc.

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

Referenced by elem().

void Range::clear_cache ( void  ) const
inlineprivate

Definition at line 150 of file Range.h.

References Matrix::resize().

Referenced by init(), and sort_internal().

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

Definition at line 251 of file Range.cc.

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

Referenced by octave_range::diag().

double Range::elem ( octave_idx_type  i) const
double Range::inc ( void  ) const
inline
Array< double > Range::index ( const idx_vector i) const
void Range::init ( void  )
private
bool Range::is_empty ( void  ) const
inline

Definition at line 87 of file Range.h.

References numel().

Referenced by octave_range::is_true().

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

Definition at line 294 of file Range.cc.

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

double Range::limit ( void  ) const
inline
double Range::limit_internal ( void  ) const
private

Definition at line 564 of file Range.cc.

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

Referenced by init().

Matrix Range::matrix_value ( void  ) const
double Range::max ( void  ) const

Definition at line 185 of file Range.cc.

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

Referenced by calculate_region(), do_minmax_body(), and limit_internal().

double Range::min ( void  ) const

Definition at line 164 of file Range.cc.

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

Referenced by do_minmax_body(), and limit_internal().

octave_idx_type Range::nelem ( void  ) const
inline

Definition at line 83 of file Range.h.

References numel().

octave_idx_type Range::numel ( void  ) const
inline
octave_idx_type Range::numel_internal ( void  ) const
private

Definition at line 518 of file Range.cc.

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

Referenced by init().

void Range::set_base ( double  b)

Definition at line 307 of file Range.cc.

References b, init(), and rng_base.

void Range::set_inc ( double  i)

Definition at line 329 of file Range.cc.

References init(), and rng_inc.

void Range::set_limit ( double  l)

Definition at line 318 of file Range.cc.

References init(), and rng_limit.

Referenced by operator>>().

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

Definition at line 257 of file Range.cc.

References ASCENDING, DESCENDING, retval, and sort_internal().

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

Definition at line 275 of file Range.cc.

References ASCENDING, DESCENDING, retval, and sort_internal().

void Range::sort_internal ( bool  ascending = true)

Definition at line 211 of file Range.cc.

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

Referenced by sort().

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

Friends And Related Function Documentation

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

Definition at line 421 of file Range.cc.

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

Definition at line 430 of file Range.cc.

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

Definition at line 385 of file Range.cc.

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

Definition at line 394 of file Range.cc.

OCTAVE_API Range operator- ( const Range r)
friend

Definition at line 380 of file Range.cc.

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

Definition at line 403 of file Range.cc.

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

Definition at line 412 of file Range.cc.

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

Definition at line 340 of file Range.cc.

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

Definition at line 361 of file Range.cc.

Member Data Documentation

Matrix Range::cache
mutableprivate

Definition at line 142 of file Range.h.

Referenced by matrix_value().

double Range::rng_base
private
double Range::rng_inc
private
double Range::rng_limit
private
octave_idx_type Range::rng_numel
private

Definition at line 140 of file Range.h.

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


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