source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/opt/yalmip/extras/@constraint/set.m @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

File size: 2.2 KB
Line 
1function F = set(varargin)
2%set               Defines a constraint (the feasible set)
3%   
4%    F = SET               Creates an empty SET-object
5%
6%  Constraints can be generated using string notation
7%    F = SET('X>Y')        Constrains X-Y to be positive semi-definite if X-Y is Hermitian,
8%                          interpreted as element-wise constraint otherwise
9%    F = SET('X==Y')       Element-wise equality constraint 
10%    F = SET('||X||<Y')    Create second order cone constraint (X and Y column vectors)
11%
12%  One can also use overloaded >, < and ==
13%    F = SET(X > Y)          Constrains X-Y to be positive semi-definite if X-Y is Hermitian,
14%                          interpreted as element-wise constraint otherwise
15%    F = SET(X==Y)         Element-wise equality constraint
16%    F = SET(CONE(X,Y))    Second order cone constraint (X and Y column vectors)
17%
18%  Variables can be constrained to be integer or binary
19%    F = SET(INTEGER(X))
20%    F = SET(BINARY(X))
21%
22%  Multiple constraints are obtained with overloaded plus
23%    F = set(X > 0) + set(CONE(X(:),1)) + SET(X(1,1) == 1/2)
24%
25%  Double-sided constraint (and extensions) can easily be defined
26%  The following two comands give equivalent problems
27%    F = set(X > 0 > Y > Z < 5 < W)
28%    F = set(X > 0) + set(0 > Y) + set(Y > Z) + set(Z < 5) + set(5 < W)
29%
30%
31%  General info
32%    A constraint can be tagged with a name or description
33%    F = SET(X > Y,'tag')  Gives the constraint a tag (used in display/checkset) 
34%
35%    The right-hand side and left-hand side can be interchanged. Supports {>,<,==}.
36%
37%    All inequalities are interpreted as non-strict.
38%
39%    For notational purposes though, both >= and > are supported (as well as < and <=)
40%
41%    Any valid expression built using DOUBLEs & SDPVARs can be used on both sides.
42%
43%    The advantage of using the string notation approach is that more information will be 
44%    shown when the SET is displayed (and in checkset)
45%
46%    See also   DUAL, SOLVESDP, INTEGER, BINARY
47
48switch nargin
49case 0
50    F = lmi;
51case 1
52    F = lmi(varargin{1});
53case 2
54    F = lmi(varargin{1},varargin{2});
55case 3
56    F = lmi(varargin{1},varargin{1},varargin{3});
57case 4
58    F = lmi(varargin{1},[],[],1);
59   
60otherwise
61end
62   
Note: See TracBrowser for help on using the repository browser.