GNU Octave 10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
idx_vector Class Reference

#include "idx-vector.h"

Public Types

enum  idx_class_type {
  class_invalid = -1 , class_colon = 0 , class_range , class_scalar ,
  class_vector , class_mask
}
 

Public Member Functions

 idx_vector ()
 
 idx_vector (bool x)
 
 idx_vector (char c)
 
 idx_vector (const Array< bool > &nda)
 
 idx_vector (const Array< double > &nda)
 
 idx_vector (const Array< float > &nda)
 
 idx_vector (const Array< octave_idx_type > &inda)
 
 idx_vector (const Array< octave_idx_type > &inda, octave_idx_type ext)
 
template<typename T >
 idx_vector (const Array< octave_int< T > > &nda)
 
 idx_vector (const idx_vector &a)
 
 idx_vector (const range< double > &r)
 
 idx_vector (const Sparse< bool > &nda)
 
 idx_vector (double x)
 
 idx_vector (float x)
 
 idx_vector (octave_idx_type i)
 
 idx_vector (octave_idx_type start, octave_idx_type limit, octave_idx_type step=1)
 
template<typename T >
 idx_vector (octave_int< T > x)
 
 ~idx_vector ()
 
Array< octave_idx_typeas_array () const
 
template<typename T >
octave_idx_type assign (const T *src, octave_idx_type n, T *dest) const
 
template<typename Functor >
octave_idx_type bloop (octave_idx_type n, Functor body) const
 
octave_idx_type checkelem (octave_idx_type n) const
 
idx_vector complement (octave_idx_type n) const
 
void copy_data (octave_idx_type *data) const
 
octave_idx_type elem (octave_idx_type n) const
 
octave_idx_type extent (octave_idx_type n) const
 
template<typename T >
octave_idx_type fill (const T &val, octave_idx_type n, T *dest) const
 
octave_idx_type freeze (octave_idx_type z_len, const char *tag, bool resize_ok=false)
 
idx_class_type idx_class () const
 
octave_idx_type increment () const
 
template<typename T >
octave_idx_type index (const T *src, octave_idx_type n, T *dest) const
 
idx_vector inverse_permutation (octave_idx_type n) const
 
bool is_colon () const
 
bool is_colon_equiv (octave_idx_type n) const
 
bool is_colon_equiv (octave_idx_type n, int) const
 
bool is_cont_range (octave_idx_type n, octave_idx_type &l, octave_idx_type &u) const
 
bool is_permutation (octave_idx_type n) const
 
bool is_range () const
 
bool is_scalar () const
 
bool isvector () const
 
octave_idx_type length (octave_idx_type n=0) const
 
template<typename Functor >
void loop (octave_idx_type n, Functor body) const
 
octave_idx_type max () const
 
bool maybe_reduce (octave_idx_type n, const idx_vector &j, octave_idx_type nj)
 
octave_idx_type ones_count () const
 
 operator bool () const
 
octave_idx_type operator() (octave_idx_type n) const
 
idx_vectoroperator= (const idx_vector &a)
 
octave_idx_type orig_columns () const
 
dim_vector orig_dimensions () const
 
int orig_empty () const
 
octave_idx_type orig_rows () const
 
std::ostream & print (std::ostream &os) const
 
const octave_idx_typeraw ()
 
void sort (bool uniq=false)
 
idx_vector sorted (Array< octave_idx_type > &sidx) const
 
idx_vector sorted (bool uniq=false) const
 
void unconvert (idx_class_type &iclass, double &scalar, range< double > &range, Array< double > &array, Array< bool > &mask) const
 
idx_vector unmask () const
 
octave_idx_type xelem (octave_idx_type n) const
 

Static Public Member Functions

static idx_vector make_range (octave_idx_type start, octave_idx_type step, octave_idx_type len)
 

Static Public Attributes

static const idx_vector colon
 

Friends

std::ostream & operator<< (std::ostream &os, const idx_vector &a)
 
template<typename T , typename D >
class std::unique_ptr
 

Detailed Description

Definition at line 57 of file idx-vector.h.

Member Enumeration Documentation

◆ idx_class_type

enum idx_vector::idx_class_type
Enumerator
class_invalid 
class_colon 
class_range 
class_scalar 
class_vector 
class_mask 

Definition at line 61 of file idx-vector.h.

Constructor & Destructor Documentation

◆ idx_vector() [1/17]

idx_vector::idx_vector ( )
inline

Definition at line 429 of file idx-vector.h.

Referenced by complement(), maybe_reduce(), and raw().

◆ idx_vector() [2/17]

idx_vector::idx_vector ( octave_idx_type  i)
inline

Definition at line 432 of file idx-vector.h.

◆ idx_vector() [3/17]

idx_vector::idx_vector ( octave_idx_type  start,
octave_idx_type  limit,
octave_idx_type  step = 1 
)
inline

Definition at line 445 of file idx-vector.h.

◆ idx_vector() [4/17]

