blob: 3dc3764c6e932b3fafcaca89820770fab1eb5c97 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
// Copyright Matt Overby 2020.
// Distributed under the MIT License.
#ifndef ADMMPD_LINSOLVE_H_
#define ADMMPD_LINSOLVE_H_
#include "admmpd_types.h"
namespace admmpd {
// Preconditioned Conjugate Gradients
class ConjugateGradients {
public:
void solve(
const Options *options,
SolverData *data);
protected:
// Apply preconditioner
void solve_Ax_b(
SolverData *data,
Eigen::VectorXd *x,
Eigen::VectorXd *b);
};
// Multi-Colored Gauss-Seidel
class GaussSeidel {
public:
void solve(
const Options *options,
SolverData *data);
protected:
void init_solve(
const Options *options,
SolverData *data);
void compute_colors(
const RowSparseMatrix<double> *A,
int stride,
std::vector<std::vector<int> > &colors);
};
} // namespace admmpd
#endif // ADMMPD_LINSOLVE_H_
|