> see example below. Unfortunately sorted output requires O(n^3) time.

Below here is a simplified Xypron's version. It works if all a[i]'s
are different.

set I;

param a{I} := Uniform01();

printf{k in 1..card(I), i in I:
   sum{j in I} (if a[i] >= a[j] then 1) == k}
      "%-10s %f8.6\n", i, a[i];

data;
set I := ape bear crocodile elefant lion snake tiger zebra;
end;



_______________________________________________
Help-glpk mailing list
Help-glpk@gnu.org
http://lists.gnu.org/mailman/listinfo/help-glpk

Reply via email to