linearAlgebraSolverLib
Loading...
Searching...
No Matches
linearAlgebraSolverBase.hpp
1#pragma once
2
3// preprocessor statements
4#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
5 #if defined(COMPILEDLL)
6 #define LINEARALGEBRALIB_EXPORT __declspec(dllexport)
7 #elif defined(COMPILELIB)
8 #define LINEARALGEBRALIB_EXPORT
9 #else
10 #define LINEARALGEBRALIB_EXPORT __declspec(dllimport)
11 #endif
12#else
13 #define LINEARALGEBRALIB_EXPORT
14#endif
15
16// c++ include headers
17
18// third-party include headers
19
20// linear algebra solver library include headers
21#include "linearAlgebraLib/src/sparseMatrixCSR.hpp"
22#include "linearAlgebraLib/src/vector.hpp"
23
24// helper classes
25
26namespace linearAlgebraLib {
27
39class LINEARALGEBRALIB_EXPORT LinearAlgebraSolverBase {
42
44
47public:
48 LinearAlgebraSolverBase(unsigned numberOfCells);
49 virtual ~LinearAlgebraSolverBase() = default;
51
54public:
55 void setCoefficientMatrix(const SparseMatrixCSR &matrix);
56 void setRightHandSide(const Vector &rhs);
57 virtual Vector solve(unsigned maxIterations, double convergenceThreshold) = 0;
59
62
64
67
69
72protected:
73 SparseMatrixCSR _coefficientMatrix;
74 Vector _rightHandSide;
76
79
81};
82
83} // namespace linearAlgebraLib
A class defining an interface for linear algebra solvers to implement.
Definition linearAlgebraSolverBase.hpp:39
A matrix class with overloaded operators to facilitate arithmetic matrix operations.
Definition sparseMatrixCSR.hpp:43
A vector class with overloaded operators to facilitate arithmetic vector operations.
Definition vector.hpp:41