lilypond-0.0.3
[lilypond.git] / choleski.hh
blobc6cb91723be6651b93827d351cad814ac24a5159
1 #ifndef CHOLESKI_HH
2 #define CHOLESKI_HH
4 #include "matrix.hh"
6 struct Choleski_decomposition {
8 /// lower triangle of Choleski decomposition
9 Matrix L;
11 /// diagonal
12 Vector D;
13 ///Create decomposition of P
14 Choleski_decomposition(Matrix P);
15 /**
16 PRE
17 P needs to be symmetric positive definite
20 Vector solve(Vector rhs) const;
21 Vector operator * (Vector rhs) const { return solve (rhs); }
22 /**
23 solve Px = rhs
26 Matrix inverse() const;
27 /**
28 return the inverse of the matrix P.
31 Matrix original() const;
32 /**
33 return P, calc'ed from L and D
37 /**
38 structure for using the LU decomposition of a positive definite .
40 #P# is split into
42 LD transpose(L)
46 #endif