RINGMesh  Version 5.0.0
A programming library for geological model meshes
RINGMesh::SparseMatrix< T, heavy > Class Template Reference

#include <matrix.h>

Inheritance diagram for RINGMesh::SparseMatrix< T, heavy >:
RINGMesh::SparseMatrixImpl< T, index_t >

Public Types

using thisclass = SparseMatrix< T, heavy >
 
- Public Types inherited from RINGMesh::SparseMatrixImpl< T, index_t >
using Row = RowImpl< index_t >
 

Public Member Functions

 SparseMatrix (bool is_symetrical=false)
 
void set_element (index_t i, index_t j, const T &value)
 
get_element (index_t i, index_t j) const
 
get_element_in_line (index_t i, index_t e) const
 
- Public Member Functions inherited from RINGMesh::SparseMatrixImpl< T, index_t >
 SparseMatrixImpl (bool is_symmetrical=false)
 
 ~SparseMatrixImpl ()=default
 
bool exist (index_t i, index_t j) const
 
index_t get_nb_elements_in_line (index_t i) const
 gets number of elements within a row More...
 
index_t get_column_in_line (index_t i, index_t e) const
 gets the j that correspond to the given index within the row More...
 
std::tuple< bool, index_t > get_index_in_line (index_t i, index_t j) const
 gets the rows_ index corresponding to a given i-j couple More...
 
index_t ni () const
 
index_t nj () const
 
bool is_symmetrical () const
 
void build_matrix (index_t ni, index_t nj)
 
get_element_in_line (index_t i, index_t e) const
 

Private Member Functions

index_t get_value_id (index_t i, index_t j)
 

Private Attributes

std::deque< T > values_ {}
 

Additional Inherited Members

- Protected Attributes inherited from RINGMesh::SparseMatrixImpl< T, index_t >
std::unique_ptr< Row[] > rows_
 
index_t ni_
 
index_t nj_
 
bool is_symmetrical_
 

Detailed Description

template<typename T>
class RINGMesh::SparseMatrix< T, heavy >

specialization of SparseMatrix for MatrixType "heavy" , the main difference with light is that here we store only one copy of the data in the case of a symmetrical matrix. The data are stored in a std::deque and the rows contains the ids of the values within the deque.

Definition at line 415 of file matrix.h.

Member Typedef Documentation

◆ thisclass

template<typename T >
using RINGMesh::SparseMatrix< T, heavy >::thisclass = SparseMatrix< T, heavy >

Definition at line 418 of file matrix.h.

Constructor & Destructor Documentation

◆ SparseMatrix()

template<typename T >
RINGMesh::SparseMatrix< T, heavy >::SparseMatrix ( bool  is_symetrical = false)
inlineexplicit

Definition at line 419 of file matrix.h.

Member Function Documentation

◆ get_element()

template<typename T >
T RINGMesh::SparseMatrix< T, heavy >::get_element ( index_t  i,
index_t  j 
) const
inline

Definition at line 458 of file matrix.h.

◆ get_element_in_line()

template<typename T >
T RINGMesh::SparseMatrix< T, heavy >::get_element_in_line ( index_t  i,
index_t  e 
) const
inline

get the value of e-element (index within the row, not in the matrix) on line i

Parameters
[in]irow index
[in]eindex within the row
Returns
value to retrieve

Definition at line 478 of file matrix.h.

◆ get_value_id()

template<typename T >
index_t RINGMesh::SparseMatrix< T, heavy >::get_value_id ( index_t  i,
index_t  j 
)
inlineprivate

Definition at line 485 of file matrix.h.

◆ set_element()

template<typename T >
void RINGMesh::SparseMatrix< T, heavy >::set_element ( index_t  i,
index_t  j,
const T &  value 
)
inline

set the value of element i-j in the matrix

Parameters
[in]irow index
[in]jcolumn index
[in]valueto store

Definition at line 430 of file matrix.h.

Member Data Documentation

◆ values_

template<typename T >
std::deque< T > RINGMesh::SparseMatrix< T, heavy >::values_ {}
private

Definition at line 491 of file matrix.h.


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