]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.1.57
authorfred <fred>
Sun, 24 Mar 2002 20:07:56 +0000 (20:07 +0000)
committerfred <fred>
Sun, 24 Mar 2002 20:07:56 +0000 (20:07 +0000)
lily/include/ineq-constrained-qp.hh
lily/include/qlpsolve.hh
lily/qlpsolve.cc

index a7bd31693de716636b382b45f2a5007e63196faf..5cb5c43eb9c632c156f7dbabd8a7c1e5bb4007c2 100644 (file)
 class Ineq_constrained_qp {
     friend class Active_constraints;
 
-    Array<Vector> cons;
-    Array<Real> consrhs;
+    Array<Vector> cons_;
+    Array<Real> consrhs_;
 public:
-    Matrix quad;
-    Vector lin;
-    Real const_term;
+    Matrix quad_;
+    Vector lin_;
+    Real const_term_;
 
 
     /**
@@ -40,9 +40,7 @@ public:
     /**
       @return the number of variables in the problem
       */
-    int dim() const{
-       return lin.dim();
-    }
+    int dim() const;
 
     /**
       add a constraint
index 6c018c5a9f5e1cacae7debfbae57e542bebe8d87..db985df6c54a83e28ad0bf18f2d66b3a759de3dc 100644 (file)
@@ -37,8 +37,8 @@ class Active_constraints {
 public:
   String status() const;
     
-  Vector vec (int k) const { return opt->cons[k]; }
-  Real rhs (int k) const { return opt->consrhs[k]; }
+  Vector vec (int k) const { return opt->cons_[k]; }
+  Real rhs (int k) const { return opt->consrhs_[k]; }
     
 
   /** drop constraint. drop constraint k from the active set. k is the index of the
index 7baa0a1a4a70dd8dfa0675c9a05e4a159d14c1b8..3d45207eab502ea98d2694c96a53322fc32491dd 100644 (file)
@@ -41,12 +41,12 @@ Active_constraints::OK()
 #ifndef NDEBUG
   H.OK();
   A.OK();
-  assert (active.size() +inactive.size () == opt->cons.size ());
+  assert (active.size() +inactive.size () == opt->cons_.size ());
   assert (H.dim() == opt->dim ());
   assert (active.size() == A.rows ());
   Array<int> allcons;
 
-  for (int i=0; i < opt->cons.size(); i++)
+  for (int i=0; i < opt->cons_.size(); i++)
     allcons.push (0);
   for (int i=0; i < active.size(); i++)
     {
@@ -79,7 +79,7 @@ Active_constraints::add (int k)
   inactive.swap (k,inactive.size()-1);
   inactive.pop();
 
-  Vector a (opt->cons[cidx]);
+  Vector a (opt->cons_[cidx]);
   // update of matrices
   Vector Ha = H*a;
   Real aHa = a*Ha;
@@ -123,10 +123,10 @@ Active_constraints::drop (int k)
       /*
 
        */
-      Real q = a*opt->quad*a;
+      Real q = a*opt->quad_*a;
       Matrix aaq (a,a/q);
       H += aaq;
-      A -= A*opt->quad*aaq;
+      A -= A*opt->quad_*aaq;
     }else
       WARN << _("degenerate constraints");
 #ifndef NDEBUG
@@ -143,9 +143,9 @@ Active_constraints::Active_constraints (Ineq_constrained_qp const *op)
          H(op->dim()),
          opt (op)
 {
-  for (int i=0; i < op->cons.size(); i++)
+  for (int i=0; i < op->cons_.size(); i++)
     inactive.push (i);
-  Choleski_decomposition chol (op->quad);
+  Choleski_decomposition chol (op->quad_);
 
   /*
     ugh.