GNU Octave 7.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
octave::idx_vector Class Reference

#include "idx-vector.h"

Collaboration diagram for octave::idx_vector:

Classes

class  idx_base_rep
 
class  idx_colon_rep
 
class  idx_mask_rep
 
class  idx_range_rep
 
class  idx_scalar_rep
 
class  idx_vector_rep
 

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 (bool x)
 
 idx_vector (char c)
 
OCTAVE_API 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 (void)
 
 ~idx_vector (void)
 
OCTAVE_API Array< octave_idx_typeas_array (void) 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
 
OCTAVE_API idx_vector complement (octave_idx_type n) const
 
OCTAVE_API 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_API octave_idx_type freeze (octave_idx_type z_len, const char *tag, bool resize_ok=false)
 
idx_class_type idx_class (void) const
 
OCTAVE_API octave_idx_type increment (void) const
 
template<typename T >
octave_idx_type index (const T *src, octave_idx_type n, T *dest) const
 
OCTAVE_API idx_vector inverse_permutation (octave_idx_type n) const
 
bool is_colon (void) const
 
bool is_colon_equiv (octave_idx_type n) const
 
bool is_colon_equiv (octave_idx_type n, int) const
 
OCTAVE_API bool is_cont_range (octave_idx_type n, octave_idx_type &l, octave_idx_type &u) const
 
OCTAVE_API bool is_permutation (octave_idx_type n) const
 
bool is_range (void) const
 
bool is_scalar (void) const
 
OCTAVE_API bool isvector (void) 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 (void) const
 
OCTAVE_API bool maybe_reduce (octave_idx_type n, const idx_vector &j, octave_idx_type nj)
 
OCTAVE_API octave_idx_type ones_count (void) const
 
 operator bool (void) const
 
octave_idx_type operator() (octave_idx_type n) const
 
idx_vectoroperator= (const idx_vector &a)
 
octave_idx_type orig_columns (void) const
 
dim_vector orig_dimensions (void) const
 
int orig_empty (void) const
 
octave_idx_type orig_rows (void) const
 
std::ostream & print (std::ostream &os) const
 
const OCTAVE_API octave_idx_typeraw (void)
 
void sort (bool uniq=false)
 
idx_vector sorted (Array< octave_idx_type > &sidx) const
 
idx_vector sorted (bool uniq=false) const
 
OCTAVE_API void unconvert (idx_class_type &iclass, double &scalar, range< double > &range, Array< double > &array, Array< bool > &mask) const
 
OCTAVE_API idx_vector unmask (void) 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
 

Private Types

enum  direct { DIRECT }
 

Private Member Functions

 idx_vector (idx_base_rep *r)
 

Static Private Member Functions

static OCTAVE_API idx_vector_repnil_rep (void)
 

Private Attributes

idx_base_repm_rep
 

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

◆ direct

Enumerator
DIRECT 

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

◆ idx_class_type

Enumerator
class_invalid 
class_colon 
class_range 
class_scalar 
class_vector 
class_mask 

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

Constructor & Destructor Documentation

◆ idx_vector() [1/18]

octave::idx_vector::idx_vector ( idx_base_rep r)
inlineprivate

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

◆ idx_vector() [2/18]

octave::idx_vector::idx_vector ( void  )
inline

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

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

◆ idx_vector() [3/18]

octave::idx_vector::idx_vector ( octave_idx_type  i)
inline

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

◆ idx_vector() [4/18]

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

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

◆ idx_vector() [5/18]

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

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

◆ idx_vector() [6/18]

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

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

◆ idx_vector() [7/18]

octave::idx_vector::idx_vector ( char  c)
inline

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

◆ idx_vector() [8/18]

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

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

◆ idx_vector() [9/18]

octave::idx_vector::idx_vector ( double  x)
inline

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

◆ idx_vector() [10/18]

octave::idx_vector::idx_vector ( float  x)
inline

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

◆ idx_vector() [11/18]

octave::idx_vector::idx_vector ( bool  x)
inline

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

◆ idx_vector() [12/18]

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

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

◆ idx_vector() [13/18]

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

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

◆ idx_vector() [14/18]

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

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

◆ idx_vector() [15/18]

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

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

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

◆ idx_vector() [16/18]

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

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

◆ idx_vector() [17/18]

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

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

◆ idx_vector() [18/18]

octave::idx_vector::idx_vector ( const idx_vector a)
inline

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

◆ ~idx_vector()

octave::idx_vector::~idx_vector ( void  )
inline

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

Member Function Documentation

◆ as_array()

◆ assign()

◆ bloop()

◆ checkelem()

octave_idx_type octave::idx_vector::checkelem ( octave_idx_type  n) const
inline

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

Referenced by octave_lazy_index::fast_elem_extract().

◆ complement()

◆ copy_data()

◆ elem()

octave_idx_type octave::idx_vector::elem ( octave_idx_type  n) const
inline

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

Referenced by increment().

◆ extent()

◆ fill()

◆ freeze()

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

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

References extent(), and length().

◆ idx_class()

idx_class_type octave::idx_vector::idx_class ( void  ) const
inline

◆ increment()

◆ index()

◆ inverse_permutation()

◆ is_colon()

◆ is_colon_equiv() [1/2]

◆ is_colon_equiv() [2/2]

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

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

◆ is_cont_range()

◆ is_permutation()

◆ is_range()

bool octave::idx_vector::is_range ( void  ) const
inline

◆ is_scalar()

◆ isvector()

bool octave::idx_vector::isvector ( void  ) const

◆ length()

◆ loop()

◆ make_range()

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

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

References len.

Referenced by octave::opengl_renderer::get_pixels(), and sub2ind().

◆ max()

octave_idx_type octave::idx_vector::max ( void  ) const
inline

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

Referenced by octave::idx_vector::idx_vector_rep::idx_vector_rep().

◆ maybe_reduce()

◆ nil_rep()

idx_vector::idx_vector_rep * octave::idx_vector::nil_rep ( void  )
staticprivate

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

◆ ones_count()

octave_idx_type octave::idx_vector::ones_count ( void  ) const

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

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

◆ operator bool()

octave::idx_vector::operator bool ( void  ) const
inline

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

◆ operator()()

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

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

◆ operator=()

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

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

References octave::idx_vector::idx_base_rep::m_count, and m_rep.

◆ orig_columns()

octave_idx_type octave::idx_vector::orig_columns ( void  ) const
inline

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

◆ orig_dimensions()

◆ orig_empty()

int octave::idx_vector::orig_empty ( void  ) const
inline

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

◆ orig_rows()

octave_idx_type octave::idx_vector::orig_rows ( void  ) const
inline

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

◆ print()

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

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

◆ raw()

◆ sort()

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

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

◆ sorted() [1/2]

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

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

◆ sorted() [2/2]

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

◆ unconvert()

◆ unmask()

◆ xelem()

octave_idx_type octave::idx_vector::xelem ( octave_idx_type  n) const
inline

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

Referenced by Array< T, Alloc >::assign(), is_permutation(), and ones_count().

Friends And Related Function Documentation

◆ operator<<

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

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

◆ std::unique_ptr

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

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

Member Data Documentation

◆ colon

◆ m_rep


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