From: fred Date: Wed, 9 Oct 1996 11:23:28 +0000 (+0000) Subject: lilypond-0.0.2 X-Git-Tag: release/1.5.59~7135 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=9973c346651c6ba300a114152be0b582854a391c;p=lilypond.git lilypond-0.0.2 --- diff --git a/choleski.cc b/choleski.cc index db3fe82d60..2d8c68aa66 100644 --- a/choleski.cc +++ b/choleski.cc @@ -18,6 +18,8 @@ Choleski_decomposition::solve(Vector rhs)const assert(D(i)); y(i) /= D(i); } + + // backward subst Vector x(n); for (int i=n-1; i >= 0; i--) { Real sum(0.0); @@ -28,6 +30,10 @@ Choleski_decomposition::solve(Vector rhs)const return x; } +/* + Standard matrix algorithm. + */ + Choleski_decomposition::Choleski_decomposition(Matrix P) : L(P.dim()), D(P.dim()) { @@ -49,9 +55,9 @@ Choleski_decomposition::Choleski_decomposition(Matrix P) D(k) = d; } - #ifdef NDEBUG +#ifdef NDEBUG assert((original()-P).norm() < EPS); - #endif +#endif } Matrix @@ -79,7 +85,11 @@ Choleski_decomposition::inverse() const Matrix I1(n), I2(original()); I1.unit(); assert((I1-original()*invm).norm() < EPS); - #endif +#endif return invm; } + + + +