Defining a variable of mixed datatype in Mathprog
Anku Pandey <[email protected]> Tue, 15 Mar 2022 11:56:54 +0530
| Newsgroups | gmane.comp.gnu.glpk |
|---|---|
| Message-ID | <CAFN0HpBbT-88te=Yudt7EpuY73GWwSKjsH=WaTc+LDt44QxFwg@mail.gmail.com> |
--000000000000bd1b4905da3be290 Content-Type: text/plain; charset="UTF-8" Hi, I have to formulate a problem in mathprog where a variable can be both integer type and continuous type based on index. Let me give an example to further illustrate this. I have two sets of items: set itemInteger; set itemContinuous; I need to define a variable, awardQuantity, on these sets so that for items in the set itemInteger, it is of type Integer and for items in set itemContinuous, it is of type continuous. I know I can define two different variables: var awardQuantityInt[i in itemInteger], integer; var awardQuantityCont[i in itemContinuous]; But that is not what I am looking for. I want a single variable handling both types. I would really appreciate it if I can get some help on it. I have been trying to find an answer to this for a few days now. Thanks, Anku --000000000000bd1b4905da3be290 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">Hi,<div dir=3D"auto"><br></div><div dir=3D"auto">I have to= formulate a problem in mathprog where a variable can be both integer type = and continuous type based on index.</div><div dir=3D"auto"><br></div><div d= ir=3D"auto">Let me give an example to further illustrate this.=C2=A0</div><= div dir=3D"auto"><br></div><div dir=3D"auto">I have two sets of items:</div= ><div dir=3D"auto">set itemInteger;</div><div dir=3D"auto">set itemContinuo= us;</div><div dir=3D"auto"><br></div><div dir=3D"auto">I need to define a v= ariable, awardQuantity, on these sets so that for items in the set itemInte= ger, it is of type Integer and for items in set itemContinuous, it is of ty= pe continuous.=C2=A0</div><div dir=3D"auto"><br></div><div dir=3D"auto">I k= now I can define two different variables:</div><div dir=3D"auto"><br></div>= <div dir=3D"auto">var awardQuantityInt[i in itemInteger], integer;</div><di= v dir=3D"auto">var awardQuantityCont[i in itemContinuous];<br></div><div di= r=3D"auto"><br></div><div dir=3D"auto">But that is not what I am looking fo= r.</div><div dir=3D"auto">I want a single variable handling both types.=C2= =A0</div><div dir=3D"auto"><br></div><div dir=3D"auto"><br></div><div dir= =3D"auto"><br></div><div dir=3D"auto">I would really appreciate it if I can= get some help on it. I have been trying to find an answer to this for a fe= w days now.</div><div dir=3D"auto"><br></div><div dir=3D"auto">Thanks,</div= ><div dir=3D"auto">Anku</div><div><div dir=3D"ltr" data-smartmail=3D"gmail_= signature"><div dir=3D"ltr"><div><div dir=3D"ltr"><div><div dir=3D"ltr"><di= v dir=3D"ltr"><div><br></div><div><br><br></div></div></div></div></div></d= iv></div></div></div> </div> --000000000000bd1b4905da3be290--