Welcome to mirror list, hosted at ThFree Co, Russian Federation.

admmpd_linsolve.h « src « softbody « extern - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b1dd9ae8f4e0e9bc2aa5c92738b1e0c9b018cf54 (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
// Copyright Matt Overby 2020.
// Distributed under the MIT License.

#ifndef ADMMPD_LINSOLVE_H_
#define ADMMPD_LINSOLVE_H_

#include "admmpd_types.h"

namespace admmpd {

class GaussSeidel {
public:
	// Solves (A + KtK) x = (b + Ktl)
	// x and b passed as separate variables
	// for debugging/testing purposes.
	void solve(
		const Options *options,
		SolverData *data);

protected:
	// Allocates data, computes colors
	void init_solve(
		const Options *options,
		SolverData *data);

	// Computes colors of A + KtK
	void compute_colors(
		const RowSparseMatrix<double> *A,
		const RowSparseMatrix<double> *KtK, // if null, just A
		std::vector<std::vector<int> > &colors);

};

} // namespace admmpd

#endif // ADMMPD_LINSOLVE_H_