spielwiese
Last change
on this file since 6fb723 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:
893 bytes
|
Line | |
---|
1 | LIB "tst.lib"; tst_init(); |
---|
2 | ring r = (real,10),(x),lp; |
---|
3 | |
---|
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 | // |
---|
13 | matrix sm[5][5]=( 0, 1, 1, 3,-0.5, |
---|
14 | 740,-1, 0,-2, 0, |
---|
15 | 0, 0,-2, 0, 7, |
---|
16 | 0.5, 0,-1, 1,-2, |
---|
17 | 9,-1,-1,-1,-1); |
---|
18 | |
---|
19 | int n = 4; // number of constraints |
---|
20 | int m = 4; // number of variables |
---|
21 | int m1= 2; // number of <= constraints |
---|
22 | int m2= 1; // number of >= constraints |
---|
23 | int m3= 1; // number of == constraints |
---|
24 | simplex(sm, n, m, m1, m2, m3); |
---|
25 | tst_status(1);$ |
---|
Note: See
TracBrowser
for help on using the repository browser.