From: fred Date: Sun, 24 Mar 2002 19:30:28 +0000 (+0000) Subject: lilypond-0.0.28 X-Git-Tag: release/1.5.59~5464 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=72d3f17c3cf7dfa9b2e3104df6453b7086769457;p=lilypond.git lilypond-0.0.28 --- diff --git a/hdr/leastsquares.hh b/hdr/leastsquares.hh index 4d3931ee94..b9a9241d0d 100644 --- a/hdr/leastsquares.hh +++ b/hdr/leastsquares.hh @@ -12,6 +12,7 @@ struct Least_squares { Array input; void minimise(Real &coef, Real &offset); + void OK() const; }; diff --git a/input/Makefile b/input/Makefile index 61c04f111a..182b105fb0 100644 --- a/input/Makefile +++ b/input/Makefile @@ -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: diff --git a/src/leastsquares.cc b/src/leastsquares.cc index adbc098219..cf9ec478e4 100644 --- a/src/leastsquares.cc +++ b/src/leastsquares.cc @@ -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;