Feellgood
|
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< SparseVector > | rows |
Friends | |
class | r_sparseMat |
Write-mode sparse matrix.
This is a container for matrix elements that can be modified by inserting elements at arbitrary locations.
|
private |
Write-mode sparse vector. This is an (index -> value) map.
|
inline |
Constructor. N is the matrix size: this is a square N×N matrix.
|
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).