source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/opt/yalmip/extras/@ncvar/log.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 varargout = log(varargin)
2%LOG (overloaded)
3
4% Author Johan Löfberg
5% $Id: log.m,v 1.1 2006/08/10 18:00:21 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.
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                F = F + set(X > eps);
36               
37                % Let YALMIP know about convexity etc               
38                varargout{1} = F;
39                varargout{2} = struct('convexity','concave','monotonicity','increasing','definiteness','none');
40                varargout{3} = X;
41               
42            case 'milp'
43                    varargout{1} = [];
44                    varargout{2} = [];
45                    varargout{3} = [];               
46            otherwise
47                error('SDPVAR/LOG called with CHAR argument?');
48        end
49    otherwise
50        error('SDPVAR/LOG called with CHAR argument?');
51end
Note: See TracBrowser for help on using the repository browser.