GNU Octave  6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
Sparse< T > Class Template Reference

#include "Sparse.h"

Inheritance diagram for Sparse< T >:
Collaboration diagram for Sparse< T >:

Classes

class  SparseRep
 

Public Types

typedef T element_type
 

Public Member Functions

 Sparse (const Array< T > &a)
 
 Sparse (const Array< T > &a, const idx_vector &r, const idx_vector &c, octave_idx_type nr=-1, octave_idx_type nc=-1, bool sum_terms=true, octave_idx_type nzm=-1)
 
 Sparse (const dim_vector &dv)
 
 Sparse (const dim_vector &dv, octave_idx_type nz)
 
 Sparse (const PermMatrix &a)
 
 Sparse (const Sparse< T > &a)
 
 Sparse (const Sparse< T > &a, const dim_vector &dv)
 
template<typename U >
 Sparse (const Sparse< U > &a)
 
 Sparse (octave_idx_type n)
 
 Sparse (octave_idx_type nr, octave_idx_type nc)
 
 Sparse (octave_idx_type nr, octave_idx_type nc, octave_idx_type nz)
 
 Sparse (octave_idx_type nr, octave_idx_type nc, T val)
 
 Sparse (void)
 
virtual ~Sparse (void)
 
bool any_element_is_nan (void) const
 
Array< T > array_value (void) const
 
void assign (const idx_vector &i, const idx_vector &j, const Sparse< T > &rhs)
 
void assign (const idx_vector &i, const Sparse< T > &rhs)
 
size_t byte_size (void) const
 
void change_capacity (octave_idx_type nz)
 
T & checkelem (const Array< octave_idx_type > &ra_idx)
 
checkelem (const Array< octave_idx_type > &ra_idx) const
 
T & checkelem (octave_idx_type i, octave_idx_type j)
 
checkelem (octave_idx_type i, octave_idx_type j) const
 
T & checkelem (octave_idx_type n)
 
checkelem (octave_idx_type n) const
 
octave_idx_typecidx (octave_idx_type i)
 
octave_idx_type cidx (octave_idx_type i) const
 
octave_idx_typecidx (void)
 
octave_idx_typecidx (void) const
 
octave_idx_type cols (void) const
 
octave_idx_type columns (void) const
 
octave_idx_type compute_index (const Array< octave_idx_type > &ra_idx) const
 
T & data (octave_idx_type i)
 
data (octave_idx_type i) const
 
T * data (void)
 
T * data (void) const
 
void delete_elements (const idx_vector &i)
 
void delete_elements (const idx_vector &i, const idx_vector &j)
 
void delete_elements (int dim, const idx_vector &i)
 
Sparse< T > diag (octave_idx_type k=0) const
 
octave_idx_type dim1 (void) const
 
octave_idx_type dim2 (void) const
 
dim_vector dims (void) const
 
T & elem (const Array< octave_idx_type > &ra_idx)
 
elem (const Array< octave_idx_type > &ra_idx) const
 
T & elem (octave_idx_type i, octave_idx_type j)
 
elem (octave_idx_type i, octave_idx_type j) const
 
T & elem (octave_idx_type n)
 
elem (octave_idx_type n) const
 
octave_idx_type get_col_index (octave_idx_type k)
 
octave_idx_type get_row_index (octave_idx_type k)
 
Sparse< T > index (const idx_vector &i, bool resize_ok=false) const
 
Sparse< T > index (const idx_vector &i, const idx_vector &j, bool resize_ok=false) const
 
bool indices_ok (void) const
 
Sparse< T > & insert (const Sparse< T > &a, const Array< octave_idx_type > &idx)
 
Sparse< T > & insert (const Sparse< T > &a, octave_idx_type r, octave_idx_type c)
 
Sparse< T > ipermute (const Array< octave_idx_type > &vec) const
 
bool isempty (void) const
 
bool issquare (void) const
 
template<typename U , typename F >
Sparse< U > map (F fcn) const
 
template<typename U >
Sparse< U > map (U(&fcn)(const T &)) const
 
template<typename U >
Sparse< U > map (U(&fcn)(T)) const
 
Sparse< T > maybe_compress (bool remove_zeros=false)
 
void * mex_get_data (void) const
 
octave_idx_typemex_get_ir (void) const
 
octave_idx_typemex_get_jc (void) const
 
octave_idx_type ndims (void) const
 
octave_idx_type nnz (void) const
 Actual number of nonzero terms. More...
 
octave_idx_type numel (void) const
 
octave_idx_type nzmax (void) const
 Amount of storage for nonzero elements. More...
 
T & operator() (const Array< octave_idx_type > &ra_idx)
 
operator() (const Array< octave_idx_type > &ra_idx) const
 
T & operator() (octave_idx_type i, octave_idx_type j)
 
operator() (octave_idx_type i, octave_idx_type j) const
 
T & operator() (octave_idx_type n)
 
operator() (octave_idx_type n) const
 
Sparse< T > & operator= (const Sparse< T > &a)
 
Sparse< T > permute (const Array< octave_idx_type > &vec, bool inv=false) const
 
void print_info (std::ostream &os, const std::string &prefix) const
 
OCTAVE_NORETURN T & range_error (const char *fcn, const Array< octave_idx_type > &ra_idx)
 
OCTAVE_NORETURN T range_error (const char *fcn, const Array< octave_idx_type > &ra_idx) const
 
OCTAVE_NORETURN T & range_error (const char *fcn, octave_idx_type i, octave_idx_type j)
 
OCTAVE_NORETURN T range_error (const char *fcn, octave_idx_type i, octave_idx_type j) const
 
OCTAVE_NORETURN T & range_error (const char *fcn, octave_idx_type n)
 
OCTAVE_NORETURN T range_error (const char *fcn, octave_idx_type n) const
 
Sparse< T > reshape (const dim_vector &new_dims) const
 
void resize (const dim_vector &dv)
 
void resize (octave_idx_type r, octave_idx_type c)
 
