help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] Gnu Mathprog: Projection operator?


From: Noli Sicad
Subject: Re: [Help-glpk] Gnu Mathprog: Projection operator?
Date: Mon, 11 Jan 2010 02:07:07 +0700

Jörg,

Xypron has good example how to implement these fake field, multi
dimension set, and setof() Andrew mentioned.

http://www.mail-archive.com/address@hidden/msg03506.html

>From Xypron  example
~~~~~~~~~~~~~~~~~~~~~
# CROP_ID CROPTYPE Period Ini_Age
set S dimen 4;
# Period
set P := setof{(i,j,k,l) in S} k;
# CROP_ID CROPTYPE Ini_Age
set Q := setof{(i,j,k,l) in S} (i,j,l);
# Area_Cut
param a{S};

table tin IN 'CSV' 'input.csv' :
S <- [CROP_ID, CROPTYPE, Period, Ini_Age], a~Area_Cut;
~~~~~~~~~~~~~~~~~~~~~

Noli



> The csv table driver provides a fake field named RECNO containing
> the record number. Probably you can use it to build the control set:
>
> set S;
> param raw_data{S};
> table list IN "CSV" "list.csv": S <- [RECNO], raw_data ~ FIELD, ... ;
>
>>
>> My first thought was to assemble the variable indices using a
>> projection on my existing control sets   L,C and R, but I cannot find
>> such an operator in GNU Mathprog. Another option would be to create a
>> .csv-file containing the necessary indices, but that seems a bit
>> complicated.
>>
>> 1. Is there any way a projection can be realized in Mathprog?
>
> setof{}




reply via email to

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