GNU Octave  8.1.0
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 (const octave::range< double > &r)
 
 Range (const Range &r)=default
 
 Range (double b, double i, octave_idx_type n)
 
 Range (double b, double l)
 
 Range (double b, double l, double i)
 
 Range (void)
 
 ~Range (void)=default
 
OCTAVE_API bool all_elements_are_ints (void) const
 
double base (void) const
 
OCTAVE_API double checkelem (octave_idx_type i) const
 
OCTAVE_API double checkelem (octave_idx_type i, octave_idx_type j) const
 
octave_idx_type cols (void) const
 
octave_idx_type columns (void) const
 
OCTAVE_API Matrix diag (octave_idx_type k=0) const
 
dim_vector dims (void) const
 
OCTAVE_API double elem (octave_idx_type i) const
 
double elem (octave_idx_type, octave_idx_type j) const
 
double final_value (void) const
 
double inc (void) const
 
double increment (void) const
 
OCTAVE_API Array< double > index (const octave::idx_vector &i) const
 
bool isempty (void) const
 
OCTAVE_API sortmode issorted (sortmode mode=ASCENDING) const
 
double limit (void) const
 
OCTAVE_API Matrix matrix_value (void) const
 
OCTAVE_API double max (void) const
 
OCTAVE_API double min (void) const
 
OCTAVE_API octave_idx_type nnz (void) const
 
octave_idx_type numel (void) const
 
bool ok (void) const
 
double operator() (octave_idx_type i) const
 
double operator() (octave_idx_type i, octave_idx_type j) const
 
Rangeoperator= (const Range &r)=default
 
octave_idx_type rows (void) const
 
OCTAVE_API void set_base (double b)
 
OCTAVE_API void set_inc (double i)
 
OCTAVE_API void set_limit (double l)
 
OCTAVE_API Range sort (Array< octave_idx_type > &sidx, octave_idx_type dim=0, sortmode mode=ASCENDING) const
 
OCTAVE_API Range sort (octave_idx_type dim=0, sortmode mode=ASCENDING) const
 
OCTAVE_API void sort_internal (Array< octave_idx_type > &sidx, bool ascending=true)
 
OCTAVE_API void sort_internal (bool ascending=true)
 

Protected Member Functions

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

Private Member Functions

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

Private Attributes

double m_base
 
double m_inc
 
double m_limit
 
octave_idx_type m_numel
 

Friends

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+ (double x, const Range &r)
 
OCTAVE_API Range operator- (const Range &r)
 
OCTAVE_API Range operator- (const Range &r, double x)
 
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 399 of file Range.h.

Constructor & Destructor Documentation

◆ Range() [1/7]

Range::Range ( void  )
inline

Definition at line 405 of file Range.h.

◆ Range() [2/7]

Range::Range ( const octave::range< double > &  r)
inline

Definition at line 415 of file Range.h.

◆ Range() [3/7]

Range::Range ( const Range r)
default

◆ ~Range()

Range::~Range ( void  )
default

◆ Range() [4/7]

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

Definition at line 427 of file Range.h.

References isinf().

◆ Range() [5/7]

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

Definition at line 435 of file Range.h.

References isinf().

◆ Range() [6/7]

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

Definition at line 449 of file Range.h.

References isinf().

◆ Range() [7/7]

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

Definition at line 561 of file Range.h.

Member Function Documentation

◆ all_elements_are_ints()

bool Range::all_elements_are_ints ( void  ) const

Definition at line 458 of file Range.cc.

References isnan(), m_base, m_inc, m_numel, and nint_big().

Referenced by limit_internal().

◆ base()

double Range::base ( void  ) const
inline

Definition at line 463 of file Range.h.

Referenced by octave_legacy_range::try_narrowing_conversion().

◆ checkelem() [1/2]

double Range::checkelem ( octave_idx_type  i) const

Definition at line 527 of file Range.cc.

References dims(), err_index_out_of_range(), m_base, m_inc, m_limit, and m_numel.

Referenced by checkelem().

◆ checkelem() [2/2]

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

Definition at line 541 of file Range.cc.

References checkelem(), dims(), err_index_out_of_range(), and m_numel.

◆ cols()

octave_idx_type Range::cols ( void  ) const
inline

Definition at line 483 of file Range.h.

References numel().

◆ columns()

octave_idx_type Range::columns ( void  ) const
inline

Definition at line 484 of file Range.h.

References numel().

◆ diag()

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

Definition at line 693 of file Range.cc.

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

◆ dims()

dim_vector Range::dims ( void  ) const
inline

Definition at line 479 of file Range.h.

Referenced by checkelem(), and index().

◆ elem() [1/2]

double Range::elem ( octave_idx_type  i) const

Definition at line 551 of file Range.cc.

References m_base, m_inc, m_limit, and m_numel.

