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

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

Added original make3d

File size: 1.9 KB
Line 
1function sys = addlmi(F,X,handlestring)
2% ADDLMI Obsolete.
3%
4% Use overloaded + instead.
5%
6
7% Author Johan Löfberg
8% $Id: addlmi.m,v 1.2 2004/07/19 13:54:35 johanl Exp $
9
10
11error('addlmi is obsolete. Use overloaded +');
12
13switch(nargin)
14    case {0,1}
15        error('ADDLMI needs at least two arguments')
16    case 2
17        %       sys = F + lmi(X);
18        handlestring = '';
19    case 3
20        %       sys = F + lmi(X,handlestring);
21        if ~isa(handlestring,'char')
22            error('The handle must be a string')
23        end
24    otherwise
25        error('addlmi takes at mopst 3 arguments');
26end
27
28% Return empty LMI in degenerate case
29if isempty(X)
30    sys = F;
31    return
32end
33
34%Symbolic expression given
35% 0 : Nothing (i.e. error)
36% 1 : LMI
37% 2 : Elementwise
38% 3 : Equality
39TypeofConstraint = 0;
40switch class(X)
41    case 'char'
42        try
43            sdpvarExpr =  parseLMI(X);
44            X = strrep(X,'.>','>');
45            X = strrep(X,'.<','<');
46            X = strrep(X,'=','==');X = strrep(X,'====','==');
47        catch
48            error(lasterr)
49        end
50        try
51            Fi=evalin('caller',sdpvarExpr);
52            if ~(isa(Fi,'sdpvar') | isa(Fi,'constraint'))
53                error('The string does not define a constraint involving SDPVAR objects')
54            end
55        catch
56            error(lasterr)
57        end
58    case 'sdpvar'
59        Fi = X;
60        X='Numeric value';
61    case 'constraint'
62        Fi = getlist(X);
63        if length(Fi)>1
64            error('Hey, you have updated your code for version 3, so why don''t you remove those addlmi''s');
65        else
66            Fi = Fi{1};
67        end
68        X='Numeric value';       
69    otherwise
70        error('LMI should be an sdpvar object or string.')
71end
72
73if isempty(Fi)
74    sys = F;
75    return
76end
77
78switch nargin
79    case 2
80        sys = F + lmi(Fi);
81    case 3
82        sys = F + lmi(Fi,handlestring);
83    otherwise
84end
85return
Note: See TracBrowser for help on using the repository browser.