]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.18
authorfred <fred>
Thu, 19 Dec 1996 00:10:51 +0000 (00:10 +0000)
committerfred <fred>
Thu, 19 Dec 1996 00:10:51 +0000 (00:10 +0000)
src/linespace.cc
src/qlp.cc
src/template3.cc
symbol.ini

index fbab62449bba2758d41c90f238c3bf062eb49350..e403c2dcc034e96764eadfa85b93724d88d359c0 100644 (file)
@@ -130,6 +130,7 @@ Spacing_problem::make_matrices(Matrix &quad, Vector &lin, Real &c) const
 {
     quad.fill(0);
     lin.fill(0);
+    c = 0;
     for (int j=0; j < ideals.sz(); j++){
        Idealspacing const*i=ideals[j];
        int l = col_id(i->left);
@@ -176,7 +177,6 @@ Spacing_problem::solve() const
     OK();
     assert(check_feasible());
 
-    
     /* optimalisatiefunctie */        
     Mixed_qp lp(cols.sz());
     make_matrices(lp.quad,lp.lin, lp.const_term);
index 3dd8e4227e036810b539c717d699c3a83ce3fa1d..460bd864231b27646bbab9d76cb29ef1ae857f92 100644 (file)
@@ -25,7 +25,8 @@ Ineq_constrained_qp::add_inequality_cons(Vector c, double r)
 
 Ineq_constrained_qp::Ineq_constrained_qp(int novars):
     quad(novars),
-    lin(novars)
+    lin(novars),
+    const_term (0.0)
 {
 }
 
@@ -45,13 +46,6 @@ Ineq_constrained_qp::eval (Vector v)
 {
     return v * quad * v + lin * v + const_term;
 }
-/*
-    eliminate appropriate variables, until we have a Ineq_constrained_qp
-    then solve that.
-
-    PRE
-    cons should be ascending
-    */
 Vector
 Mixed_qp::solve(Vector start) const 
 {
@@ -94,32 +88,59 @@ Ineq_constrained_qp::eliminate_var(int idx, Real value)
 
 
 
-
-Mixed_qp::Mixed_qp(int n)
-    : Ineq_constrained_qp(n)
-{
-}
-
 void
-Mixed_qp::OK() const
+Ineq_constrained_qp::assert_solution(Vector sol) const
 {
-#ifndef NDEBUG
-    Ineq_constrained_qp::OK();
-    assert(eq_consrhs.sz() == eq_cons.sz());
-#endif    
+    svec<int> binding;
+    for (int i=0; i < cons.sz(); i++) {
+       Real R=cons[i] * sol- consrhs[i];
+       assert(R> -EPS);
+       if (R < EPS)
+           binding.add(i);
+    }
+    // KKT check...
+    // todo
 }
+
 void
 Ineq_constrained_qp::print() const
 {
 #ifndef NPRINT
     mtor << "Quad " << quad;
-    mtor << "lin " << lin <<"\n";
+    mtor << "lin " << lin <<"\n"
+       << "const " << const_term<<"\n";
     for (int i=0; i < cons.sz(); i++) {
        mtor << "constraint["<<i<<"]: " << cons[i] << " >= " << consrhs[i];
        mtor << "\n";
     }
 #endif
 }
+
+/****************/
+
+/*
+    eliminate appropriate variables, until we have a Ineq_constrained_qp
+    then solve that.
+
+    PRE
+    cons should be ascending
+    */
+
+
+Mixed_qp::Mixed_qp(int n)
+    : Ineq_constrained_qp(n)
+{
+}
+
+void
+Mixed_qp::OK() const
+{
+#ifndef NDEBUG
+    Ineq_constrained_qp::OK();
+    assert(eq_consrhs.sz() == eq_cons.sz());
+#endif    
+}
+
 void
 Mixed_qp::print() const
 {
@@ -131,17 +152,3 @@ Mixed_qp::print() const
 #endif
 }
 
-
-void
-Ineq_constrained_qp::assert_solution(Vector sol) const
-{
-    svec<int> binding;
-    for (int i=0; i < cons.sz(); i++) {
-       Real R=cons[i] * sol- consrhs[i];
-       assert(R> -EPS);
-       if (R < EPS)
-           binding.add(i);
-    }
-    // KKT check...
-    // todo
-}
index be32eeceff2bcba66f393bf9b47efe1304b8956b..3e06cfdb231171b5faa3b9285d84d3174fb3fe44 100644 (file)
@@ -16,3 +16,4 @@ IPL_instantiate(Command);
 IPL_instantiate(Input_command);
 IPL_instantiate(Commands_at);
 IPL_instantiate(Input_staff);
+IPL_instantiate(Input_music);
index 21226c079dcdb0d3499d60038bba26d606aa7da0..d0dd12453dbd3375d7ba98821ddca56e0f3a247b 100644 (file)
@@ -213,4 +213,4 @@ english_names = notenames {
 }
 
 default_table = symboltables { table_sixteen }
-notenames { dutch_names }
\ No newline at end of file
+notenames { dutch_names }