help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] Parsing large, sparse mathprog model takes a (very) long


From: Andrew Makhorin
Subject: Re: [Help-glpk] Parsing large, sparse mathprog model takes a (very) long time
Date: Mon, 02 May 2011 17:14:56 +0400

>  This "data " statement seems very useful.  Could you please provide a couple 
> of paragraphs on how the "data" statement works?

The idea is quite simple. Imagine that you declare a plain set:

set S{i,j,k,l,m};

which is provided with data in the data section. However, actually you
need to have, say, array of sets T{j,m}, where T[j,m] is a set of
triplets (l,i,k) from S. Using the data attribute (not documented!) you
can declare T as follows:

set T{j,m}, data S[2,5,4,1,3];

This declaration has the same effect as there were corresponding data
provided for T in the data section. [2,5,4,1,3] is a permutation of
component indices: 2nd and 5th components of every 5-tuple in S give
pair [j,m] used to index elements of T, and 4th, 1st, and 3rd components
of the 5-tuple are used to build triplets (l,i,k), which are included in
set T[j,m].





reply via email to

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