help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] Questions to MathProg


From: Robert Fourer
Subject: Re: [Help-glpk] Questions to MathProg
Date: Wed, 11 May 2005 11:36:30 -0500
User-agent: Microsoft-Entourage/10.0.0.1309

In reply to the message from >>> Gottfried Lindner
<address@hidden> received 5/11/05 4:51 AM:

> 1) I have a set I, which is an interval. Instead of writing
> set I := 1 2 3 4 5;
> I thought, I can write
> set I := 1 .. 5;
> but this is not correct. What's wrong?

You'll find an explanation in the answer to Question 4.2
at www.ampl.com/FAQ.

> 2) I have a restriction of the form
> s.t. Rb{v1 in V,v2 in V: v1<v2}: ...
> This works, if V contains numbers. If V contains symbols, v1<v2 is not
> allowed.
> Is there a function to convert symbols to their position in the set or
> something like that?

Yes, this is explained in the discussion of "ordered sets" in Section 5.6 of
the AMPL book.  If you don't have the book, you may be able to figure out
what you need by looking at the following example:

       www.ampl.com/BOOK/EXAMPLES/steelT2.mod
       www.ampl.com/BOOK/EXAMPLES/steelT2.dat

Bob Fourer
address@hidden






reply via email to

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