idx_vector::idx_vector ( const Array< octave_idx_type > &  inda)
inline

Definition at line 456 of file idx-vector.h.

◆ idx_vector() [5/17]

idx_vector::idx_vector ( const Array< octave_idx_type > &  inda,
octave_idx_type  ext 
)
inline

Definition at line 460 of file idx-vector.h.

◆ idx_vector() [6/17]

idx_vector::idx_vector ( char  c)
inline

Definition at line 467 of file idx-vector.h.

◆ idx_vector() [7/17]

template<typename T >
idx_vector::idx_vector ( octave_int< T >  x)
inline

Definition at line 472 of file idx-vector.h.

◆ idx_vector() [8/17]

idx_vector::idx_vector ( double  x)
inline

Definition at line 474 of file idx-vector.h.

◆ idx_vector() [9/17]

idx_vector::idx_vector ( float  x)
inline

Definition at line 476 of file idx-vector.h.

◆ idx_vector() [10/17]

idx_vector::idx_vector ( bool  x)
inline

Definition at line 479 of file idx-vector.h.

◆ idx_vector() [11/17]

template<typename T >
idx_vector::idx_vector ( const Array< octave_int< T > > &  nda)
inline

Definition at line 482 of file idx-vector.h.

◆ idx_vector() [12/17]

idx_vector::idx_vector ( const Array< double > &  nda)
inline

Definition at line 485 of file idx-vector.h.

◆ idx_vector() [13/17]

idx_vector::idx_vector ( const Array< float > &  nda)
inline

Definition at line 487 of file idx-vector.h.

◆ idx_vector() [14/17]

idx_vector::idx_vector ( const Array< bool > &  nda)

Definition at line 760 of file idx-vector.cc.

References Array< T, Alloc >::nnz(), and Array< T, Alloc >::numel().

◆ idx_vector() [15/17]

idx_vector::idx_vector ( const range< double > &  r)
inline

Definition at line 491 of file idx-vector.h.

◆ idx_vector() [16/17]

idx_vector::idx_vector ( const Sparse< bool > &  nda)
inline

Definition at line 493 of file idx-vector.h.

◆ idx_vector() [17/17]

idx_vector::idx_vector ( const idx_vector a)
inline

Definition at line 495 of file idx-vector.h.

◆ ~idx_vector()

idx_vector::~idx_vector ( )
inline

Definition at line 497 of file idx-vector.h.

Member Function Documentation

◆ as_array()

Array< octave_idx_type > idx_vector::as_array ( ) const

Definition at line 1269 of file idx-vector.cc.

References as_array().

Referenced by as_array(), and raw().

◆ assign()

template<typename T >
octave_idx_type idx_vector::assign ( const T *  src,
octave_idx_type  n,
T *  dest 
) const
inline

Definition at line 663 of file idx-vector.h.

References len.

◆ bloop()

template<typename Functor >
octave_idx_type idx_vector::bloop ( octave_idx_type  n,
Functor  body 
) const
inline

Definition at line 888 of file idx-vector.h.

References len.

◆ checkelem()

octave_idx_type idx_vector::checkelem ( octave_idx_type  n) const
inline

Definition at line 527 of file idx-vector.h.

◆ complement()

idx_vector idx_vector::complement ( octave_idx_type  n) const

◆ copy_data()

void idx_vector::copy_data ( octave_idx_type data) const

Definition at line 1039 of file idx-vector.cc.

References class_colon, class_invalid, class_mask, class_range, class_scalar, class_vector, and copy_data().

Referenced by copy_data().

◆ elem()

octave_idx_type idx_vector::elem ( octave_idx_type  n) const
inline

Definition at line 1018 of file idx-vector.h.

Referenced by increment().

◆ extent()

◆ fill()

template<typename T >
octave_idx_type idx_vector::fill ( const T &  val,
octave_idx_type  n,
T *  dest 
) const
inline

Definition at line 740 of file idx-vector.h.

References len.

Referenced by complement().

◆ freeze()

octave_idx_type idx_vector::freeze ( octave_idx_type  z_len,
const char *  tag,
bool  resize_ok = false 
)

Definition at line 1281 of file idx-vector.cc.

References extent(), freeze(), and length().

Referenced by freeze().

◆ idx_class()

idx_class_type idx_vector::idx_class ( ) const
inline

Definition at line 516 of file idx-vector.h.

Referenced by complement(), inverse_permutation(), isvector(), maybe_reduce(), unconvert(), and unmask().

◆ increment()

octave_idx_type idx_vector::increment ( ) const

Definition at line 996 of file idx-vector.cc.

References class_colon, class_mask, class_range, class_vector, elem(), increment(), and length().

Referenced by increment(), and inverse_permutation().

◆ index()

template<typename T >
octave_idx_type idx_vector::index ( const T *  src,
octave_idx_type  n,
T *  dest 
) const
inline

Definition at line 584 of file idx-vector.h.

References len.

◆ inverse_permutation()

◆ is_colon()

