Feellgood
Public Member Functions | Private Types | Private Attributes | Friends | List of all members
algebra::w_sparseMat Class Reference

Write-mode sparse matrix. More...

#include <sparseMat.h>

Public Member Functions

 w_sparseMat (int N)
 
void insert (const int i, const int j, const double val)
 

Private Types

using SparseVector = std::map< int, double >
 

Private Attributes

std::vector< SparseVectorrows
 

Friends

class r_sparseMat
 

Detailed Description

Write-mode sparse matrix.

This is a container for matrix elements that can be modified by inserting elements at arbitrary locations.

Member Typedef Documentation

◆ SparseVector

using algebra::w_sparseMat::SparseVector = std::map<int, double>
private

Write-mode sparse vector. This is an (index -> value) map.

Constructor & Destructor Documentation

◆ w_sparseMat()

algebra::w_sparseMat::w_sparseMat ( int  N)
inline

Constructor. N is the matrix size: this is a square N×N matrix.

Member Function Documentation

◆ insert()

void algebra::w_sparseMat::insert ( const int  i,
const int  j,
const double  val 
)
inline

Insert a matrix element with value val, at row i, column j. If an element already exists at this position, add val to its value.

The caller must ensure both indices lie within [0, N).


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