Hello Andrew,
> I have implemented and included this operation (building array of
> sets from plain set) in Mathprog. It will appear in the next release
> of the package (though probably the syntax should be improved).
the time saving you reported are impressive.
The syntax should be able to handle sets with multiple indexes like set C in
the example below.
Best regards
Xypron
param n:= 12;
set A:= setof{i in {0..n}, j in {0..2^(n-i)-1}, k in {0..2^i-1}} (i,j,k+j*2^i);
set B:= setof{(i,j,k) in A} (i,j);
set C{(i,j) in B} := setof{ (i,j,k) in A} k;
param t1 := gmtime();
param t2 := gmtime();
solve;
printf "Start %s\n", time2str( t1, "%FT%TZ");
printf "%d = %d\n", sum{(i,j) in B} card(C[i,j]), (n+1)*2^n;
printf "duration = %d s\n", t2-t1;
end;
--
Sensationsangebot verlängert: GMX FreeDSL - Telefonanschluss + DSL
für nur 16,37 Euro/mtl.!* http://dsl.gmx.de/?ac=OM.AD.PD003K1308T4569a
_______________________________________________
Help-glpk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-glpk