bool idx_vector::is_colon ( ) const
inline

◆ is_colon_equiv() [1/2]

bool idx_vector::is_colon_equiv ( octave_idx_type  n) const
inline

Definition at line 547 of file idx-vector.h.

Referenced by is_permutation(), and maybe_reduce().

◆ is_colon_equiv() [2/2]

bool idx_vector::is_colon_equiv ( octave_idx_type  n,
int   
) const
inline

Definition at line 1021 of file idx-vector.h.

◆ is_cont_range()

bool idx_vector::is_cont_range ( octave_idx_type  n,
octave_idx_type l,
octave_idx_type u 
) const

Definition at line 942 of file idx-vector.cc.

References class_colon, class_mask, class_range, class_scalar, and is_cont_range().

Referenced by is_cont_range().

◆ is_permutation()

bool idx_vector::is_permutation ( octave_idx_type  n) const

◆ is_range()

bool idx_vector::is_range ( ) const
inline

Definition at line 544 of file idx-vector.h.

◆ is_scalar()

bool idx_vector::is_scalar ( ) const
inline

Definition at line 541 of file idx-vector.h.

◆ isvector()

bool idx_vector::isvector ( ) const

Definition at line 1275 of file idx-vector.cc.

References class_vector, idx_class(), dim_vector::isvector(), isvector(), and orig_dimensions().

Referenced by isvector().

◆ length()

◆ loop()

template<typename Functor >
void idx_vector::loop ( octave_idx_type  n,
Functor  body 
) const
inline

◆ make_range()

static idx_vector idx_vector::make_range ( octave_idx_type  start,
octave_idx_type  step,
octave_idx_type  len 
)
inlinestatic

Definition at line 450 of file idx-vector.h.

References len.

◆ max()

octave_idx_type idx_vector::max ( ) const
inline

Definition at line 1032 of file idx-vector.h.

◆ maybe_reduce()

bool idx_vector::maybe_reduce ( octave_idx_type  n,
const idx_vector j,
octave_idx_type  nj 
)

◆ ones_count()

octave_idx_type idx_vector::ones_count ( ) const

Definition at line 1291 of file idx-vector.cc.

References is_colon(), length(), ones_count(), and xelem().

Referenced by ones_count().

◆ operator bool()

idx_vector::operator bool ( ) const
inline

Definition at line 536 of file idx-vector.h.

◆ operator()()

octave_idx_type idx_vector::operator() ( octave_idx_type  n) const
inline

Definition at line 530 of file idx-vector.h.

◆ operator=()

idx_vector & idx_vector::operator= ( const idx_vector a)
inline

Definition at line 503 of file idx-vector.h.

◆ orig_columns()

octave_idx_type idx_vector::orig_columns ( ) const
inline

Definition at line 561 of file idx-vector.h.

◆ orig_dimensions()

dim_vector idx_vector::orig_dimensions ( ) const
inline

◆ orig_empty()

int idx_vector::orig_empty ( ) const
inline

Definition at line 564 of file idx-vector.h.

◆ orig_rows()

octave_idx_type idx_vector::orig_rows ( ) const
inline

Definition at line 558 of file idx-vector.h.

◆ print()

std::ostream & idx_vector::print ( std::ostream &  os) const
inline

Definition at line 569 of file idx-vector.h.

◆ raw()

const octave_idx_type * idx_vector::raw ( )

Definition at line 1026 of file idx-vector.cc.

References idx_vector(), as_array(), class_vector, extent(), liboctave_panic_unless, and raw().

Referenced by raw().

◆ sort()

void idx_vector::sort ( bool  uniq = false)
inline

Definition at line 1027 of file idx-vector.h.

◆ sorted() [1/2]

idx_vector idx_vector::sorted ( Array< octave_idx_type > &  sidx) const
inline

Definition at line 553 of file idx-vector.h.

◆ sorted() [2/2]

idx_vector idx_vector::sorted ( bool  uniq = false) const
inline

Definition at line 550 of file idx-vector.h.

Referenced by inverse_permutation().

◆ unconvert()

void idx_vector::unconvert ( idx_class_type iclass,
double scalar,
range< double > &  range,
Array< double > &  array,
Array< bool > &  mask 
) const

◆ unmask()

idx_vector idx_vector::unmask ( ) const

Definition at line 1196 of file idx-vector.cc.

References class_mask, idx_class(), and unmask().

Referenced by unmask().

◆ xelem()

octave_idx_type idx_vector::xelem ( octave_idx_type  n) const
inline

Definition at line 524 of file idx-vector.h.

Referenced by is_permutation(), and ones_count().

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const idx_vector a 
)
friend

Definition at line 571 of file idx-vector.h.

◆ std::unique_ptr

template<typename T , typename D >
friend class std::unique_ptr
friend

Definition at line 71 of file idx-vector.h.

Member Data Documentation

◆ colon

const idx_vector idx_vector::colon
static

Definition at line 464 of file idx-vector.h.


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