[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] Mathprog question
From: |
Andrew Makhorin |
Subject: |
Re: [Help-glpk] Mathprog question |
Date: |
Sun, 13 Dec 2009 00:54:35 +0300 |
> 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;