GNU Octave  3.8.0
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 | 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
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
void print_range (void)
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)

Private Member Functions

void clear_cache (void) const
octave_idx_type nelem_internal (void) const

Private Attributes

Matrix cache
double rng_base
double rng_inc
double rng_limit
octave_idx_type rng_nelem

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 31 of file Range.h.

Constructor & Destructor Documentation

Range::Range ( void  )
inline

Definition at line 37 of file Range.h.

Range::Range ( const Range r)
inline

Definition at line 40 of file Range.h.

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

Definition at line 44 of file Range.h.

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

Definition at line 48 of file Range.h.

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

Definition at line 53 of file Range.h.

References xfinite().

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 84 of file Range.cc.

References gripe_index_out_of_range(), rng_base, rng_inc, rng_limit, and rng_nelem.

Referenced by elem().

void Range::clear_cache ( void  ) const
inlineprivate

Definition at line 146 of file Range.h.

References Matrix::resize().

Referenced by sort_internal().

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

Definition at line 294 of file Range.cc.

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

Referenced by octave_range::diag().

double Range::elem ( octave_idx_type  i) const

Definition at line 105 of file Range.cc.

References checkelem(), rng_base, rng_inc, rng_limit, and rng_nelem.

Referenced by octave_range::do_index_op().

double Range::inc ( void  ) const
inline
Array< double > Range::index ( const idx_vector i) const
sortmode Range::is_sorted ( sortmode  mode = ASCENDING) const

Definition at line 337 of file Range.cc.

References ASCENDING, DESCENDING, rng_inc, rng_nelem, and UNSORTED.

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

Definition at line 215 of file Range.cc.

References rng_base, rng_inc, rng_limit, and rng_nelem.

Referenced by calculate_region(), do_minmax_body(), and operator<<().

double Range::min ( void  ) const

Definition at line 194 of file Range.cc.

References rng_base, rng_inc, rng_limit, and rng_nelem.

Referenced by do_minmax_body(), operator<<(), and sort_internal().

octave_idx_type Range::nelem ( void  ) const
inline
octave_idx_type Range::nelem_internal ( void  ) const
private

Definition at line 527 of file Range.cc.

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

Referenced by operator>>().

void Range::print_range ( void  )
void Range::set_base ( double  b)
inline

Definition at line 93 of file Range.h.

void Range::set_inc ( double  i)
inline

Definition at line 111 of file Range.h.

void Range::set_limit ( double  l)
inline

Definition at line 102 of file Range.h.

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

Definition at line 300 of file Range.cc.

References ASCENDING, DESCENDING, and sort_internal().

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

Definition at line 318 of file Range.cc.

References ASCENDING, DESCENDING, and sort_internal().

void Range::sort_internal ( bool  ascending = true)

Definition at line 235 of file Range.cc.

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

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 429 of file Range.cc.

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

Definition at line 438 of file Range.cc.

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

Definition at line 393 of file Range.cc.

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

Definition at line 402 of file Range.cc.

OCTAVE_API Range operator- ( const Range r)
friend

Definition at line 388 of file Range.cc.

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

Definition at line 411 of file Range.cc.

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

Definition at line 420 of file Range.cc.

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

Definition at line 350 of file Range.cc.

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

Definition at line 371 of file Range.cc.

Member Data Documentation

Matrix Range::cache
mutableprivate

Definition at line 142 of file Range.h.

Referenced by matrix_value(), operator*(), operator+(), and operator-().

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

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