void resize1 (octave_idx_type n)
 
octave_idx_typeridx (octave_idx_type i)
 
octave_idx_type ridx (octave_idx_type i) const
 
octave_idx_typeridx (void)
 
octave_idx_typeridx (void) const
 
octave_idx_type rows (void) const
 
Sparse< T > sort (Array< octave_idx_type > &sidx, octave_idx_type dim=0, sortmode mode=ASCENDING) const
 
Sparse< T > sort (octave_idx_type dim=0, sortmode mode=ASCENDING) const
 
Sparse< T > squeeze (void) const
 
template<typename F , bool zero>
bool test (F fcn) const
 
bool test_all (bool(&fcn)(const T &)) const
 
bool test_all (bool(&fcn)(T)) const
 
template<typename F >
bool test_all (F fcn) const
 
bool test_any (bool(&fcn)(const T &)) const
 
bool test_any (bool(&fcn)(T)) const
 
template<typename F >
bool test_any (F fcn) const
 
Sparse< T > transpose (void) const
 
octave_idx_typexcidx (octave_idx_type i)
 
octave_idx_typexcidx (void)
 
T & xdata (octave_idx_type i)
 
T * xdata (void)
 
T & xelem (const Array< octave_idx_type > &ra_idx)
 
xelem (const Array< octave_idx_type > &ra_idx) const
 
T & xelem (octave_idx_type i, octave_idx_type j)
 
xelem (octave_idx_type i, octave_idx_type j) const
 
T & xelem (octave_idx_type n)
 
xelem (octave_idx_type n) const
 
octave_idx_typexridx (octave_idx_type i)
 
octave_idx_typexridx (void)
 

Static Public Member Functions

static Sparse< T > cat (int dim, octave_idx_type n, const Sparse< T > *sparse_list)
 

Public Attributes

dim_vector dimensions
 
Sparse< T >::SparseReprep
 

Protected Member Functions

void make_unique (void)
 

Static Private Member Functions

static Sparse< T >::SparseRepnil_rep (void)
 

Detailed Description

template<typename T>
class Sparse< T >

Definition at line 47 of file Sparse.h.

Member Typedef Documentation

◆ element_type

template<typename T >
typedef T Sparse< T >::element_type

Definition at line 52 of file Sparse.h.

Constructor & Destructor Documentation

◆ Sparse() [1/13]

template<typename T >
Sparse< T >::Sparse ( void  )
inline

Definition at line 168 of file Sparse.h.

References Sparse< T >::SparseRep::count.

◆ Sparse() [2/13]

template<typename T >
Sparse< T >::Sparse ( octave_idx_type  n)
inlineexplicit

Definition at line 174 of file Sparse.h.

◆ Sparse() [3/13]

template<typename T >
Sparse< T >::Sparse ( octave_idx_type  nr,
octave_idx_type  nc 
)
inlineexplicit

Definition at line 178 of file Sparse.h.

◆ Sparse() [4/13]

template<typename T >
Sparse< T >::Sparse ( octave_idx_type  nr,
octave_idx_type  nc,
val 
)
explicit

◆ Sparse() [5/13]

template<typename T >
Sparse< T >::Sparse ( const dim_vector dv,
octave_idx_type  nz 
)
inline

Definition at line 184 of file Sparse.h.

◆ Sparse() [6/13]

template<typename T >
Sparse< T >::Sparse ( octave_idx_type  nr,
octave_idx_type  nc,
octave_idx_type  nz 
)
inline

Definition at line 188 of file Sparse.h.

◆ Sparse() [7/13]

template<typename T >
Sparse< T >::Sparse ( const PermMatrix a)
explicit

Definition at line 222 of file Sparse.cc.

References n, and PermMatrix::rows().

◆ Sparse() [8/13]

template<typename T >
template<typename U >
Sparse< T >::Sparse ( const Sparse< U > &  a)
inline

◆ Sparse() [9/13]

template<typename T >
Sparse< T >::Sparse ( const Sparse< T > &  a)
inline

Definition at line 210 of file Sparse.h.

References Sparse< T >::SparseRep::count.

◆ Sparse() [10/13]

template<typename T >
Sparse< T >::Sparse ( const dim_vector dv)

Definition at line 240 of file Sparse.cc.

References dim_vector::ndims(), and Sparse< T >::rep.

◆ Sparse() [11/13]

template<typename T >
Sparse< T >::Sparse ( const Sparse< T > &  a,
const dim_vector dv 
)

◆ Sparse() [12/13]

◆ Sparse() [13/13]

◆ ~Sparse()

template<typename T >
Sparse< T >::~Sparse ( void  )
virtual

Definition at line 694 of file Sparse.cc.

Member Function Documentation

◆ any_element_is_nan()

template<typename T >
bool Sparse< T >::any_element_is_nan ( void  ) const
inline

Definition at line 647 of file Sparse.h.

References Sparse< T >::SparseRep::any_element_is_nan().

◆ array_value()

template<typename T >
Array< T > Sparse< T >::array_value ( void  ) const

◆ assign() [1/2]

◆ assign() [2/2]

◆ byte_size()

◆ cat()

◆ change_capacity()

template<typename T >
void Sparse< T >::change_capacity ( octave_idx_type  nz)
inline

Definition at line 454 of file Sparse.h.

References Sparse< T >::SparseRep::change_length().

Referenced by Sparse< T >::Sparse().

◆ checkelem() [1/6]

template<typename T >
T& Sparse< T >::checkelem ( const Array< octave_idx_type > &  ra_idx)
inline

Definition at line 345 of file Sparse.h.

References compute_index(), elem, and ra_idx.

◆ checkelem() [2/6]

template<typename T >
T Sparse< T >::checkelem ( const Array< octave_idx_type > &  ra_idx) const
inline

Definition at line 401 of file Sparse.h.

References compute_index(), Sparse< T >::elem(), and ra_idx.

◆ checkelem() [3/6]

