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