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

#include "Sparse.h"

Inheritance diagram for Sparse< T, Alloc >:
MSparse< double > MSparse< Complex > SparseMatrix SparseComplexMatrix

Classes

class  SparseRep
 

Public Types

typedef T element_type
 

Public Member Functions

 Sparse ()
 
 Sparse (const Array< T > &a)
 
 Sparse (const Array< T > &a, const octave::idx_vector &r, const octave::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 dim_vector &dv, octave_idx_type nz, T *ptr, octave_idx_type *ridx, octave_idx_type *cidx, const Alloc &xallocator=Alloc())
 
 Sparse (const PermMatrix &a)
 
 Sparse (const Sparse< T, Alloc > &a)
 
 Sparse (const Sparse< T, Alloc > &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)
 
virtual ~Sparse ()
 
bool any_element_is_nan () const
 
Array< T > array_value () const
 
void assign (const octave::idx_vector &i, const octave::idx_vector &j, const Sparse< T, Alloc > &rhs)
 
void assign (const octave::idx_vector &i, const octave::idx_vector &j, const T &rhs)
 
void assign (const octave::idx_vector &i, const Sparse< T, Alloc > &rhs)
 
void assign (const octave::idx_vector &i, const T &rhs)
 
std::size_t byte_size () 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_typecidx () const
 
octave_idx_typecidx (octave_idx_type i)
 
octave_idx_type cidx (octave_idx_type i) const
 
octave_idx_type cols () const
 
octave_idx_type columns () const
 
octave_idx_type compute_index (const Array< octave_idx_type > &ra_idx) const
 
T * data ()
 
T * data () const
 
T & data (octave_idx_type i)
 
data (octave_idx_type i) const
 
void delete_elements (const octave::idx_vector &i)
 
void delete_elements (const octave::idx_vector &i, const octave::idx_vector &j)
 
void delete_elements (int dim, const octave::idx_vector &i)
 
Sparse< T, Allocdiag (octave_idx_type k=0) const
 
octave_idx_type dim1 () const
 
octave_idx_type dim2 () const
 
dim_vector dims () 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, Allocindex (const octave::idx_vector &i, bool resize_ok=false) const
 
Sparse< T, Allocindex (const octave::idx_vector &i, const octave::idx_vector &j, bool resize_ok=false) const
 
bool indices_ok () const
 
Sparse< T, Alloc > & insert (const Sparse< T, Alloc > &a, const Array< octave_idx_type > &idx)
 
Sparse< T, Alloc > & insert (const Sparse< T, Alloc > &a, octave_idx_type r, octave_idx_type c)
 
Sparse< T, Allocipermute (const Array< octave_idx_type > &vec) const
 
bool isempty () const
 
bool issquare () 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, Allocmaybe_compress (bool remove_zeros=false)
 
octave_idx_type ndims () const
 
octave_idx_type nnz () const
 Actual number of nonzero terms. More...
 
octave_idx_type numel () const
 
octave_idx_type nzmax () 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, Alloc > & operator= (const Sparse< T, Alloc > &a)
 
