]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/linear-programming.hh
release: 1.0.8
[lilypond.git] / lily / include / linear-programming.hh
1 /*   
2   linear-programming.hh -- declare Linear_programming
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    Solve the following problem:
18    
19    min c* x
20
21    constraints_[i] * x = constraint_rhss_ [i]
22    
23    x[j] >= 0
24 */
25
26 class Linear_programming
27 {
28   Array<Vector> constraints_;
29   Array<Real> constraint_rhss_;
30   Vector cost_vec_;
31   int dim_;
32 public:
33   Vector constraint_solve (Vector initial_basic_solution) const;
34
35   int dim () const;
36   Vector solve (Vector) const;
37   void add_constraint (Vector c, double r);
38
39   
40   Linear_programming (int n);
41   void set_cost (Vector);
42   void print () const;
43   void OK () const;
44 }
45
46 #endif /* LINEAR_PROGRAMMING_HH */
47