34 #ifndef SHARK_LINALG_CHOLESKY_H 35 #define SHARK_LINALG_CHOLESKY_H 40 namespace shark{
namespace blas{
64 template<
class MatrixT,
class MatrixL>
70 size_t m = A().size1();
73 for(std::size_t i = 0; i != m; ++i){
74 for(std::size_t j = 0; j <= i; ++j){
78 if(kernels::potrf<lower>(L()) != 0){
79 throw SHARKEXCEPTION(
"[Cholesky Decomposition] The Matrix is not positive definite");
100 template<
class Matrix,
class Vector>
104 double alpha,
double beta 107 std::size_t n = v().size();
109 double betaPrime = 1;
110 double a = std::sqrt(alpha);
111 for(std::size_t j=0; j != n; ++j)
113 double Ljj = a*L()(j,j);
116 double swj2 = beta*wj*wj;
117 double gamma = dj*betaPrime + swj2;
119 double x = dj + swj2/betaPrime;
121 throw SHARKEXCEPTION(
"[choleskyUpdate] update makes matrix indefinite, no update available");
122 double nLjj = std::sqrt(x);
124 betaPrime += swj2/dj;
160 template<
class MatrixL>
188 template<
class MatrixA,
class MatrixL>
196 size_t m = A().size1();
206 #include "Impl/Cholesky.inl"