Feellgood
Classes | Namespaces | Typedefs
sparseMat.h File Reference

Sparse matrices. More...

#include <set>
#include <map>
#include <vector>
#include <iostream>
#include <cassert>
#include <algorithm>
#include <execution>
#include <mutex>
#include "algebraCore.h"

Go to the source code of this file.

Classes

class  algebra::w_sparseMat
 Write-mode sparse matrix. More...
 
class  algebra::r_sparseMat
 Read-mode square sparse matrix. More...
 
struct  algebra::r_sparseMat::SparseVector
 

Namespaces

 algebra
 

Typedefs

using algebra::MatrixShape = std::vector< std::set< int > >
 

Detailed Description

Sparse matrices.

The main class provided here is r_sparseMat, a "read-mode" square sparse matrix. It is meant to efficiently compute matrix-vector products, where the vectors are full (not sparse), represented as std::vector<double>. Such a matrix can be constructed in two ways:

Once constructed, the set of valid index pairs is immutable. However, the associated values can be modified with clear() and add(). Rewriting the values this way is way more efficient than reconstructing the matrix from scratch.