bug-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-glpk] GMPL.pdf: "Infinity" not documented


From: xypron
Subject: [Bug-glpk] GMPL.pdf: "Infinity" not documented
Date: Thu, 18 Jun 2009 10:47:03 -0700 (PDT)

Hello Andrew,

GMPL supports the constant "Infinity". Unfortunately it is not documented.

Could you, please, update the documentation.

The constant is quite useful as the example below shows.

Best regards

Xypron

# This example shows how to fix some of an array of variables.
# Instead of a data section you could also use a "table IN" statement
# to define the set of fixed variables.
#
# To see that is works try
# glpsol -m thisFile.mod --wcpxlp thatFile.lp
# and inspect the "Bounds" section of file thatFile.lp
#
# domain of variables
set S := 1..20;
# set of fixed values
set F, dimen 2;
# domain of fixed values
set FD := setof{(s,v) in F} s;
# fixed values
param f{s in FD} := sum{(s,v) in F} v;
# variable definition
var v{s in S}, >= if s in FD then f[s] else -Infinity, <= if s in FD then
f[s] else Infinity;
# objective
maximize obj :
  sum{s in S} v[s];
# some constraint
s.t. ub{s in S} :
  v[s] <= s;
# solve
solve;
# show result
display v;
# done
data;
# set of fixed values
set F :=
  (15, -15)
  (18, -18);
end;

-- 
View this message in context: 
http://www.nabble.com/GMPL.pdf%3A-%22Infinity%22-not-documented-tp24095351p24095351.html
Sent from the Gnu - GLPK - Bugs mailing list archive at Nabble.com.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]