In my previous question (regarding printf and if), I thought about this _expression_ which is invalid in current version of MathProg:
printf "%30s", (if card({name in I : H[name] = 1}) = 0 then '*' else XXXX);
My point is, I would like XXXX to be an _expression_ which returns ONE element of a set. In this case, the value of 'name' for which H[name] = 1.
I thought about these 2 functions which could be useful:
- first({name in I : H[name] = 1}), would return value of name; last() would be good too;
- member {name in I : H[name] = 1} (i), would return the ith member of set.
So, member {name in I : H[name] = 1} (1) would return value of name too;
To really be effective, this should work with unsubscripted sets to, like set I := A NO THER MEM BER;
Suppose H[A] = 1, so the above functions return A.
What do you think ? Thank you.
--
Nilo Cesar Teixeira
address@hidden