PLaSK library
Loading...
Searching...
No Matches
TNT::Sparse_Matrix_CompRow< T > Class Template Reference

Read-only view of a sparse matrix in compressed-row storage format. More...

#include <solvers/gain/wasiak/wzmocnienie/tnt/tnt_sparse_matrix_csr.h>

Public Member Functions

 Sparse_Matrix_CompRow (const Sparse_Matrix_CompRow &S)
 
 Sparse_Matrix_CompRow (int M, int N, int nz, const T *val, const int *r, const int *c)
 Construct a read-only view of existing sparse matrix in compressed-row storage format.
 
const T & val (int i) const
 
const int & row_ptr (int i) const
 
const int & col_ind (int i) const
 
int dim1 () const
 
int dim2 () const
 
int NumNonzeros () const
 
Sparse_Matrix_CompRowoperator= (const Sparse_Matrix_CompRow &R)
 

Detailed Description

template<class T>
class TNT::Sparse_Matrix_CompRow< T >

Read-only view of a sparse matrix in compressed-row storage format.

Neither array elements (nonzeros) nor sparsity structure can be modified. If modifications are required, create a new view.

Index values begin at 0.

Storage requirements: An (m x n) matrix with nz nonzeros requires no more than ((T+I)*nz + M*I) bytes, where T is the size of data elements and I is the size of integers.

Definition at line 48 of file tnt_sparse_matrix_csr.h.

Constructor & Destructor Documentation

◆ Sparse_Matrix_CompRow() [1/2]

template<class T >
TNT::Sparse_Matrix_CompRow< T >::Sparse_Matrix_CompRow ( const Sparse_Matrix_CompRow< T > &  S)

◆ Sparse_Matrix_CompRow() [2/2]

template<class T >
TNT::Sparse_Matrix_CompRow< T >::Sparse_Matrix_CompRow ( int  M,
int  N,
int  nz,
const T *  val,
const int *  r,
const int *  c 
)

Construct a read-only view of existing sparse matrix in compressed-row storage format.

Parameters
Mthe number of rows of sparse matrix
Nthe number of columns of sparse matrix
nzthe number of nonzeros
vala contiguous list of nonzero values
rrow-pointers: r[i] denotes the begining position of row i (i.e. the ith row begins at val[row[i]]).
ccolumn-indices: c[i] denotes the column location of val[i]

Definition at line 95 of file tnt_sparse_matrix_csr.h.

Member Function Documentation

◆ col_ind()

template<class T >
const int & TNT::Sparse_Matrix_CompRow< T >::col_ind ( int  i) const
inline

Definition at line 68 of file tnt_sparse_matrix_csr.h.

◆ dim1()

template<class T >
int TNT::Sparse_Matrix_CompRow< T >::dim1 ( ) const
inline

Definition at line 70 of file tnt_sparse_matrix_csr.h.

◆ dim2()

template<class T >
int TNT::Sparse_Matrix_CompRow< T >::dim2 ( ) const
inline

Definition at line 71 of file tnt_sparse_matrix_csr.h.

◆ NumNonzeros()

template<class T >
int TNT::Sparse_Matrix_CompRow< T >::NumNonzeros ( ) const
inline

Definition at line 72 of file tnt_sparse_matrix_csr.h.

◆ operator=()

template<class T >
Sparse_Matrix_CompRow & TNT::Sparse_Matrix_CompRow< T >::operator= ( const Sparse_Matrix_CompRow< T > &  R)

◆ row_ptr()

template<class T >
const int & TNT::Sparse_Matrix_CompRow< T >::row_ptr ( int  i) const
inline

Definition at line 67 of file tnt_sparse_matrix_csr.h.

◆ val()

template<class T >
const T & TNT::Sparse_Matrix_CompRow< T >::val ( int  i) const
inline

Definition at line 66 of file tnt_sparse_matrix_csr.h.


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