Rev | Line | |
---|
[37] | 1 | function x = integer(x) |
---|
| 2 | %INTEGER Constrains variables to be integer |
---|
| 3 | % |
---|
| 4 | % F = INTEGER(x) is used to posteriori constrain |
---|
| 5 | % variables to be integer, in contrast to INTVAR |
---|
| 6 | % that declares variables as integer a priori. |
---|
| 7 | % |
---|
| 8 | % NOTE |
---|
| 9 | % The integrality constraint is imposed on the involved |
---|
| 10 | % decision variables, not on the actual SDPVAR object. |
---|
| 11 | % |
---|
| 12 | % INPUT |
---|
| 13 | % x : SDPVAR object |
---|
| 14 | % |
---|
| 15 | % OUTPUT |
---|
| 16 | % F : SET object |
---|
| 17 | % |
---|
| 18 | % EXAMPLE |
---|
| 19 | % F = set(integer(x)); % Full verbose notation |
---|
| 20 | % F = integer(x); % Short notation |
---|
| 21 | % F = integer(x*pi) % Equivalent to code above |
---|
| 22 | % solvesdp(G+set(integer(x)),obj) % Add integer constraint on the fly |
---|
| 23 | % |
---|
| 24 | % See also BINARY, SET, SDPVAR, INTVAR, BINVAR |
---|
| 25 | |
---|
| 26 | % Author Johan Löfberg |
---|
| 27 | % $Id: integer.m,v 1.3 2004/07/06 14:08:12 johanl Exp $ |
---|
| 28 | |
---|
| 29 | x.typeflag = 7; |
---|
| 30 | x = lmi(x); |
---|
Note: See
TracBrowser
for help on using the repository browser.