]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.77.jcn1
authorfred <fred>
Sun, 24 Mar 2002 19:49:12 +0000 (19:49 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:49:12 +0000 (19:49 +0000)
flower/choleski.cc
lily/Stable.make

index d10372fdfdc0339d089cdf935495a59d4dda42e5..202e184440cb62f68153b552a8c1038337a41516 100644 (file)
@@ -1,3 +1,11 @@
+/*
+  choleski.cc -- implement Choleski_decomposition
+
+  source file of the Flower Library
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
 #include "choleski.hh"
 const Real EPS = 1e-7;         // so sue me. Hard coded
 
@@ -31,14 +39,18 @@ Choleski_decomposition::solve(Vector rhs)const
 
 /*
   Standard matrix algorithm.
+  Should add support for banded matrices
   */
 
 Choleski_decomposition::Choleski_decomposition(Matrix P)
     : L(P.dim()), D(P.dim())
 {
     int n = P.dim();
-    assert((P-P.transposed()).norm()/P.norm() < EPS);
 
+#ifdef PARANOID
+    assert((P-P.transposed()).norm()/P.norm() < EPS);
+#endif
+    
     L.unit();
     for (int k= 0; k < n; k++) {
        for (int j = 0; j < k; j++){
@@ -55,7 +67,7 @@ Choleski_decomposition::Choleski_decomposition(Matrix P)
        D(k) = d;
     }
 
-#ifndef NDEBUG
+#ifdef PARANOID
     assert((original()-P).norm() / P.norm() < EPS);
 #endif
 }
@@ -81,7 +93,7 @@ Choleski_decomposition::inverse() const
            invm(i,j) = inv(j);
     }
     
-#ifndef NDEBUG
+#ifdef PARANOID
     Matrix I1(n), I2(original());
     I1.unit();
     assert((I1-I2*invm).norm()/I2.norm() < EPS);
index fb03ccca1deac120ee8c308e33ddaae9489e7868..57ea2528d1e8c1076ae58cec3ee964c9484ebd03 100644 (file)
@@ -4,7 +4,9 @@
 stablecc=atom.cc command-request.cc musical-request.cc bar.cc boxes.cc \
        keyword.cc leastsquares.cc \
        lookup.cc meter.cc\
-       parser.cc lexer.cc qlp.cc qlpsolve.cc\
+       parser.cc \
+#      lexer.cc \
+       qlp.cc qlpsolve.cc\
        template1.cc template2.cc template3.cc template4.cc\
        template5.cc template6.cc version.cc tex-stream.cc  tex.cc\
        identifier.cc note.cc