Public Member Functions | Private Member Functions | Private Attributes | Friends

Range Class Reference

#include "Range.h"

Collaboration diagram for Range:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Range (void)
 Range (const Range &r)
 Range (double b, double l, double i)
 Range (double b, double i, octave_idx_type n)
 Range (double b, double l)
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 (Array< octave_idx_type > &sidx, octave_idx_type dim=0, sortmode mode=ASCENDING) const
Range sort (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+ (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 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 
)

Definition at line 39 of file Range.cc.

References rng_nelem, and 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 85 of file Range.cc.

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

void Range::clear_cache ( void   )  const [inline, private]

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

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

Referenced by octave_range::diag().

double Range::elem ( octave_idx_type  i  )  const [inline]

Definition at line 83 of file Range.h.

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

References rng_base, rng_inc, rng_limit, and rng_nelem.

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

double Range::min ( void   )  const

Definition at line 137 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 468 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 94 of file Range.h.

void Range::set_inc ( double  i  )  [inline]

Definition at line 112 of file Range.h.

void Range::set_limit ( double  l  )  [inline]

Definition at line 103 of file Range.h.

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

Definition at line 263 of file Range.cc.

References ASCENDING, DESCENDING, and sort_internal().

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

Definition at line 245 of file Range.cc.

References ASCENDING, DESCENDING, and sort_internal().

void Range::sort_internal ( bool  ascending = true  ) 

Definition at line 180 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 371 of file Range.cc.

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

Definition at line 380 of file Range.cc.

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

Definition at line 344 of file Range.cc.

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

Definition at line 335 of file Range.cc.

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

Definition at line 362 of file Range.cc.

OCTAVE_API Range operator- ( const Range r  )  [friend]

Definition at line 330 of file Range.cc.

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

Definition at line 353 of file Range.cc.

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

Definition at line 295 of file Range.cc.

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

Definition at line 313 of file Range.cc.


Member Data Documentation

Matrix Range::cache [mutable, private]

Definition at line 142 of file Range.h.

Referenced by matrix_value().

Definition at line 137 of file Range.h.

Referenced by matrix_value(), max(), min(), nelem_internal(), operator>>(), and sort_internal().


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines