User Tools

Site Tools


gams:use_the_matching_operator

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
gams:use_the_matching_operator [2009/08/14 14:35]
support
gams:use_the_matching_operator [2017/09/02 19:03]
support
Line 1: Line 1:
 ====== How do I use the matching operator? ====== ====== How do I use the matching operator? ======
-Q: I have ''​ SET        c com / c1*c593 /; ALIAS (c,​c1);''​ and I would like to have a kind of  compatibility matrix, i.e. if comp('​c1','​c5') = yes, +Q: I have ''​ SET   ​c com / c1*c10 /; ALIAS (c,​c1);''​ and I would like to have a kind of  compatibility matrix, i.e. if comp('​c1','​c8') = yes, 
-then the two elements are compatible. ​I have quite a few elements and doing this with parameters is very cumbersome. ​ Thus, I would like to use statements such as ''​comp(c1*c20c400*c500) = YES;'' ​+then the two elements are compatible. I would like to use statements such as ''​comp(c1*c4c8*c10) = YES;'' ​
  
 This can easily be achieved using the matching operator: This can easily be achieved using the matching operator:
 <​code>​ <​code>​
-SET        c com /c1*c593 /+SET        c com /c1*c10 /
 ALIAS (c,c1); ALIAS (c,c1);
-SET comp(c,c1) /c1*c20:c400*c500/;+SET comp(c,c1) /c1*c4:c8*c10/;
 display comp; display comp;
 +
 +----      4 SET comp  ​
 +            c8          c9         c10
 +c1         YES
 +c2                     YES
 +c3                                 YES
 </​code>​ </​code>​
  
-For more information please consult the [[http://​www.gams.com/​docs/​release/​release.htm#22.7|GAMS Release Notes for 22.7]] or the [[http://​www.gams.com/​mccarl/​mccarlhtml/​index.html?​defining_a_tuple_with_the_matc.htm|McCarl GAMS guide]]+For more information please consult the [[http://​www.gams.com/latest/docs/RN_227.html|GAMS Release Notes for 22.7]] or the McCarl GAMS guide.
  
  
IMPRESSUM / LEGAL NOTICEPRIVACY POLICY gams/use_the_matching_operator.txt · Last modified: 2017/09/02 19:03 by support