linearAlgebraSolverLib
Loading...
Searching...
No Matches
linearAlgebraLib::SparseMatrixCSR Class Reference

A matrix class with overloaded operators to facilitate arithmetic matrix operations. More...

#include <sparseMatrixCSR.hpp>

Public Member Functions

Constructors and destructors
LINEARALGEBRALIB_EXPORT SparseMatrixCSR (unsigned rows, unsigned _columns)
 
Getters and setters
LINEARALGEBRALIB_EXPORT void set (unsigned row, unsigned column, double value)
 
LINEARALGEBRALIB_EXPORT double get (unsigned row, unsigned column) const
 
LINEARALGEBRALIB_EXPORT unsigned getNumberOfRows () const
 
LINEARALGEBRALIB_EXPORT unsigned getNumberOfColumns () const
 

Overloaded operators

LINEARALGEBRALIB_EXPORT Vector operator* (const Vector &rhs)
 
LINEARALGEBRALIB_EXPORT friend SparseMatrixCSR operator* (const double &scaleFactor, const SparseMatrixCSR &matrix)
 
LINEARALGEBRALIB_EXPORT friend std::ostream & operator<< (std::ostream &os, const SparseMatrixCSR &rhs)
 

Detailed Description

A matrix class with overloaded operators to facilitate arithmetic matrix operations.

This class implements a 2D sparse matrix using the Compressed Sparse Row (CSR) format. The CSR format, as excellently discussed by Matt Eding, is used to store only non-zero elements in the matrix which reduces memory consumption significantly (and, in fact, makes large CFD calculations possible in the first place). To see how to use this class, refer to the Creating a matrix section in the documentation.


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