author | alpar |
Fri, 25 Mar 2005 08:18:27 +0000 | |
changeset 1256 | 3bb4ed285c39 |
parent 1254 | c9558638fe42 |
child 1259 | 11a09f1319b3 |
permissions | -rw-r--r-- |
alpar@1254 | 1 |
#include"lp_solver_skeleton.h" |
alpar@1254 | 2 |
|
alpar@1254 | 3 |
using namespace lemon; |
alpar@1254 | 4 |
|
alpar@1254 | 5 |
int main() |
alpar@1254 | 6 |
{ |
alpar@1256 | 7 |
typedef LpSolverSkeleton LP; |
alpar@1256 | 8 |
LP lp; |
alpar@1256 | 9 |
|
alpar@1256 | 10 |
std::vector<LP::Col> x; |
alpar@1256 | 11 |
for(int i=0;i<10;i++) x.push_back(lp.addCol()); |
alpar@1256 | 12 |
|
alpar@1256 | 13 |
std::vector<LP::Col> y(10); |
alpar@1256 | 14 |
lp.addColSet(y); |
alpar@1256 | 15 |
|
alpar@1256 | 16 |
std::map<int,LP::Col> z; |
alpar@1256 | 17 |
|
alpar@1256 | 18 |
z.insert(std::make_pair(12,INVALID)); |
alpar@1256 | 19 |
z.insert(std::make_pair(2,INVALID)); |
alpar@1256 | 20 |
z.insert(std::make_pair(7,INVALID)); |
alpar@1256 | 21 |
z.insert(std::make_pair(5,INVALID)); |
alpar@1256 | 22 |
|
alpar@1256 | 23 |
lp.addColSet(z); |
alpar@1256 | 24 |
|
alpar@1256 | 25 |
|
alpar@1256 | 26 |
LP::Expr e; |
alpar@1256 | 27 |
e[x[3]]=2; |
alpar@1256 | 28 |
e[x[3]]=4; |
alpar@1256 | 29 |
e[x[3]]=1; |
alpar@1256 | 30 |
e.constComp()=12; |
alpar@1256 | 31 |
lp.addRow(LP::INF,e,23); |
alpar@1256 | 32 |
|
alpar@1254 | 33 |
} |