template<typename T >
T& Sparse< T >::checkelem ( octave_idx_type  i,
octave_idx_type  j 
)
inline

Definition at line 334 of file Sparse.h.

◆ checkelem() [4/6]

template<typename T >
T Sparse< T >::checkelem ( octave_idx_type  i,
octave_idx_type  j 
) const
inline

Definition at line 393 of file Sparse.h.

◆ checkelem() [5/6]

template<typename T >
T& Sparse< T >::checkelem ( octave_idx_type  n)
inline

Definition at line 322 of file Sparse.h.

References n, and numel().

◆ checkelem() [6/6]

template<typename T >
T Sparse< T >::checkelem ( octave_idx_type  n) const
inline

Definition at line 385 of file Sparse.h.

References n, and numel().

◆ cidx() [1/4]

template<typename T >
octave_idx_type& Sparse< T >::cidx ( octave_idx_type  i)
inline

Definition at line 493 of file Sparse.h.

References Sparse< T >::SparseRep::cidx().

◆ cidx() [2/4]

template<typename T >
octave_idx_type Sparse< T >::cidx ( octave_idx_type  i) const
inline

Definition at line 501 of file Sparse.h.

References Sparse< T >::SparseRep::ccidx().

◆ cidx() [3/4]

template<typename T >
octave_idx_type* Sparse< T >::cidx ( void  )
inline

Definition at line 492 of file Sparse.h.

References Sparse< T >::SparseRep::c.

Referenced by idx_vector::idx_vector_rep::idx_vector_rep(), MatrixType::MatrixType(), octave::math::sparse_qr< SPARSE_T >::sparse_qr_rep< SPARSE_T >::sparse_qr_rep(), SparseComplexMatrix::SparseComplexMatrix(), SparseMatrix::SparseMatrix(), SparseComplexMatrix::abs(), octave_sparse_bool_matrix::as_mxArray(), octave_sparse_complex_matrix::as_mxArray(), octave_sparse_matrix::as_mxArray(), Sparse< T >::assign(), binmap(), SparseComplexMatrix::bsolve(), SparseMatrix::bsolve(), Sparse< T >::cat(), octave_sparse_complex_matrix::char_array_value(), octave_sparse_bool_matrix::char_array_value(), octave_sparse_matrix::char_array_value(), SparseComplexMatrix::column(), SparseMatrix::column(), octave_sparse_matrix::convert_to_str_internal(), Sparse< T >::delete_elements(), SparseComplexMatrix::determinant(), SparseMatrix::determinant(), dmsolve_insert(), dmsolve_permute(), SparseComplexMatrix::dsolve(), SparseMatrix::dsolve(), elem_xpow(), SparseComplexMatrix::factorize(), SparseMatrix::factorize(), Fcomplex(), find_nonzero_elem_idx(), SparseComplexMatrix::fsolve(), SparseMatrix::fsolve(), Fsymbfact(), SparseComplexMatrix::hermitian(), Sparse< T >::insert(), SparseComplexMatrix::inverse(), SparseMatrix::inverse(), SparseComplexMatrix::ishermitian(), SparseMatrix::issymmetric(), SparseComplexMatrix::ltsolve(), SparseMatrix::ltsolve(), Sparse< T >::map(), SparseComplexMatrix::max(), SparseMatrix::max(), max(), SparseComplexMatrix::min(), SparseMatrix::min(), min(), SparseComplexMatrix::operator!(), SparseMatrix::operator!(), SparseBoolMatrix::operator==(), SparseComplexMatrix::operator==(), SparseMatrix::operator==(), octave::math::sparse_lu< lu_type >::Pc(), plus_or_minus(), octave::math::sparse_lu< lu_type >::Pr(), SparseComplexMatrix::prod(), SparseMatrix::prod(), product(), quotient(), read_mat5_binary_element(), read_sparse_matrix(), SparseComplexMatrix::row(), SparseMatrix::row(), octave_sparse_bool_matrix::save_binary(), octave_sparse_complex_matrix::save_binary(), octave_sparse_matrix::save_binary(), times_or_divide(), times_or_divides(), SparseComplexMatrix::tinverse(), SparseMatrix::tinverse(), SparseComplexMatrix::trisolve(), SparseMatrix::trisolve(), SparseComplexMatrix::utsolve(), SparseMatrix::utsolve(), x_el_div(), and xpow().

◆ cidx() [4/4]

template<typename T >
octave_idx_type* Sparse< T >::cidx ( void  ) const
inline

Definition at line 503 of file Sparse.h.

References Sparse< T >::SparseRep::c.

◆ cols()

template<typename T >
octave_idx_type Sparse< T >::cols ( void  ) const
inline

Definition at line 251 of file Sparse.h.

Referenced by idx_vector::idx_vector_rep::idx_vector_rep(), MatrixType::MatrixType(), Sparse< T >::Sparse(), SparseComplexMatrix::SparseComplexMatrix(), SparseMatrix::SparseMatrix(), SparseComplexMatrix::abs(), Sparse< T >::assign(), binmap(), SparseComplexMatrix::bsolve(), SparseMatrix::bsolve(), octave_sparse_complex_matrix::char_array_value(), octave_sparse_bool_matrix::char_array_value(), octave_sparse_matrix::char_array_value(), SparseBoolMatrix::concat(), SparseComplexMatrix::concat(), SparseMatrix::concat(), octave_sparse_matrix::convert_to_str_internal(), SparseComplexMatrix::determinant(), SparseMatrix::determinant(), SparseComplexMatrix::dinverse(), SparseMatrix::dinverse(), dmsolve_insert(), dmsolve_permute(), SparseComplexMatrix::dsolve(), SparseMatrix::dsolve(), elem_xpow(), F__ilu0__(), F__iluc__(), F__ilutp__(), SparseComplexMatrix::factorize(), SparseMatrix::factorize(), Famd(), Fccolamd(), Fcolamd(), Fcomplex(), Fcsymamd(), Fetree(), find_nonzero_elem_idx(), SparseComplexMatrix::fsolve(), SparseMatrix::fsolve(), Fsymamd(), Fsymbfact(), SparseComplexMatrix::hermitian(), Sparse< T >::insert(), SparseComplexMatrix::inverse(), SparseMatrix::inverse(), SparseComplexMatrix::ishermitian(), SparseMatrix::issymmetric(), SparseComplexMatrix::ltsolve(), SparseMatrix::ltsolve(), octave_sparse_matrix::map(), max(), min(), SparseComplexMatrix::operator!(), SparseMatrix::operator!(), SparseBoolMatrix::operator==(), SparseComplexMatrix::operator==(), SparseMatrix::operator==(), plus_or_minus(), product(), quotient(), read_sparse_matrix(), save_mat5_binary_element(), octave::math::sparse_qr< SPARSE_T >::sparse_qr_rep< SPARSE_T >::tall_solve(), times_or_divide(), times_or_divides(), SparseComplexMatrix::tinverse(), SparseMatrix::tinverse(), SparseComplexMatrix::trisolve(), SparseMatrix::trisolve(), octave_sparse_bool_matrix::try_narrowing_conversion(), octave_sparse_complex_matrix::try_narrowing_conversion(), octave_sparse_matrix::try_narrowing_conversion(), SparseComplexMatrix::utsolve(), SparseMatrix::utsolve(), octave::math::sparse_qr< SPARSE_T >::sparse_qr_rep< SPARSE_T >::wide_solve(), x_el_div(), and xpow().

◆ columns()

template<typename T >
octave_idx_type Sparse< T >::columns ( void  ) const
inline

◆ compute_index()

template<typename T >
octave_idx_type Sparse< T >::compute_index ( const Array< octave_idx_type > &  ra_idx) const

Definition at line 720 of file Sparse.cc.

References n, octave_base_value::numel(), ra_idx, and retval.

◆ data() [1/4]

template<typename T >
T& Sparse< T >::data ( octave_idx_type  i)
inline

Definition at line 471 of file Sparse.h.

References Sparse< T >::SparseRep::data().

◆ data() [2/4]

template<typename T >
T Sparse< T >::data ( octave_idx_type  i) const
inline

Definition at line 475 of file Sparse.h.

References Sparse< T >::SparseRep::data().

◆ data() [3/4]

template<typename T >
T* Sparse< T >::data ( void  )
inline

Definition at line 470 of file Sparse.h.

References Sparse< T >::SparseRep::d.

Referenced by idx_vector::idx_vector_rep::idx_vector_rep(), MatrixType::MatrixType(), Sparse< T >::Sparse(), octave::math::sparse_lu< lu_type >::sparse_lu(), octave::math::sparse_qr< SPARSE_T >::sparse_qr_rep< SPARSE_T >::sparse_qr_rep(), SparseComplexMatrix::SparseComplexMatrix(), SparseMatrix::SparseMatrix(), SparseComplexMatrix::abs(), SparseMatrix::all_elements_are_int_or_inf_or_nan(), SparseComplexMatrix::all_elements_are_real(), SparseMatrix::all_elements_are_zero(), SparseComplexMatrix::all_integers(), SparseMatrix::all_integers(), SparseComplexMatrix::any_element_is_inf_or_nan(), SparseMatrix::any_element_is_inf_or_nan(), SparseComplexMatrix::any_element_is_nan(), SparseMatrix::any_element_is_nan(), SparseMatrix::any_element_is_negative(), SparseMatrix::any_element_not_one_or_zero(), octave_sparse_bool_matrix::as_mxArray(), octave_sparse_complex_matrix::as_mxArray(), octave_sparse_matrix::as_mxArray(), Sparse< T >::assign(), binmap(), SparseComplexMatrix::bsolve(), SparseMatrix::bsolve(), Sparse< T >::cat(), octave_sparse_complex_matrix::char_array_value(), octave_sparse_bool_matrix::char_array_value(), octave_sparse_matrix::char_array_value(), SparseComplexMatrix::column(), SparseMatrix::column(), octave_sparse_matrix::convert_to_str_internal(), Sparse< T >::delete_elements(), SparseComplexMatrix::determinant(), SparseMatrix::determinant(), dmsolve_insert(), dmsolve_permute(), SparseComplexMatrix::dsolve(), SparseMatrix::dsolve(), elem_xpow(), SparseComplexMatrix::factorize(), SparseMatrix::factorize(), Fcomplex(), find_nonzero_elem_idx(), SparseComplexMatrix::fsolve(), SparseMatrix::fsolve(), Fsymbfact(), SparseComplexMatrix::hermitian(), Sparse< T >::insert(), SparseComplexMatrix::ishermitian(), SparseMatrix::issymmetric(), SparseComplexMatrix::ltsolve(), SparseMatrix::ltsolve(), Sparse< T >::map(), SparseComplexMatrix::max(), SparseMatrix::max(), max(), SparseComplexMatrix::min(), SparseMatrix::min(), min(), SparseBoolMatrix::operator==(), SparseComplexMatrix::operator==(), SparseMatrix::operator==(), octave::math::sparse_lu< lu_type >::Pc(), plus_or_minus(), octave::math::sparse_lu< lu_type >::Pr(), product(), quotient(), read_mat5_binary_element(), read_sparse_matrix(), SparseComplexMatrix::row(), SparseMatrix::row(), octave_sparse_bool_matrix::save_binary(), octave_sparse_complex_matrix::save_binary(), octave_sparse_matrix::save_binary(), times_or_divide(), times_or_divides(), SparseComplexMatrix::tinverse(), SparseMatrix::tinverse(), SparseComplexMatrix::trisolve(), SparseMatrix::trisolve(), SparseComplexMatrix::utsolve(), SparseMatrix::utsolve(), x_el_div(), and xpow().

◆ data() [4/4]

template<typename T >
T* Sparse< T >::data ( void  ) const
inline

Definition at line 477 of file Sparse.h.

References Sparse< T >::SparseRep::d.

