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

#include "Sparse.h"

Inheritance diagram for Sparse< T, Alloc >::SparseRep:
Alloc

Public Types

typedef std::allocator_traits< AllocAlloc_traits
 
typedef Alloc_traits::template rebind_traits< octave_idx_typeidx_type_Alloc_traits
 
typedef idx_type_Alloc_traits::pointer idx_type_pointer
 
typedef Alloc_traits::template rebind_traits< T > T_Alloc_traits
 
typedef T_Alloc_traits::pointer T_pointer
 

Public Member Functions

 SparseRep ()
 
template<typename U >
 SparseRep (const dim_vector &dv, octave_idx_type nz, U *d, octave_idx_type *r, octave_idx_type *c, const Alloc &xallocator=Alloc())
 
 SparseRep (const SparseRep &a)
 
 SparseRep (octave_idx_type n)
 
 SparseRep (octave_idx_type nr, octave_idx_type nc, octave_idx_type nz, const T *d, const octave_idx_type *r, const octave_idx_type *c)
 
template<typename U >
 SparseRep (octave_idx_type nr, octave_idx_type nc, octave_idx_type nz, const U *d, const octave_idx_type *r, const octave_idx_type *c)
 
 SparseRep (octave_idx_type nr, octave_idx_type nc, octave_idx_type nz=1)
 
 ~SparseRep ()
 
bool any_element_is_nan () const
 
octave_idx_type ccidx (octave_idx_type i) const
 
cdata (octave_idx_type i) const
 
celem (octave_idx_type r, octave_idx_type c) const
 
void change_length (octave_idx_type nz)
 
octave_idx_typecidx (octave_idx_type i)
 
octave_idx_type cols () const
 
octave_idx_type columns () const
 
octave_idx_type cridx (octave_idx_type i) const
 
T & data (octave_idx_type i)
 
T & elem (octave_idx_type r, octave_idx_type c)
 
idx_type_pointer idx_type_allocate (size_t len)
 
void idx_type_deallocate (idx_type_pointer idx, size_t len)
 
bool indices_ok () const
 
octave_idx_type length () const
 
void maybe_compress (bool remove_zeros)
 
octave_idx_type nnz () const
 
octave_idx_type nzmax () const
 
SparseRepoperator= (const SparseRep &)=delete
 
octave_idx_typeridx (octave_idx_type i)
 
octave_idx_type rows () const
 
T_pointer T_allocate (size_t len)
 
void T_deallocate (T_pointer data, size_t len)
 

Public Attributes

idx_type_pointer m_cidx
 
octave::refcount< octave_idx_typem_count
 
T_pointer m_data
 
octave_idx_type m_ncols
 
octave_idx_type m_nrows
 
octave_idx_type m_nzmax
 
idx_type_pointer m_ridx
 

Friends

template<typename U , typename A >
class Sparse
 

Detailed Description

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

Definition at line 59 of file Sparse.h.

Member Typedef Documentation

◆ Alloc_traits

template<typename T , typename Alloc >
typedef std::allocator_traits<Alloc> Sparse< T, Alloc >::SparseRep::Alloc_traits

Definition at line 63 of file Sparse.h.

◆ idx_type_Alloc_traits

template<typename T , typename Alloc >
typedef Alloc_traits::template rebind_traits<octave_idx_type> Sparse< T, Alloc >::SparseRep::idx_type_Alloc_traits

Definition at line 68 of file Sparse.h.

◆ idx_type_pointer

template<typename T , typename Alloc >
typedef idx_type_Alloc_traits::pointer Sparse< T, Alloc >::SparseRep::idx_type_pointer

Definition at line 69 of file Sparse.h.

◆ T_Alloc_traits

template<typename T , typename Alloc >
typedef Alloc_traits::template rebind_traits<T> Sparse< T, Alloc >::SparseRep::T_Alloc_traits

Definition at line 65 of file Sparse.h.

◆ T_pointer

template<typename T , typename Alloc >
typedef T_Alloc_traits::pointer Sparse< T, Alloc >::SparseRep::T_pointer

Definition at line 66 of file Sparse.h.

Constructor & Destructor Documentation

◆ SparseRep() [1/7]

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

Definition at line 79 of file Sparse.h.

◆ SparseRep() [2/7]

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

Definition at line 85 of file Sparse.h.

◆ SparseRep() [3/7]

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

Definition at line 91 of file Sparse.h.

◆ SparseRep() [4/7]

template<typename T , typename Alloc >
Sparse< T, Alloc >::SparseRep::SparseRep ( octave_idx_type  nr,
octave_idx_type  nc,
octave_idx_type  nz,
const T *  d,
const octave_idx_type r,
const octave_idx_type c 
)
inline

Definition at line 98 of file Sparse.h.

References d, and r.

◆ SparseRep() [5/7]

template<typename T , typename Alloc >
template<typename U >
Sparse< T, Alloc >::SparseRep::SparseRep ( octave_idx_type  nr,
octave_idx_type  nc,
octave_idx_type  nz,
const U *  d,
const octave_idx_type r,
const octave_idx_type c 
)
inline

