summaryrefslogtreecommitdiff
path: root/flower/choleski.hh
blob: c6cb91723be6651b93827d351cad814ac24a5159 (about) (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
#ifndef CHOLESKI_HH
#define CHOLESKI_HH

#include "matrix.hh"

struct Choleski_decomposition {

    /// lower triangle of Choleski decomposition
    Matrix L;

    /// diagonal 
    Vector D;
    ///Create decomposition of P
    Choleski_decomposition(Matrix P);
    /**
    PRE
    P needs to be symmetric positive definite
    */
    
    Vector solve(Vector rhs) const;
    Vector operator * (Vector rhs) const { return solve (rhs); }
    /**
    solve Px = rhs
    */

    Matrix inverse() const;
    /**
    return the inverse of the matrix P.
    */

    Matrix original() const;
    /**
    return P,  calc'ed from L and D
    */
	 
};
/**
    structure for using the LU decomposition of a positive definite .

    #P# is split  into

    LD transpose(L)
    */
    

#endif