]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/linear-programming.hh
c0648e8b26732320cee2ae416239d3d808af8c37
[lilypond.git] / lily / include / linear-programming.hh
1 /*   
2   linear-programming.hh -- declare 
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
10 #ifndef LINEAR_PROGRAMMING_HH
11 #define LINEAR_PROGRAMMING_HH
12
13 #include "linear-programming.hh"
14
15 /**
16
17    min c* x
18
19    constraints_[i] * x = constraint_rhss_ [i]
20    
21    x[j] >= 0
22 */
23
24 class Linear_programming
25 {
26   Array<Vector> constraints_;
27   Array<Real> constraint_rhss_;
28   Vector cost_vec_;
29
30 public:
31   Vector constraint_solve (Vector initial) const;
32   int dim () const;
33   Vector solve (Vector) const;
34   void add_constraint (Vector c, double r);
35   Linear_programming (int n);
36   void set_cost (Vector);
37   void print () const;
38   void OK () const;
39 }
40
41 #endif /* LINEAR_PROGRAMMING_HH */
42