help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-glpk] New set functions


From: Nilo Cesar Teixeira
Subject: [Help-glpk] New set functions
Date: Wed, 2 Nov 2011 19:34:33 -0200

Hi all,

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:
  1. first({name in I : H[name] = 1}), would return value of name; last() would be good too;
  2. 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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]