◆ delete_elements() [1/3]

◆ delete_elements() [2/3]

◆ delete_elements() [3/3]

template<typename T >
void Sparse< T >::delete_elements ( int  dim,
const idx_vector i 
)

Definition at line 1381 of file Sparse.cc.

References idx_vector::colon, and current_liboctave_error_handler.

◆ diag()

template<typename T >
Sparse< T > Sparse< T >::diag ( octave_idx_type  k = 0) const

Definition at line 2417 of file Sparse.cc.

References abs(), d, elem, and n.

Referenced by SparseBoolMatrix::diag(), and MSparse< T >::diag().

◆ dim1()

template<typename T >
octave_idx_type Sparse< T >::dim1 ( void  ) const
inline

Definition at line 247 of file Sparse.h.

◆ dim2()

template<typename T >
octave_idx_type Sparse< T >::dim2 ( void  ) const
inline

Definition at line 248 of file Sparse.h.

◆ dims()

◆ elem() [1/6]

template<typename T >
T& Sparse< T >::elem ( const Array< octave_idx_type > &  ra_idx)
inline

Definition at line 367 of file Sparse.h.

References compute_index(), Sparse< T >::elem(), and ra_idx.

◆ elem() [2/6]

template<typename T >
T Sparse< T >::elem ( const Array< octave_idx_type > &  ra_idx) const
inline

Definition at line 415 of file Sparse.h.

References compute_index(), Sparse< T >::elem(), and ra_idx.

◆ elem() [3/6]

template<typename T >
T& Sparse< T >::elem ( octave_idx_type  i,
octave_idx_type  j 
)
inline

Definition at line 361 of file Sparse.h.

◆ elem() [4/6]

template<typename T >
T Sparse< T >::elem ( octave_idx_type  i,
octave_idx_type  j 
) const
inline

Definition at line 413 of file Sparse.h.

◆ elem() [5/6]

◆ elem() [6/6]

template<typename T >
T Sparse< T >::elem ( octave_idx_type  n) const
inline

Definition at line 411 of file Sparse.h.

References n.

◆ get_col_index()

template<typename T >
octave_idx_type Sparse< T >::get_col_index ( octave_idx_type  k)
inline

Definition at line 255 of file Sparse.h.

◆ get_row_index()

template<typename T >
octave_idx_type Sparse< T >::get_row_index ( octave_idx_type  k)
inline

Definition at line 254 of file Sparse.h.

◆ index() [1/2]

◆ index() [2/2]

◆ indices_ok()

template<typename T >
bool Sparse< T >::indices_ok ( void  ) const
inline

Definition at line 645 of file Sparse.h.

References Sparse< T >::SparseRep::indices_ok().

◆ insert() [1/2]

template<typename T >
Sparse< T > & Sparse< T >::insert ( const Sparse< T > &  a,
const Array< octave_idx_type > &  idx 
)

Definition at line 1094 of file Sparse.cc.

References octave_base_value::numel(), and ra_idx.

◆ insert() [2/2]

template<typename T >
Sparse< T > & Sparse< T >::insert ( const Sparse< T > &  a,
octave_idx_type  r,
octave_idx_type  c 
)

◆ ipermute()

template<typename T >
Sparse<T> Sparse< T >::ipermute ( const Array< octave_idx_type > &  vec) const
inline

Definition at line 443 of file Sparse.h.

Referenced by SparseBoolMatrix::ipermute(), and MSparse< T >::ipermute().

◆ isempty()

template<typename T >
bool Sparse< T >::isempty ( void  ) const
inline

Definition at line 466 of file Sparse.h.

Referenced by Sparse< T >::cat(), and LuAminusSigmaB().

◆ issquare()

template<typename T >
bool Sparse< T >::issquare ( void  ) const
inline

Definition at line 464 of file Sparse.h.

◆ make_unique()

template<typename T >
void Sparse< T >::make_unique ( void  )
inlineprotected

Definition at line 140 of file Sparse.h.

References r.

◆ map() [1/3]

template<typename T >
template<typename U , typename F >
Sparse<U> Sparse< T >::map ( fcn) const
inline

◆ map() [2/3]

template<typename T >
template<typename U >
Sparse<U> Sparse< T >::map ( U(&)(const T &)  fcn) const
inline

Definition at line 642 of file Sparse.h.

◆ map() [3/3]

template<typename T >
template<typename U >
Sparse<U> Sparse< T >::map ( U(&)(T)  fcn) const
inline

Definition at line 637 of file Sparse.h.

◆ maybe_compress()

◆ mex_get_data()

template<typename T >
void* Sparse< T >::mex_get_data ( void  ) const
inline

Definition at line 526 of file Sparse.h.

Referenced by octave_base_sparse< T >::mex_get_data().

◆ mex_get_ir()

template<typename T >
octave_idx_type* Sparse< T >::mex_get_ir ( void  ) const
inline

Definition at line 528 of file Sparse.h.

Referenced by octave_base_sparse< T >::mex_get_ir().

◆ mex_get_jc()

template<typename T >
octave_idx_type* Sparse< T >::mex_get_jc ( void  ) const
inline

Definition at line 533 of file Sparse.h.

Referenced by octave_base_sparse< T >::mex_get_jc().

◆ ndims()

template<typename T >
octave_idx_type Sparse< T >::ndims ( void  ) const
inline

Definition at line 505 of file Sparse.h.

References dim_vector::ndims().

Referenced by octave_base_sparse< T >::octave_base_sparse().

◆ nil_rep()

template<typename T >
Sparse< T >::SparseRep * Sparse< T >::nil_rep ( void  )
staticprivate

Definition at line 58 of file Sparse.cc.

◆ nnz()

template<typename T >
octave_idx_type Sparse< T >::nnz ( void  ) const
inline

Actual number of nonzero terms.

Definition at line 238 of file Sparse.h.

References Sparse< T >::SparseRep::nnz().

