Hello,

>> is there also a way to read two key columns, where the first consists
>> of elements of a set (let's call them element e1 from set S1) and fill
>> a subscripted set with the elements of the second column

The following solution will need O(n^2) time, where n is the number of
table lines:

set T, dimen 2;
set S1 := setof{(x,y) in T}x;
set S2{x in S1} := setof{(x,y) in T}y;
table t IN "CSV" "test.csv" :
T <- [x,y];
display S2;
end;

test.csv has the following content:

x,y
x1,y1
x1,y2
x3,y3
x4,y4

Best regards

Xypron



_______________________________________________
Help-glpk mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-glpk

Reply via email to