Sparse< T, Allocpermute (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, Allocreshape (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_typeridx () const
 
octave_idx_typeridx (octave_idx_type i)
 
octave_idx_type ridx (octave_idx_type i) const
 
octave_idx_type rows () const
 
Sparse< T, Allocsort (Array< octave_idx_type > &sidx, octave_idx_type dim=0, sortmode mode=ASCENDING) const
 
Sparse< T, Allocsort (octave_idx_type dim=0, sortmode mode=ASCENDING) const
 
Sparse< T, Allocsqueeze () 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, Alloctranspose () const
 
octave_idx_typexcidx ()
 
octave_idx_typexcidx (octave_idx_type i)
 
T * xdata ()
 
T & xdata (octave_idx_type i)
 
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_typexridx (octave_idx_type i)
 

Static Public Member Functions

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

Protected Member Functions

void make_unique ()
 

Protected Attributes

dim_vector m_dimensions
 
Sparse< T, Alloc >::SparseRepm_rep
 

Detailed Description

template<typename T, typename Alloc>
class Sparse< T, Alloc >

Definition at line 46 of file Sparse.h.

Member Typedef Documentation

◆ element_type

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

Definition at line 52 of file Sparse.h.

Constructor & Destructor Documentation

◆ Sparse() [1/14]

template<typename T , typename Alloc >
Sparse< T, Alloc >::Sparse ( )
inline

Definition at line 259 of file Sparse.h.

References Sparse< T, Alloc >::SparseRep::m_count, and Sparse< T, Alloc >::m_rep.

◆ Sparse() [2/14]

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

Definition at line 265 of file Sparse.h.

◆ Sparse() [3/14]

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

Definition at line 269 of file Sparse.h.

◆ Sparse() [4/14]

◆ Sparse() [5/14]

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

Definition at line 275 of file Sparse.h.

◆ Sparse() [6/14]

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

Definition at line 279 of file Sparse.h.

◆ Sparse() [7/14]

template<typename T , typename Alloc >
Sparse< T, Alloc >::Sparse ( const dim_vector dv,
octave_idx_type  nz,
T *  ptr,
octave_idx_type ridx,
octave_idx_type cidx,
const Alloc xallocator = Alloc () 
)
inline

Definition at line 290 of file Sparse.h.

◆ Sparse() [8/14]

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

◆ Sparse() [9/14]

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

Definition at line 303 of file Sparse.h.

◆ Sparse() [10/14]

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

Definition at line 310 of file Sparse.h.

References Sparse< T, Alloc >::SparseRep::m_count, and Sparse< T, Alloc >::m_rep.

◆ Sparse() [11/14]

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

Definition at line 248 of file Sparse.cc.

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

◆ Sparse() [12/14]

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

Definition at line 260 of file Sparse.cc.

References Sparse< T, Alloc >::cols(), and Sparse< T, Alloc >::rows().

◆ Sparse() [13/14]

template<typename T , typename Alloc >
Sparse< T, Alloc >::Sparse ( const Array< T > &  a,
const octave::idx_vector r,
const octave::idx_vector c,
octave_idx_type  nr = -1,
octave_idx_type  nc = -1,
bool  sum_terms = true,
octave_idx_type  nzm = -1 
)

Definition at line 303 of file Sparse.cc.

References r.

◆ Sparse() [14/14]

◆ ~Sparse()

template<typename T , typename Alloc >
Sparse< T, Alloc >::~Sparse
virtual

Definition at line 707 of file Sparse.cc.

Member Function Documentation

◆ any_element_is_nan()

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

◆ array_value()

template<typename T , typename Alloc >
Array< T > Sparse< T, Alloc >::array_value

◆ assign() [1/4]

◆ assign() [2/4]

template<typename T , typename Alloc >
void Sparse< T, Alloc >::assign ( const octave::idx_vector i,
const octave::idx_vector j,
const T &  rhs 
)

Definition at line 2284 of file Sparse.cc.

◆ assign() [3/4]

template<typename T , typename Alloc >
void Sparse< T, Alloc >::assign ( const octave::idx_vector i,
const Sparse< T, Alloc > &  rhs 
)

◆ assign() [4/4]

template<typename T , typename Alloc >
void Sparse< T, Alloc >::assign ( const octave::idx_vector i,
const T &  rhs 
)

Definition at line 2033 of file Sparse.cc.

◆ byte_size()

template<typename T , typename Alloc >
std::size_t Sparse< T, Alloc >::byte_size ( ) const
inline

◆ cat()

◆ change_capacity()

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

◆ checkelem() [1/6]

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

Definition at line 446 of file Sparse.h.

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

◆ checkelem() [2/6]

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

◆ checkelem() [3/6]

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

◆ checkelem() [4/6]

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

◆ checkelem() [5/6]

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

◆ checkelem() [6/6]

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

Definition at line 486 of file Sparse.h.

References n, numel(), Sparse< T, Alloc >::range_error(), and Sparse< T, Alloc >::xelem().

◆ cidx() [1/4]

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

Definition at line 596 of file Sparse.h.

References Sparse< T, Alloc >::SparseRep::m_cidx, Sparse< T, Alloc >::m_rep, and Sparse< T, Alloc >::make_unique().

Referenced by Sparse< T, Alloc >::Sparse(), SparseComplexMatrix::SparseComplexMatrix(), SparseMatrix::SparseMatrix(), SparseComplexMatrix::abs(), octave_sparse_bool_matrix::as_mxArray(), octave_sparse_matrix::as_mxArray(), Sparse< T, Alloc >::assign(), binmap(), Sparse< T, Alloc >::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, Alloc >::delete_elements(), SparseComplexMatrix::determinant(), SparseMatrix::determinant(), elem_xdiv(), elem_xpow(), Fcomplex(), find_nonzero_elem_idx(), Fsymbfact(), Sparse< T, Alloc >::get_col_index(), SparseComplexMatrix::hermitian(), Sparse< T, Alloc >::insert(), SparseComplexMatrix::inverse(), SparseMatrix::inverse(), SparseComplexMatrix::ishermitian(), SparseMatrix::issymmetric(), Sparse< T, Alloc >::map(), SparseComplexMatrix::max(), SparseMatrix::max(), max(), octave_base_sparse< T >::mex_get_jc(), SparseComplexMatrix::min(), SparseMatrix::min(), min(), SparseComplexMatrix::operator!(), SparseMatrix::operator!(), SparseBoolMatrix::operator==(), SparseComplexMatrix::operator==(), SparseMatrix::operator==(), sparse_lu< lu_type >::Pc(), plus_or_minus(), sparse_lu< lu_type >::Pr(), SparseComplexMatrix::prod(), SparseMatrix::prod(), product(), quotient(), 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(), and times_or_divides().

◆ cidx() [2/4]

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

Definition at line 607 of file Sparse.h.

References Sparse< T, Alloc >::SparseRep::m_cidx, and Sparse< T, Alloc >::m_rep.

◆ cidx() [3/4]

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

◆ cidx() [4/4]

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

Definition at line 605 of file Sparse.h.

References Sparse< T, Alloc >::SparseRep::ccidx(), and Sparse< T, Alloc >::m_rep.

◆ cols()

◆ columns()

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

◆ compute_index()

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

Definition at line 734 of file Sparse.cc.

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

◆ data() [1/4]

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

Definition at line 574 of file Sparse.h.

References Sparse< T, Alloc >::SparseRep::m_data, Sparse< T, Alloc >::m_rep, and Sparse< T, Alloc >::make_unique().

Referenced by Sparse< T, Alloc >::Sparse(), sparse_lu< lu_type >::sparse_lu(), 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(), SparseBoolMatrix::any(), 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, Alloc >::assign(), binmap(), Sparse< T, Alloc >::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, Alloc >::delete_elements(), SparseComplexMatrix::determinant(), SparseMatrix::determinant(), elem_xdiv(), elem_xpow(), Fcomplex(), find_nonzero_elem_idx(), Fsymbfact(), SparseComplexMatrix::hermitian(), Sparse< T, Alloc >::insert(), SparseComplexMatrix::ishermitian(), SparseMatrix::issymmetric(), Sparse< T, Alloc >::map(), map_2_xldexp_sparse(), SparseComplexMatrix::max(), SparseMatrix::max(), max(), octave_base_sparse< T >::mex_get_data(), SparseComplexMatrix::min(), SparseMatrix::min(), min(), operator-(), SparseBoolMatrix::operator==(), SparseComplexMatrix::operator==(), SparseMatrix::operator==(), sparse_lu< lu_type >::Pc(), plus_or_minus(), sparse_lu< lu_type >::Pr(), product(), quotient(), read_sparse_matrix(), SparseComplexMatrix::row(), SparseMatrix::row(), octave_sparse_bool_matrix::save_binary(), octave_sparse_complex_matrix::save_binary(), octave_sparse_matrix::save_binary(), Sparse< T, Alloc >::test(), times_or_divide(), and times_or_divides().

◆ data() [2/4]

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

Definition at line 581 of file Sparse.h.

References Sparse< T, Alloc >::SparseRep::m_data, and Sparse< T, Alloc >::m_rep.

◆ data() [3/4]

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

◆ data() [4/4]

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

Definition at line 579 of file Sparse.h.

References Sparse< T, Alloc >::SparseRep::data(), and Sparse< T, Alloc >::m_rep.

◆ delete_elements() [1/3]

template<typename T , typename Alloc >
void Sparse< T, Alloc >::delete_elements ( const octave::idx_vector i)

Definition at line 1198 of file Sparse.cc.

References err_del_index_out_of_range(), and numel().

◆ delete_elements() [2/3]

template<typename T , typename Alloc >
void Sparse< T, Alloc >::delete_elements ( const octave::idx_vector i,
const octave::idx_vector j 
)

◆ delete_elements() [3/3]

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

Definition at line 1421 of file Sparse.cc.

References current_liboctave_error_handler.

◆ diag()

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

Definition at line 2493 of file Sparse.cc.

References d.

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

◆ dim1()

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

◆ dim2()

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

◆ dims()

◆ elem() [1/6]

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

Definition at line 468 of file Sparse.h.

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

◆ elem() [2/6]

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

Definition at line 516 of file Sparse.h.

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

◆ elem() [3/6]

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

Definition at line 462 of file Sparse.h.

References Sparse< T, Alloc >::make_unique(), and Sparse< T, Alloc >::xelem().

◆ elem() [4/6]

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

Definition at line 514 of file Sparse.h.

References Sparse< T, Alloc >::xelem().

◆ elem() [5/6]

template<typename T , typename Alloc >
T& Sparse< T, Alloc >::elem ( octave_idx_type  n)
inline

◆ elem() [6/6]

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

Definition at line 512 of file Sparse.h.

References n, and Sparse< T, Alloc >::xelem().

◆ get_col_index()

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

Definition at line 356 of file Sparse.h.

References Sparse< T, Alloc >::cidx().

◆ get_row_index()

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

Definition at line 355 of file Sparse.h.

References Sparse< T, Alloc >::ridx().

◆ index() [1/2]

template<typename T , typename Alloc >
Sparse< T, Alloc > Sparse< T, Alloc >::index ( const octave::idx_vector i,
bool  resize_ok = false 
) const

◆ index() [2/2]

template<typename T , typename Alloc >
Sparse< T, Alloc > Sparse< T, Alloc >::index ( const octave::idx_vector i,
const octave::idx_vector j,
bool  resize_ok = false 
) const

Definition at line 1635 of file Sparse.cc.

References Sparse< T, Alloc >::index(), m, n, and Sparse< T, Alloc >::resize().

◆ indices_ok()

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

◆ insert() [1/2]

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

Definition at line 1127 of file Sparse.cc.

References octave_base_value::numel(), and ra_idx.

◆ insert() [2/2]

◆ ipermute()

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

Definition at line 545 of file Sparse.h.

References Sparse< T, Alloc >::permute().

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

◆ isempty()

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

Definition at line 570 of file Sparse.h.

References Sparse< T, Alloc >::cols(), and Sparse< T, Alloc >::rows().

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

◆ issquare()

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

Definition at line 568 of file Sparse.h.

References Sparse< T, Alloc >::dim1(), and Sparse< T, Alloc >::dim2().

◆ make_unique()

◆ map() [1/3]

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

◆ map() [2/3]

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

Definition at line 746 of file Sparse.h.

◆ map() [3/3]

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

Definition at line 741 of file Sparse.h.

◆ maybe_compress()

◆ ndims()

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

◆ nnz()

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

Actual number of nonzero terms.

Definition at line 339 of file Sparse.h.

References Sparse< T, Alloc >::m_rep, and Sparse< T, Alloc >::SparseRep::nnz().

Referenced by MatrixType::MatrixType(), 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, Alloc >::SparseRep::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, Alloc >::assign(), binmap(), Sparse< T, Alloc >::cat(), Sparse< T, Alloc >::change_capacity(), Sparse< T, Alloc >::delete_elements(), elem_xpow(), Fccolamd(), Fcolamd(), Fcomplex(), find_nonzero_elem_idx(), Fsymbfact(), SparseComplexMatrix::hermitian(), octave_sparse_matrix::index_vector(), Sparse< T, Alloc >::insert(), SparseComplexMatrix::inverse(), SparseMatrix::inverse(), Sparse< T, Alloc >::map(), map_2_xldexp_sparse(), 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(), Sparse< T, Alloc >::test(), times_or_divide(), and times_or_divides().

◆ numel()

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

◆ nzmax()

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

Amount of storage for nonzero elements.

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

Definition at line 336 of file Sparse.h.

References Sparse< T, Alloc >::m_rep, and Sparse< T, Alloc >::SparseRep::nzmax().

Referenced by Sparse< T, Alloc >::byte_size(), octave_base_sparse< T >::nzmax(), and read_sparse_matrix().

◆ operator()() [1/6]

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

Definition at line 481 of file Sparse.h.

◆ operator()() [2/6]

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

Definition at line 526 of file Sparse.h.

◆ operator()() [3/6]

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

Definition at line 476 of file Sparse.h.

◆ operator()() [4/6]

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

Definition at line 521 of file Sparse.h.

◆ operator()() [5/6]

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

Definition at line 471 of file Sparse.h.

◆ operator()() [6/6]

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

Definition at line 519 of file Sparse.h.

◆ operator=()

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

◆ permute()

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

◆ print_info()

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

Definition at line 3095 of file Sparse.cc.

◆ range_error() [1/6]

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

Definition at line 823 of file Sparse.cc.

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

◆ range_error() [2/6]

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

Definition at line 798 of file Sparse.cc.

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

◆ range_error() [3/6]

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

Definition at line 787 of file Sparse.cc.

◆ range_error() [4/6]

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

Definition at line 776 of file Sparse.cc.

◆ range_error() [5/6]

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

Definition at line 767 of file Sparse.cc.

References n.

◆ range_error() [6/6]

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

Definition at line 758 of file Sparse.cc.

References n.

Referenced by Sparse< T, Alloc >::checkelem().

◆ reshape()

◆ resize() [1/2]

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

Definition at line 980 of file Sparse.cc.

References n, and dim_vector::ndims().

◆ resize() [2/2]

◆ resize1()

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

Definition at line 960 of file Sparse.cc.

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

◆ ridx() [1/4]

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

Definition at line 583 of file Sparse.h.

References Sparse< T, Alloc >::m_rep, Sparse< T, Alloc >::SparseRep::m_ridx, and Sparse< T, Alloc >::make_unique().

Referenced by Sparse< T, Alloc >::Sparse(), SparseComplexMatrix::SparseComplexMatrix(), SparseMatrix::SparseMatrix(), SparseBoolMatrix::any(), octave_sparse_bool_matrix::as_mxArray(), octave_sparse_complex_matrix::as_mxArray(), octave_sparse_matrix::as_mxArray(), Sparse< T, Alloc >::assign(), binmap(), Sparse< T, Alloc >::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, Alloc >::delete_elements(), SparseComplexMatrix::determinant(), SparseMatrix::determinant(), elem_xdiv(), elem_xpow(), Fcomplex(), find_nonzero_elem_idx(), Fsymbfact(), Sparse< T, Alloc >::get_row_index(), SparseComplexMatrix::hermitian(), Sparse< T, Alloc >::insert(), SparseComplexMatrix::inverse(), SparseMatrix::inverse(), SparseComplexMatrix::ishermitian(), SparseMatrix::issymmetric(), Sparse< T, Alloc >::map(), SparseComplexMatrix::max(), SparseMatrix::max(), max(), octave_base_sparse< T >::mex_get_ir(), SparseComplexMatrix::min(), SparseMatrix::min(), min(), SparseComplexMatrix::operator!(), SparseMatrix::operator!(), SparseBoolMatrix::operator==(), SparseComplexMatrix::operator==(), SparseMatrix::operator==(), sparse_lu< lu_type >::Pc(), plus_or_minus(), sparse_lu< lu_type >::Pr(), product(), quotient(), read_sparse_matrix(), SparseComplexMatrix::row(), SparseMatrix::row(), octave_sparse_bool_matrix::save_binary(), octave_sparse_complex_matrix::save_binary(), octave_sparse_matrix::save_binary(), SparseBoolMatrix::sum(), times_or_divide(), and times_or_divides().

◆ ridx() [2/4]

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

Definition at line 594 of file Sparse.h.

References Sparse< T, Alloc >::m_rep, and Sparse< T, Alloc >::SparseRep::m_ridx.

◆ ridx() [3/4]

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

◆ ridx() [4/4]

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

Definition at line 592 of file Sparse.h.

References Sparse< T, Alloc >::SparseRep::cridx(), and Sparse< T, Alloc >::m_rep.

◆ rows()

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

◆ sort() [1/2]

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

◆ sort() [2/2]

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

◆ squeeze()

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

Definition at line 373 of file Sparse.h.

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

◆ test()

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

Definition at line 656 of file Sparse.h.

References Sparse< T, Alloc >::data(), and Sparse< T, Alloc >::nnz().

◆ test_all() [1/3]

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

Definition at line 680 of file Sparse.h.

◆ test_all() [2/3]

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

Definition at line 677 of file Sparse.h.

◆ test_all() [3/3]

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

Definition at line 667 of file Sparse.h.

◆ test_any() [1/3]

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

Definition at line 674 of file Sparse.h.

◆ test_any() [2/3]

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

Definition at line 671 of file Sparse.h.

◆ test_any() [3/3]

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

◆ transpose()

template<typename T , typename Alloc >
Sparse< T, Alloc > Sparse< T, Alloc >::transpose

◆ xcidx() [1/2]

◆ xcidx() [2/2]

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

Definition at line 603 of file Sparse.h.

References Sparse< T, Alloc >::SparseRep::cidx(), and Sparse< T, Alloc >::m_rep.

◆ xdata() [1/2]

◆ xdata() [2/2]

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

Definition at line 577 of file Sparse.h.

References Sparse< T, Alloc >::SparseRep::data(), and Sparse< T, Alloc >::m_rep.

◆ xelem() [1/6]

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

Definition at line 415 of file Sparse.h.

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

◆ xelem() [2/6]

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

Definition at line 418 of file Sparse.h.

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

◆ xelem() [3/6]

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

Definition at line 409 of file Sparse.h.

References Sparse< T, Alloc >::SparseRep::elem(), and Sparse< T, Alloc >::m_rep.

◆ xelem() [4/6]

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

Definition at line 410 of file Sparse.h.

References Sparse< T, Alloc >::SparseRep::celem(), and Sparse< T, Alloc >::m_rep.

◆ xelem() [5/6]

template<typename T , typename Alloc >
T& Sparse< T, Alloc >::xelem ( octave_idx_type  n)
inline

◆ xelem() [6/6]

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

Definition at line 402 of file Sparse.h.

References n, Sparse< T, Alloc >::rows(), and Sparse< T, Alloc >::xelem().

◆ xridx() [1/2]

◆ xridx() [2/2]

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

Definition at line 590 of file Sparse.h.

References Sparse< T, Alloc >::m_rep, and Sparse< T, Alloc >::SparseRep::ridx().

Member Data Documentation

◆ m_dimensions

◆ m_rep


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