source: git/Tst/Manual/simplexOut.tst @ 7161aca

fieker-DuValspielwiese
Last change on this file since 7161aca was 894057, checked in by Oleksandr Motsak <motsak@…>, 13 years ago
ADD: Tests from online manual (res+stat on mamawutz): short ones Tst/Manual/s.lst
  • Property mode set to 100644
File size: 777 bytes
Line 
1LIB "tst.lib"; tst_init();
2LIB "solve.lib";
3ring r = (real,10),(x),lp;
4// consider the max. problem:
5//
6//    maximize  x(1) + x(2) + 3*x(3) - 0.5*x(4)
7//
8//  with constraints:   x(1) +          2*x(3)          <= 740
9//                             2*x(2)          - 7*x(4) <=   0
10//                               x(2) -   x(3) + 2*x(4) >=   0.5
11//                      x(1) +   x(2) +   x(3) +   x(4)  =   9
12//
13matrix sm[5][5]=   0, 1, 1, 3,-0.5,
14740,-1, 0,-2, 0,
150, 0,-2, 0, 7,
160.5, 0,-1, 1,-2,
179,-1,-1,-1,-1;
18int n = 4;  // number of constraints
19int m = 4;  // number of variables
20int m1= 2;  // number of <= constraints
21int m2= 1;  // number of >= constraints
22int m3= 1;  // number of == constraints
23list sol=simplex(sm, n, m, m1, m2, m3);
24simplexOut(sol);
25tst_status(1);$
Note: See TracBrowser for help on using the repository browser.