Definition at line 111 of file Sparse.h.

References d, and r.

◆ SparseRep() [6/7]

template<typename T , typename Alloc >
template<typename U >
Sparse< T, Alloc >::SparseRep::SparseRep ( const dim_vector dv,
octave_idx_type  nz,
U *  d,
octave_idx_type r,
octave_idx_type c,
const Alloc xallocator = Alloc () 
)
inline

Definition at line 124 of file Sparse.h.

◆ SparseRep() [7/7]

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

◆ ~SparseRep()

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

Definition at line 144 of file Sparse.h.

Member Function Documentation

◆ any_element_is_nan()

template<typename T , typename Alloc >
bool Sparse< T, Alloc >::SparseRep::any_element_is_nan

Definition at line 187 of file Sparse.cc.

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

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

◆ ccidx()

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

Definition at line 172 of file Sparse.h.

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

◆ cdata()

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

Definition at line 164 of file Sparse.h.

◆ celem()

template<typename T , typename Alloc >
T Sparse< T, Alloc >::SparseRep::celem ( octave_idx_type  r,
octave_idx_type  c 
) const

Definition at line 108 of file Sparse.cc.

References r.

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

◆ change_length()

template<typename T , typename Alloc >
void Sparse< T, Alloc >::SparseRep::change_length ( octave_idx_type  nz)

Definition at line 145 of file Sparse.cc.

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

◆ cidx()

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

Definition at line 170 of file Sparse.h.

Referenced by Sparse< T, Alloc >::cidx(), and Sparse< T, Alloc >::xcidx().

◆ cols()

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

Definition at line 155 of file Sparse.h.

◆ columns()

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

Definition at line 156 of file Sparse.h.

◆ cridx()

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

Definition at line 168 of file Sparse.h.

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

◆ data()

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

◆ elem()

◆ idx_type_allocate()

template<typename T , typename Alloc >
idx_type_pointer Sparse< T, Alloc >::SparseRep::idx_type_allocate ( size_t  len)
inline

Definition at line 211 of file Sparse.h.

References len.

◆ idx_type_deallocate()

template<typename T , typename Alloc >
void Sparse< T, Alloc >::SparseRep::idx_type_deallocate ( idx_type_pointer  idx,
size_t  len 
)
inline

Definition at line 222 of file Sparse.h.

References len.

◆ indices_ok()

template<typename T , typename Alloc >
bool Sparse< T, Alloc >::SparseRep::indices_ok

Definition at line 179 of file Sparse.cc.

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

◆ length()

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

Definition at line 183 of file Sparse.h.

◆ maybe_compress()

template<typename T , typename Alloc >
void Sparse< T, Alloc >::SparseRep::maybe_compress ( bool  remove_zeros)

Definition at line 120 of file Sparse.cc.

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

◆ nnz()

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

Definition at line 152 of file Sparse.h.

Referenced by Sparse< T, Alloc >::SparseRep::SparseRep(), and Sparse< T, Alloc >::nnz().

◆ nzmax()

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

Definition at line 151 of file Sparse.h.

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

◆ operator=()

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

◆ ridx()

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

Definition at line 166 of file Sparse.h.

Referenced by Sparse< T, Alloc >::ridx(), and Sparse< T, Alloc >::xridx().

◆ rows()

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

Definition at line 154 of file Sparse.h.

◆ T_allocate()

template<typename T , typename Alloc >
T_pointer Sparse< T, Alloc >::SparseRep::T_allocate ( size_t  len)
inline

Definition at line 191 of file Sparse.h.

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

◆ T_deallocate()

template<typename T , typename Alloc >
void Sparse< T, Alloc >::SparseRep::T_deallocate ( T_pointer  data,
size_t  len 
)
inline

Definition at line 202 of file Sparse.h.

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

Friends And Related Function Documentation

◆ Sparse

template<typename T , typename Alloc >
template<typename U , typename A >
friend class Sparse
friend

Definition at line 185 of file Sparse.h.

Member Data Documentation

◆ m_cidx

template<typename T , typename Alloc >
idx_type_pointer Sparse< T, Alloc >::SparseRep::m_cidx

◆ m_count

template<typename T , typename Alloc >
octave::refcount<octave_idx_type> Sparse< T, Alloc >::SparseRep::m_count

◆ m_data

template<typename T , typename Alloc >
T_pointer Sparse< T, Alloc >::SparseRep::m_data

◆ m_ncols

template<typename T , typename Alloc >
octave_idx_type Sparse< T, Alloc >::SparseRep::m_ncols

Definition at line 76 of file Sparse.h.

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

◆ m_nrows

template<typename T , typename Alloc >
octave_idx_type Sparse< T, Alloc >::SparseRep::m_nrows

Definition at line 75 of file Sparse.h.

◆ m_nzmax

template<typename T , typename Alloc >
octave_idx_type Sparse< T, Alloc >::SparseRep::m_nzmax

Definition at line 74 of file Sparse.h.

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

◆ m_ridx

template<typename T , typename Alloc >
idx_type_pointer Sparse< T, Alloc >::SparseRep::m_ridx

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