◆ elem() [2/2]

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

Definition at line 514 of file Range.h.

References elem.

◆ final_value()

double Range::final_value ( void  ) const
inline

Definition at line 475 of file Range.h.

◆ inc()

double Range::inc ( void  ) const
inline

Definition at line 465 of file Range.h.

◆ increment()

double Range::increment ( void  ) const
inline

Definition at line 466 of file Range.h.

Referenced by matrix_value(), and octave_legacy_range::try_narrowing_conversion().

◆ index()

◆ init()

void Range::init ( void  )
private

Definition at line 999 of file Range.cc.

References isinf(), limit_internal(), m_limit, m_numel, and numel_internal().

Referenced by set_base(), set_inc(), and set_limit().

◆ isempty()

bool Range::isempty ( void  ) const
inline

Definition at line 486 of file Range.h.

References numel().

Referenced by nnz().

◆ issorted()

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

Definition at line 736 of file Range.cc.

References ASCENDING, DESCENDING, m_inc, m_numel, and UNSORTED.

◆ limit()

double Range::limit ( void  ) const
inline

Definition at line 464 of file Range.h.

Referenced by octave_legacy_range::try_narrowing_conversion().

◆ limit_internal()

double Range::limit_internal ( void  ) const
private

Definition at line 987 of file Range.cc.

References all_elements_are_ints(), m_inc, max(), min(), and round().

Referenced by init().

◆ matrix_value()

Matrix Range::matrix_value ( void  ) const

◆ max()

double Range::max ( void  ) const

Definition at line 630 of file Range.cc.

References m_base, m_inc, m_limit, and m_numel.

Referenced by limit_internal().

◆ min()

double Range::min ( void  ) const

Definition at line 609 of file Range.cc.

References m_base, m_inc, m_limit, and m_numel.

Referenced by limit_internal().

◆ nnz()

octave_idx_type Range::nnz ( void  ) const

Definition at line 470 of file Range.cc.

References floor(), isempty(), m_base, m_inc, m_limit, and m_numel.

◆ numel()

octave_idx_type Range::numel ( void  ) const
inline

◆ numel_internal()

octave_idx_type Range::numel_internal ( void  ) const
private

Definition at line 936 of file Range.cc.

References isfinite(), isinf(), isnan(), m_base, m_inc, m_limit, max(), teq(), and tfloor().

Referenced by init().

◆ ok()

bool Range::ok ( void  ) const
inline

Definition at line 457 of file Range.h.

References isfinite().

◆ operator()() [1/2]

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

Definition at line 517 of file Range.h.

References elem.

◆ operator()() [2/2]

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

Definition at line 518 of file Range.h.

References elem.

◆ operator=()

Range& Range::operator= ( const Range r)
default

◆ rows()

octave_idx_type Range::rows ( void  ) const
inline

Definition at line 481 of file Range.h.

◆ set_base()

void Range::set_base ( double  b)

Definition at line 749 of file Range.cc.

References init(), and m_base.

◆ set_inc()

void Range::set_inc ( double  i)

Definition at line 771 of file Range.cc.

References init(), and m_inc.

◆ set_limit()

void Range::set_limit ( double  l)

Definition at line 760 of file Range.cc.

References init(), and m_limit.

◆ sort() [1/2]

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

Definition at line 717 of file Range.cc.

References ASCENDING, DESCENDING, and sort_internal().

◆ sort() [2/2]

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

Definition at line 699 of file Range.cc.

References ASCENDING, DESCENDING, and sort_internal().

◆ sort_internal() [1/2]

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

◆ sort_internal() [2/2]

void Range::sort_internal ( bool  ascending = true)

Definition at line 656 of file Range.cc.

References m_base, m_inc, and m_limit.

Referenced by sort().

Friends And Related Function Documentation

◆ operator* [1/2]

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

Definition at line 858 of file Range.cc.

◆ operator* [2/2]

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

Definition at line 852 of file Range.cc.

◆ operator+ [1/2]

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

Definition at line 834 of file Range.cc.

◆ operator+ [2/2]

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

Definition at line 828 of file Range.cc.

◆ operator- [1/3]

OCTAVE_API Range operator- ( const Range r)
friend

Definition at line 822 of file Range.cc.

◆ operator- [2/3]

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

Definition at line 846 of file Range.cc.

◆ operator- [3/3]

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

Definition at line 840 of file Range.cc.

◆ operator<<

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

Definition at line 781 of file Range.cc.

◆ operator>>

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

Definition at line 803 of file Range.cc.

Member Data Documentation

◆ m_base

double Range::m_base
private

◆ m_inc

double Range::m_inc
private

◆ m_limit

double Range::m_limit
private

◆ m_numel

octave_idx_type Range::m_numel
private

Definition at line 547 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: