]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.28
authorfred <fred>
Sun, 24 Mar 2002 19:30:28 +0000 (19:30 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:30:28 +0000 (19:30 +0000)
hdr/leastsquares.hh
input/Makefile
src/leastsquares.cc

index 4d3931ee945888cdc0c3ca74e32a2d27657eda47..b9a9241d0d8081aeef9e0a65755733f3986ba547 100644 (file)
@@ -12,6 +12,7 @@
 struct Least_squares {
     Array<Offset> input;
     void minimise(Real &coef, Real &offset);
+    void OK() const;
 };
 
 
index 61c04f111a4f0d698782a827c7c86dc135232bf6..182b105fb00d8177a56802424ffdfb6b963f0008 100644 (file)
@@ -4,7 +4,8 @@ DISTFILES=Makefile  kortjakje.ly pavane.ly  maartje.ly\
        cadenza.ly scales.ly standchen.ly twinkle.ly\
        wohltemperirt.ly error.ly\
        martien.ly mlalt.ly mlvio1.ly mlvio2.ly mlcello.ly\
-       standchen.tex pavane.tex  scsii-menuetto.tex martien.tex
+       standchen.tex pavane.tex scsii-menuetto.tex scsii-menuetto.ly\
+       martien.tex
 
 
 dist:
index adbc09821936e93a768636f36443db2d789ecc09..cf9ec478e494b50923f067bd624f0bc7c73e56ae 100644 (file)
@@ -1,8 +1,18 @@
 #include "leastsquares.hh"
+void
+Least_squares::OK() const
+{
+    assert( input.size() > 1 );
+    Real dx = 0.0;
+    for (int i=1; i < input.size(); i++)
+       dx += abs (input[i-1].x - input[i].x);
 
+    assert(dx);
+}
 void
 Least_squares::minimise(Real &coef, Real &offset)
 {
+    OK();
     Real sx = 0.0;
     Real sy = 0.0;
     Real sqx =0.0;