[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [Help-glpk] formulation of a problem
From: |
Gottfried Lindner |
Subject: |
RE: [Help-glpk] formulation of a problem |
Date: |
Thu, 22 Jun 2006 14:27:17 +0200 |
See below
Gottfried Lindner
Mail: address@hidden
Besuchen Sie unsere Seite:
http://www.informatikfuchs.de/Software/GLPK/LiMath_Optimierung.htm
-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf Of
Nico Moser
Sent: Donnerstag, 22. Juni 2006 13:33
To: address@hidden
Subject: [Help-glpk] formulation of a problem
Hi,
I'm in trouble with set in a problem in the glpk datastructure and I
can't find answers to my questions (perhaps I looked at the wrong
places).
The two main problems:
1. How can I set a variable to the right hand side?
If I have a constraint like this: x1+x2 <= y1 I can't set:
lpx_set_row_name(lp, 3, "constraint");
lpx_set_row_bnds(lp, 3, LPX_UP, 0, y1);
-> Yes, if y1 is a constant in your model and a variable in the program
containing this constant value.
2. How can I set 'holes' in the matrix (if a variable is not needed
in one constraint)?
For instance:
x1+x2 = 3
x1 <= 1
then I would think the array assignments looks like that:
ia[1] = 1, ja[1] = 1, ar[1] = 1.0;
ia[2] = 1, ja[2] = 2, ar[2] = 1.0;
ia[3] = 2, ja[3] = 1, ar[3] = 1.0;
ia[4] = 2, ja[4] = 2, ar[4] = 0; // <- it doesn't work
(a similar problem: if I don't need a basic variable in the minimize
or maximize funktion, can I set the the coefficient to zero? like:
lpx_set_obj_coef(lp,1,0.0); )
-> Only coefficients with value <> 0 may be explicitly assigned. The
others are assigned to 0 implicitly (sparse matrix storage).
Thanks a lot,
Nico
_______________________________________________
Help-glpk mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/help-glpk