CVSROOT:        /cvsroot/lilypond
Module name:    lilypond
Branch:         
Changes by:     Han-Wen Nienhuys <[EMAIL PROTECTED]>    05/07/10 12:10:22

Modified files:
        .              : ChangeLog 
        lily           : bezier.cc 

Log message:
        hardcode binomial coefficients of order 3.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/ChangeLog.diff?tr1=1.3860&tr2=1.3861&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/bezier.cc.diff?tr1=1.58&tr2=1.59&r1=text&r2=text

Patches:
Index: lilypond/ChangeLog
diff -u lilypond/ChangeLog:1.3860 lilypond/ChangeLog:1.3861
--- lilypond/ChangeLog:1.3860   Sun Jul 10 11:25:24 2005
+++ lilypond/ChangeLog  Sun Jul 10 12:10:22 2005
@@ -1,5 +1,9 @@
 2005-07-10  Han-Wen Nienhuys  <[EMAIL PROTECTED]>
 
+       * lily/bezier.cc: hardcode binomial coefficients of order 3.
+
+       * lily/include/music-wrapper.hh: remove Music_wrapper as Music subtype.
+
        * scm/define-music-types.scm (music-descriptions): don't use
        Music_wrapper type.
 
Index: lilypond/lily/bezier.cc
diff -u lilypond/lily/bezier.cc:1.58 lilypond/lily/bezier.cc:1.59
--- lilypond/lily/bezier.cc:1.58        Tue Apr 12 22:49:29 2005
+++ lilypond/lily/bezier.cc     Sun Jul 10 12:10:22 2005
@@ -12,6 +12,8 @@
 #include "warn.hh"
 #include "libc-extension.hh"
 
+Real binomial_coefficient_3[] = {1,3 ,3, 1};
+
 Real
 binomial_coefficient (Real over, int under)
 {
@@ -90,7 +92,7 @@
   Offset o;
   for (int j = 0; j < 4; j++)
     {
-      o += control_[j] * binomial_coefficient (3, j)
+      o += control_[j] * binomial_coefficient_3[j]
        * pow (t, j) * pow (1 - t, 3 - j);
 
       tj *= t;
@@ -113,7 +115,7 @@
   for (int j = 0; j <= 3; j++)
     {
       p
-       += (control_[j][a] * binomial_coefficient (3, j))
+       += (control_[j][a] * binomial_coefficient_3[j])
        * Polynomial::power (j, Polynomial (0, 1))
        * Polynomial::power (3 - j, Polynomial (1, -1));
     }


_______________________________________________
Lilypond-cvs mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/lilypond-cvs

Reply via email to