linearAlgebraSolverLib
Loading...
Searching...
No Matches
conjugateGradient.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#include <iostream>
18
19// third-party include headers
20
21// linear algebra solver library include headers
22#include "linearAlgebraLib/src/linearAlgebraSolverBase.hpp"
23#include "linearAlgebraLib/src/sparseMatrixCSR.hpp"
24#include "linearAlgebraLib/src/vector.hpp"
25
26// helper classes
27
28namespace linearAlgebraLib {
29
40class LINEARALGEBRALIB_EXPORT ConjugateGradient : public LinearAlgebraSolverBase {
43
45
48public:
49 ConjugateGradient(unsigned numberOfCells);
51
54public:
55 virtual Vector solve(unsigned maxIterations, double convergenceThreshold) final override;
57
60
62
65
67
70
72
75
77};
78
79} // namespace linearAlgebraLib
Implements the Conjugate Gradient method for solving linear systems.
Definition conjugateGradient.hpp:40
A class defining an interface for linear algebra solvers to implement.
Definition linearAlgebraSolverBase.hpp:39
A vector class with overloaded operators to facilitate arithmetic vector operations.
Definition vector.hpp:41