]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/qlp.hh
release: 1.0.1
[lilypond.git] / lily / include / qlp.hh
1 /*
2   qlp.hh -- declare Ineq_constrained_qp, Mixed_qp
3
4   source file of the GNU LilyPond music typesetter
5
6   (c)  1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9 #ifndef QLP_HH
10 #define QLP_HH
11
12 #include "ineq-constrained-qp.hh"
13
14 /**
15    Quadratic programming with mixed linear constraints.
16   problem definition of a quadratic optimisation problem with linear
17   inequality and equality constraints
18
19
20     x^T QUAD x /2 + b^T x 
21 */
22 class Mixed_qp :public Ineq_constrained_qp {
23     Array<int> eq_cons;
24     Array<Real> eq_consrhs;
25 public:
26     Mixed_qp (int n);
27     void OK() const;
28     void print() const;
29
30     Vector solve (Vector start) const;
31     void add_fixed_var (int i , Real value);
32     
33
34     /**
35       add a constraint,
36
37         c*vars == r
38
39       PRE
40       c.dim()==dim ();
41      */
42     void add_equality_cons (Vector c, double r);
43 };
44 #endif