User Tools

Site Tools


gams:formulate_a_power_set

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
gams:formulate_a_power_set [2012/01/10 14:34]
support
gams:formulate_a_power_set [2012/01/10 14:58] (current)
support
Line 32: Line 32:
   ps(c,i) 'power set of i'   ps(c,i) 'power set of i'
   ;   ;
-scalar j; +parameter num(c)num2(c); 
-loop {c, +num(c) ​= ord(c)-1; 
-   j = ord(c) - 1; +loop {i, 
-   ​loop {i, +   num2(c) = floornum(c)/2 ); 
-       ps(c,i) = mod(j, 2); +   ps(c,​i) ​num2(c)*ne num(c); 
-       j floor(j / 2); +   num(c) ​ = num2(c);
-   }+
 } }
 display ps; display ps;
 </​code>​ </​code>​
- 
 <​code>​ <​code>​
 ----     17 SET ps  power set of i ----     17 SET ps  power set of i
IMPRESSUM / LEGAL NOTICEPRIVACY POLICY gams/formulate_a_power_set.txt · Last modified: 2012/01/10 14:58 by support