Referenced by MatrixType::MatrixType(), Sparse< T >::Sparse(), octave::math::sparse_qr< SPARSE_T >::sparse_qr_rep< SPARSE_T >::sparse_qr_rep(), SparseComplexMatrix::SparseComplexMatrix(), SparseMatrix::SparseMatrix(), SparseComplexMatrix::abs(), SparseMatrix::abs(), SparseMatrix::all_elements_are_int_or_inf_or_nan(), SparseComplexMatrix::all_elements_are_real(), SparseMatrix::all_elements_are_zero(), SparseComplexMatrix::all_integers(), SparseMatrix::all_integers(), SparseComplexMatrix::any_element_is_inf_or_nan(), SparseMatrix::any_element_is_inf_or_nan(), SparseComplexMatrix::any_element_is_nan(), SparseMatrix::any_element_is_nan(), Sparse< T >::SparseRep::any_element_is_nan(), SparseMatrix::any_element_is_negative(), SparseMatrix::any_element_not_one_or_zero(), Sparse< T >::assign(), binmap(), SparseComplexMatrix::bsolve(), SparseMatrix::bsolve(), Sparse< T >::cat(), Sparse< T >::delete_elements(), dmperm_internal(), dmsolve_insert(), dmsolve_permute(), SparseComplexMatrix::dsolve(), SparseMatrix::dsolve(), elem_xpow(), Fccolamd(), Fcolamd(), Fcomplex(), find_nonzero_elem_idx(), SparseComplexMatrix::fsolve(), SparseMatrix::fsolve(), Fsymbfact(), SparseComplexMatrix::hermitian(), octave_sparse_matrix::index_vector(), Sparse< T >::SparseRep::indices_ok(), Sparse< T >::insert(), SparseComplexMatrix::inverse(), SparseMatrix::inverse(), SparseComplexMatrix::ltsolve(), SparseMatrix::ltsolve(), max(), min(), octave_base_sparse< T >::nnz(), SparseComplexMatrix::operator!(), SparseMatrix::operator!(), operator-(), SparseBoolMatrix::operator==(), SparseComplexMatrix::operator==(), SparseMatrix::operator==(), plus_or_minus(), product(), quotient(), octave_sparse_complex_matrix::save_binary(), octave_sparse_matrix::save_binary(), octave::math::sparse_qr< SPARSE_T >::sparse_qr_rep< SPARSE_T >::tall_solve(), times_or_divide(), times_or_divides(), SparseComplexMatrix::tinverse(), SparseMatrix::tinverse(), SparseComplexMatrix::trisolve(), SparseMatrix::trisolve(), SparseComplexMatrix::utsolve(), SparseMatrix::utsolve(), and octave::math::sparse_qr< SPARSE_T >::sparse_qr_rep< SPARSE_T >::wide_solve().

◆ numel()

template<typename T >
octave_idx_type Sparse< T >::numel ( void  ) const
inline

◆ nzmax()

template<typename T >
octave_idx_type Sparse< T >::nzmax ( void  ) const
inline

Amount of storage for nonzero elements.

This may differ from the actual number of elements, see nnz().

Definition at line 235 of file Sparse.h.

References Sparse< T >::SparseRep::length().

Referenced by dmperm_internal(), octave_base_sparse< T >::nzmax(), read_sparse_matrix(), and save_mat5_binary_element().

◆ operator()() [1/6]

template<typename T >
T& Sparse< T >::operator() ( const Array< octave_idx_type > &  ra_idx)
inline

Definition at line 380 of file Sparse.h.

References elem, and ra_idx.

◆ operator()() [2/6]

template<typename T >
T Sparse< T >::operator() ( const Array< octave_idx_type > &  ra_idx) const
inline

Definition at line 425 of file Sparse.h.

References elem, and ra_idx.

◆ operator()() [3/6]

template<typename T >
T& Sparse< T >::operator() ( octave_idx_type  i,
octave_idx_type  j 
)
inline

Definition at line 375 of file Sparse.h.

References elem.

◆ operator()() [4/6]

template<typename T >
T Sparse< T >::operator() ( octave_idx_type  i,
octave_idx_type  j 
) const
inline

Definition at line 420 of file Sparse.h.

References elem.

◆ operator()() [5/6]

template<typename T >
T& Sparse< T >::operator() ( octave_idx_type  n)
inline

Definition at line 370 of file Sparse.h.

References elem, and n.

◆ operator()() [6/6]

template<typename T >
T Sparse< T >::operator() ( octave_idx_type  n) const
inline

Definition at line 418 of file Sparse.h.

References elem, and n.

◆ operator=()

template<typename T >
Sparse< T > & Sparse< T >::operator= ( const Sparse< T > &  a)

◆ permute()

template<typename T >
Sparse< T > Sparse< T >::permute ( const Array< octave_idx_type > &  vec,
bool  inv = false 
) const

Definition at line 904 of file Sparse.cc.

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

Referenced by SparseBoolMatrix::permute(), and MSparse< T >::permute().

◆ print_info()

template<typename T >
void Sparse< T >::print_info ( std::ostream &  os,
const std::string &  prefix 
) const

Definition at line 3014 of file Sparse.cc.

◆ range_error() [1/6]

template<typename T >
T & Sparse< T >::range_error ( const char *  fcn,
const Array< octave_idx_type > &  ra_idx 
)

Definition at line 802 of file Sparse.cc.

References n, octave_base_value::numel(), and ra_idx.

◆ range_error() [2/6]

template<typename T >
T Sparse< T >::range_error ( const char *  fcn,
const Array< octave_idx_type > &  ra_idx 
) const

Definition at line 778 of file Sparse.cc.

References n, octave_base_value::numel(), and ra_idx.

◆ range_error() [3/6]

template<typename T >
T & Sparse< T >::range_error ( const char *  fcn,
octave_idx_type  i,
octave_idx_type  j 
)

Definition at line 769 of file Sparse.cc.

◆ range_error() [4/6]

