[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Re : [Help-glpk] Assign a param to a set in data section
From: |
Andrew Makhorin |
Subject: |
Re: Re : [Help-glpk] Assign a param to a set in data section |
Date: |
Fri, 1 Dec 2006 07:27:03 +0300 |
> Yes, this exactly what I need, Thanks.
> One exception maybe, from the documentation they say that this only works
> for param specified in the tabbing format and I would like it for any type
> of param, matrix type in my case.
> Is it still possible?
Do you mean something like this?
param : S : a : j1 j2 j3 :=
i1 1 . 3
i2 4 5 . ;
No, such a feature is not implemented. (Afaik, in AMPL it is also
impossible to do that.)
If the domain is not very big, you can construct it in the following
way:
param a{i in I, j in J}, default 333333;
set S := setof{i in I, j in J: a[i,j] != 333333} (i,j);
where 333333 should be replaced by a value which is not appear in the
parameter data.
(Probably, there must be a built-in function, say dom(x), which
returns the domain set for x.)