source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/opt/yalmip/@sdpvar/exp.m @ 37

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

Added original make3d

File size: 2.4 KB
Line 
1function varargout = exp(varargin)
2%EXP (overloaded)
3
4% Author Johan Löfberg
5% $Id: exp.m,v 1.8 2006/09/04 12:52:08 joloef Exp $
6
7switch class(varargin{1})
8
9    case 'double' % What is the numerical value of this argument (needed for displays etc)
10        % SHOULD NEVER HAPPEN, THIS SHOULD BE CAUGHT BY BUILT-IN
11        error('Overloaded SDPVAR/NORM CALLED WITH DOUBLE. Report error')
12
13    case 'sdpvar' % Overloaded operator for SDPVAR objects. Pass on args and save them.
14        if length(varargin{1}) == 1
15            varargout{1} = yalmip('addEvalVariable',mfilename,varargin{1});
16        else
17            y = [];
18            for i = 1:length(varargin{1})
19                y = [y;yalmip('addEvalVariable',mfilename,extsubsref(varargin{1},i))];
20            end
21            varargout{1} = y;
22        end
23
24    case 'char' % YALMIP sends 'model' when it wants the epigraph or hypograph
25        switch varargin{1}
26            case 'graph'
27                t = varargin{2};
28                X = varargin{3};
29               
30                % This is different from so called extended operators
31                % Just do it!
32                F = SetupEvaluationVariable(varargin{:});
33               
34                % Now add your own code, such as domain constraints.
35                % Exponential does not need any domain constraint.
36               
37                % Let YALMIP know about convexity etc
38                varargout{1} = F;
39                varargout{2} = struct('convexity','convex','monotonicity','increasing','definiteness','positive');
40                varargout{3} = X;
41               
42            case 'milp'
43                t = varargin{2};
44                X = varargin{3};
45               
46                % This is different from so called extended operators
47                % Just do it!
48                F = SetupEvaluationVariable(varargin{:});
49               
50                % Now add your own code, such as domain constraints.
51                % Exponential does not need any domain constraint.
52               
53                % Let YALMIP know about convexity etc
54                varargout{1} = F;
55                varargout{2} = struct('convexity','milp','monotonicity','milp','definiteness','milp');
56                varargout{3} = X;                             
57            otherwise
58                error('SDPVAR/EXP called with CHAR argument?');
59        end
60    otherwise
61        error('SDPVAR/EXP called with CHAR argument?');
62end
Note: See TracBrowser for help on using the repository browser.