template<typename T >
T Sparse< T >::range_error ( const char *  fcn,
octave_idx_type  i,
octave_idx_type  j 
) const

Definition at line 759 of file Sparse.cc.

◆ range_error() [5/6]

template<typename T >
T & Sparse< T >::range_error ( const char *  fcn,
octave_idx_type  n 
)

Definition at line 751 of file Sparse.cc.

References n.

◆ range_error() [6/6]

template<typename T >
T Sparse< T >::range_error ( const char *  fcn,
octave_idx_type  n 
) const

Definition at line 743 of file Sparse.cc.

References n.

◆ reshape()

template<typename T >
Sparse< T > Sparse< T >::reshape ( const dim_vector new_dims) const

◆ resize() [1/2]

template<typename T >
void Sparse< T >::resize ( const dim_vector dv)

Definition at line 951 of file Sparse.cc.

References n, and dim_vector::ndims().

◆ resize() [2/2]

◆ resize1()

template<typename T >
void Sparse< T >::resize1 ( octave_idx_type  n)

Definition at line 932 of file Sparse.cc.

References octave::err_invalid_resize(), max(), and n.

Referenced by Sparse< T >::index().

◆ ridx() [1/4]

template<typename T >
octave_idx_type& Sparse< T >::ridx ( octave_idx_type  i)
inline

Definition at line 480 of file Sparse.h.

References Sparse< T >::SparseRep::ridx().

◆ ridx() [2/4]

template<typename T >
octave_idx_type Sparse< T >::ridx ( octave_idx_type  i) const
inline

Definition at line 488 of file Sparse.h.

References Sparse< T >::SparseRep::cridx().

◆ ridx() [3/4]

template<typename T >
octave_idx_type* Sparse< T >::ridx ( void  )
inline

Definition at line 479 of file Sparse.h.

References Sparse< T >::SparseRep::r.

Referenced by idx_vector::idx_vector_rep::idx_vector_rep(), MatrixType::MatrixType(), Sparse< T >::Sparse(), octave::math::sparse_qr< SPARSE_T >::sparse_qr_rep< SPARSE_T >::sparse_qr_rep(), SparseComplexMatrix::SparseComplexMatrix(), SparseMatrix::SparseMatrix(), SparseComplexMatrix::abs(), octave_sparse_bool_matrix::as_mxArray(), octave_sparse_complex_matrix::as_mxArray(), octave_sparse_matrix::as_mxArray(), Sparse< T >::assign(), binmap(), SparseComplexMatrix::bsolve(), SparseMatrix::bsolve(), Sparse< T >::cat(), octave_sparse_complex_matrix::char_array_value(), octave_sparse_bool_matrix::char_array_value(), octave_sparse_matrix::char_array_value(), SparseComplexMatrix::column(), SparseMatrix::column(), octave_sparse_matrix::convert_to_str_internal(), Sparse< T >::delete_elements(), SparseComplexMatrix::determinant(), SparseMatrix::determinant(), dmsolve_insert(), dmsolve_permute(), SparseComplexMatrix::dsolve(), SparseMatrix::dsolve(), elem_xpow(), SparseComplexMatrix::factorize(), SparseMatrix::factorize(), Fcomplex(), find_nonzero_elem_idx(), SparseComplexMatrix::fsolve(), SparseMatrix::fsolve(), Fsymbfact(), SparseComplexMatrix::hermitian(), Sparse< T >::insert(), SparseComplexMatrix::inverse(), SparseMatrix::inverse(), SparseComplexMatrix::ishermitian(), SparseMatrix::issymmetric(), SparseComplexMatrix::ltsolve(), SparseMatrix::ltsolve(), Sparse< T >::map(), SparseComplexMatrix::max(), SparseMatrix::max(), max(), SparseComplexMatrix::min(), SparseMatrix::min(), min(), SparseComplexMatrix::operator!(), SparseMatrix::operator!(), SparseBoolMatrix::operator==(), SparseComplexMatrix::operator==(), SparseMatrix::operator==(), octave::math::sparse_lu< lu_type >::Pc(), plus_or_minus(), octave::math::sparse_lu< lu_type >::Pr(), product(), quotient(), read_mat5_binary_element(), read_sparse_matrix(), SparseComplexMatrix::row(), SparseMatrix::row(), octave_sparse_bool_matrix::save_binary(), octave_sparse_complex_matrix::save_binary(), octave_sparse_matrix::save_binary(), times_or_divide(), times_or_divides(), SparseComplexMatrix::tinverse(), SparseMatrix::tinverse(), SparseComplexMatrix::trisolve(), SparseMatrix::trisolve(), SparseComplexMatrix::utsolve(), SparseMatrix::utsolve(), x_el_div(), and xpow().

◆ ridx() [4/4]

template<typename T >
octave_idx_type* Sparse< T >::ridx ( void  ) const
inline

Definition at line 490 of file Sparse.h.

References Sparse< T >::SparseRep::r.

◆ rows()

template<typename T >
octave_idx_type Sparse< T >::rows ( void  ) const
inline

Definition at line 250 of file Sparse.h.

