2 qlp.hh -- declare Ineq_constrained_qp, Mixed_qp
4 source file of the LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
14 /// inequality constrained quadratic program
15 class Ineq_constrained_qp
{
16 friend class Active_constraints
;
27 use a KKT method to assert optimality of sol
29 void assert_solution(Vector sol
) const;
30 /// solve the problem using a projected gradient method
31 Vector
solve(Vector start
) const;
34 @return the number of variables in the problem
50 void add_inequality_cons(Vector c
, double r
);
52 /** set up matrices to go with the problem. */
53 Ineq_constrained_qp(int novars
);
56 evaluate the quadratic function for input #v#
60 void eliminate_var(int idx
, Real value
);
68 Quadratic programming with mixed linear constraints.
69 problem definition of a quadratic optimisation problem with linear
70 inequality and equality constraints
75 class Mixed_qp
:public Ineq_constrained_qp
{
77 Array
<Real
> eq_consrhs
;
83 Vector
solve(Vector start
) const;
84 void add_fixed_var(int i
, Real value
);
95 void add_equality_cons(Vector c
, double r
);