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

#include "MSparse.h"

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

Public Member Functions

 MSparse ()
 
 MSparse (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)
 
 MSparse (const dim_vector &dv, octave_idx_type nz=0)
 
 MSparse (const MSparse< T > &a)
 
 MSparse (const MSparse< T > &a, const dim_vector &dv)
 
 MSparse (const PermMatrix &a)
 
 MSparse (const Sparse< T > &a)
 
template<typename U >
 MSparse (const Sparse< U > &a)
 
 MSparse (octave_idx_type n, octave_idx_type m)
 
 MSparse (octave_idx_type r, octave_idx_type c, octave_idx_type num_nz)
 
 MSparse (octave_idx_type r, octave_idx_type c, T val)
 
 ~MSparse ()=default
 
MSparse< T > diag (octave_idx_type k=0) const
 
MSparse< T > & insert (const Sparse< T > &a, const Array< octave_idx_type > &indx)
 
MSparse< T > & insert (const Sparse< T > &a, octave_idx_type r, octave_idx_type c)
 
MSparse< T > ipermute (const Array< octave_idx_type > &vec) const
 
template<typename U >
Sparse< U > map (U(&fcn)(const T &)) const
 
template<typename U >
Sparse< U > map (U(&fcn)(T)) const
 
MSparse< T > & operator= (const MSparse< T > &a)
 
MSparse< T > permute (const Array< octave_idx_type > &vec, bool inv=false) const
 
MSparse< T > reshape (const dim_vector &new_dims) const
 
MSparse< T > squeeze () const
 
MSparse< T > transpose () const
 
- Public Member Functions inherited from Sparse< T >
 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)
 
 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
 
Sparse< U > map (F fcn) const
 
Sparse< U > map (U(&fcn)(const T &)) const
 
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
 
bool test (F fcn) const
 
bool test_all (bool(&fcn)(const T &)) const
 
bool test_all (bool(&fcn)(T)) const
 
bool test_all (F fcn) const
 
bool test_any (bool(&fcn)(const T &)) const
 
bool test_any (bool(&fcn)(T)) const
 
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)
 

Additional Inherited Members

- Public Types inherited from Sparse< T >
typedef T element_type
 
- Static Public Member Functions inherited from Sparse< T >
static Sparse< T, Alloccat (int dim, octave_idx_type n, const Sparse< T, Alloc > *sparse_list)
 
- Protected Member Functions inherited from Sparse< T >
void make_unique ()
 
- Protected Attributes inherited from Sparse< T >
dim_vector m_dimensions
 
Sparse< T, Alloc >::SparseRep * m_rep
 

Detailed Description

template<typename T>
class MSparse< T >

Definition at line 43 of file MSparse.h.

Constructor & Destructor Documentation

◆ MSparse() [1/11]

template<typename T >
MSparse< T >::MSparse ( )
inline

Definition at line 49 of file MSparse.h.

◆ MSparse() [2/11]

template<typename T >
MSparse< T >::MSparse ( octave_idx_type  n,
octave_idx_type  m 
)
inline

Definition at line 51 of file MSparse.h.

◆ MSparse() [3/11]

template<typename T >
MSparse< T >::MSparse ( const dim_vector dv,
octave_idx_type  nz = 0 
)
inline

Definition at line 53 of file MSparse.h.

◆ MSparse() [4/11]

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

Definition at line 56 of file MSparse.h.

◆ MSparse() [5/11]

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

Definition at line 58 of file MSparse.h.

◆ MSparse() [6/11]

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

Definition at line 60 of file MSparse.h.

◆ MSparse() [7/11]

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

Definition at line 63 of file MSparse.h.

◆ MSparse() [8/11]

template<typename T >
MSparse< T >::MSparse ( 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 
)
inline

Definition at line 65 of file MSparse.h.

◆ MSparse() [9/11]

template<typename T >
MSparse< T >::MSparse ( octave_idx_type  r,
octave_idx_type  c,
val 
)
inlineexplicit

Definition at line 70 of file MSparse.h.

◆ MSparse() [10/11]

template<typename T >
MSparse< T >::MSparse ( const PermMatrix a)
inlineexplicit

Definition at line 73 of file MSparse.h.

◆ MSparse() [11/11]

template<typename T >
MSparse< T >::MSparse ( octave_idx_type  r,
octave_idx_type  c,
octave_idx_type  num_nz 
)
inline

Definition at line 75 of file MSparse.h.

◆ ~MSparse()

template<typename T >
MSparse< T >::~MSparse ( )
default

Member Function Documentation

◆ diag()

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

Definition at line 111 of file MSparse.h.

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

Referenced by SparseComplexMatrix::diag(), and SparseMatrix::diag().

◆ insert() [1/2]

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

Definition at line 92 of file MSparse.h.

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

◆ insert() [2/2]

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

Definition at line 86 of file MSparse.h.

References Sparse< T, Alloc >::insert(), and r.

Referenced by SparseComplexMatrix::insert(), and SparseMatrix::insert().

◆ ipermute()

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

Definition at line 108 of file MSparse.h.

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

Referenced by SparseComplexMatrix::ipermute(), and SparseMatrix::ipermute().

◆ map() [1/2]

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

Definition at line 124 of file MSparse.h.

◆ map() [2/2]

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

Definition at line 119 of file MSparse.h.

◆ operator=()

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

Definition at line 80 of file MSparse.h.

References Sparse< T, Alloc >::operator=().

Referenced by SparseComplexMatrix::operator=(), and SparseMatrix::operator=().

◆ permute()

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

Definition at line 105 of file MSparse.h.

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

Referenced by SparseComplexMatrix::permute(), and SparseMatrix::permute().

◆ reshape()

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

Definition at line 102 of file MSparse.h.

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

Referenced by SparseComplexMatrix::reshape(), and SparseMatrix::reshape().

◆ squeeze()

template<typename T >
MSparse<T> MSparse< T >::squeeze ( ) const
inline

Definition at line 100 of file MSparse.h.

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

Referenced by SparseComplexMatrix::squeeze(), and SparseMatrix::squeeze().

◆ transpose()

template<typename T >
MSparse<T> MSparse< T >::transpose ( ) const
inline

Definition at line 98 of file MSparse.h.

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

Referenced by SparseComplexMatrix::transpose(), and SparseMatrix::transpose().


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