Referenced by idx_vector::idx_vector_rep::idx_vector_rep(), MatrixType::MatrixType(), Sparse< T >::Sparse(), SparseComplexMatrix::abs(), Sparse< T >::assign(), binmap(), SparseComplexMatrix::bsolve(), SparseMatrix::bsolve(), Sparse< T >::cat(), octave_sparse_complex_matrix::char_array_value(), octave_sparse_bool_matrix::char_array_value(), octave_sparse_matrix::char_array_value(), SparseComplexMatrix::column(), SparseMatrix::column(), SparseBoolMatrix::concat(), SparseComplexMatrix::concat(), SparseMatrix::concat(), octave_sparse_matrix::convert_to_str_internal(), SparseComplexMatrix::determinant(), SparseMatrix::determinant(), SparseComplexMatrix::dinverse(), SparseMatrix::dinverse(), dmsolve_insert(), dmsolve_permute(), SparseComplexMatrix::dsolve(), SparseMatrix::dsolve(), elem_xpow(), SparseComplexMatrix::factorize(), SparseMatrix::factorize(), Famd(), Fccolamd(), Fcolamd(), Fcomplex(), Fcsymamd(), Fetree(), find_nonzero_elem_idx(), SparseComplexMatrix::fsolve(), SparseMatrix::fsolve(), Fsymamd(), Fsymbfact(), SparseComplexMatrix::hermitian(), Sparse< T >::insert(), SparseComplexMatrix::inverse(), SparseMatrix::inverse(), SparseComplexMatrix::ishermitian(), SparseMatrix::issymmetric(), SparseComplexMatrix::ltsolve(), SparseMatrix::ltsolve(), octave_sparse_matrix::map(), max(), min(), SparseComplexMatrix::operator!(), SparseMatrix::operator!(), SparseBoolMatrix::operator==(), SparseComplexMatrix::operator==(), SparseMatrix::operator==(), plus_or_minus(), SparseComplexMatrix::prod(), SparseMatrix::prod(), product(), quotient(), read_sparse_matrix(), octave::math::sparse_qr< SPARSE_T >::sparse_qr_rep< SPARSE_T >::tall_solve(), times_or_divide(), times_or_divides(), SparseComplexMatrix::tinverse(), SparseMatrix::tinverse(), SparseComplexMatrix::trisolve(), SparseMatrix::trisolve(), octave_sparse_bool_matrix::try_narrowing_conversion(), octave_sparse_complex_matrix::try_narrowing_conversion(), octave_sparse_matrix::try_narrowing_conversion(), SparseComplexMatrix::utsolve(), SparseMatrix::utsolve(), octave::math::sparse_qr< SPARSE_T >::sparse_qr_rep< SPARSE_T >::wide_solve(), x_el_div(), and xpow().

◆ sort() [1/2]

◆ sort() [2/2]

template<typename T >
Sparse< T > Sparse< T >::sort ( octave_idx_type  dim = 0,
sortmode  mode = ASCENDING 
) const

◆ squeeze()

template<typename T >
Sparse<T> Sparse< T >::squeeze ( void  ) const
inline

Definition at line 272 of file Sparse.h.

Referenced by SparseBoolMatrix::squeeze(), and MSparse< T >::squeeze().

◆ test()

template<typename T >
template<typename F , bool zero>
bool Sparse< T >::test ( fcn) const
inline

Definition at line 552 of file Sparse.h.

◆ test_all() [1/3]

template<typename T >
bool Sparse< T >::test_all ( bool(&)(const T &)  fcn) const
inline

Definition at line 576 of file Sparse.h.

◆ test_all() [2/3]

template<typename T >
bool Sparse< T >::test_all ( bool(&)(T)  fcn) const
inline

Definition at line 573 of file Sparse.h.

◆ test_all() [3/3]

template<typename T >
template<typename F >
bool Sparse< T >::test_all ( fcn) const
inline

Definition at line 563 of file Sparse.h.

◆ test_any() [1/3]

template<typename T >
bool Sparse< T >::test_any ( bool(&)(const T &)  fcn) const
inline

Definition at line 570 of file Sparse.h.

◆ test_any() [2/3]

template<typename T >
bool Sparse< T >::test_any ( bool(&)(T)  fcn) const
inline

Definition at line 567 of file Sparse.h.

◆ test_any() [3/3]

template<typename T >
template<typename F >
bool Sparse< T >::test_any ( fcn) const
inline

◆ transpose()

template<typename T >
Sparse< T > Sparse< T >::transpose ( void  ) const

◆ xcidx() [1/2]

template<typename T >
octave_idx_type& Sparse< T >::xcidx ( octave_idx_type  i)
inline

Definition at line 499 of file Sparse.h.

References Sparse< T >::SparseRep::cidx().

◆ xcidx() [2/2]

◆ xdata() [1/2]

template<typename T >
T& Sparse< T >::xdata ( octave_idx_type  i)
inline

Definition at line 473 of file Sparse.h.

References Sparse< T >::SparseRep::data().

◆ xdata() [2/2]

◆ xelem() [1/6]

template<typename T >
T& Sparse< T >::xelem ( const Array< octave_idx_type > &  ra_idx)
inline

Definition at line 313 of file Sparse.h.

References compute_index(), and ra_idx.

◆ xelem() [2/6]

template<typename T >
T Sparse< T >::xelem ( const Array< octave_idx_type > &  ra_idx) const
inline

Definition at line 316 of file Sparse.h.

References compute_index(), and ra_idx.

◆ xelem() [3/6]

template<typename T >
T& Sparse< T >::xelem ( octave_idx_type  i,
octave_idx_type  j 
)
inline

Definition at line 307 of file Sparse.h.

References Sparse< T >::SparseRep::elem().

◆ xelem() [4/6]

template<typename T >
T Sparse< T >::xelem ( octave_idx_type  i,
octave_idx_type  j 
) const
inline

Definition at line 308 of file Sparse.h.

References Sparse< T >::SparseRep::celem().

◆ xelem() [5/6]

◆ xelem() [6/6]

template<typename T >
T Sparse< T >::xelem ( octave_idx_type  n) const
inline

Definition at line 300 of file Sparse.h.

References n.

◆ xridx() [1/2]

template<typename T >
octave_idx_type& Sparse< T >::xridx ( octave_idx_type  i)
inline

Definition at line 486 of file Sparse.h.

References Sparse< T >::SparseRep::ridx().

◆ xridx() [2/2]

Member Data Documentation

◆ dimensions

template<typename T >
dim_vector Sparse< T >::dimensions

Definition at line 160 of file Sparse.h.

Referenced by Sparse< T >::Sparse(), and Sparse< T >::operator=().

◆ rep

template<typename T >
Sparse<T>::SparseRep* Sparse< T >::rep

Definition at line 158 of file Sparse.h.

Referenced by Sparse< T >::Sparse(), and Sparse< T >::operator=().


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