[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] Problem with min command
From: |
Andrew Makhorin |
Subject: |
Re: [Help-glpk] Problem with min command |
Date: |
Mon, 02 Jul 2012 20:33:28 +0400 |
> Initially I wanted to detect the index of an array where the value is
> different of zero, you guys helped me suggested me the following
> command:
>
> param index1 := min{k in SCHEDULES: values[k] != 0} k;
>
> The problem arises because there are some cases where the whole array
> "values" has zero values, and the min command does not work, a message
> error is shown:
> "min{} over empty set; result undefined
> MathProg model processing error"
>
> and for these cases a value of index=1 will help me a lot.
> Does anybody have some suggestions?
param index1 := if card(SCHEDULES) = 0 then
0
else
(min{k in SCHEDULES: values[k] != 0} k);