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

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

Added original make3d

File size: 1.5 KB
Line 
1function varargout = sin (varargin)
2%SIN (overloaded)
3
4% Author Johan Löfberg
5% $Id: sin.m,v 1.4 2006/09/08 14:16:58 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/SIN 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','milp'}
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                % Let YALMIP know about convexity etc
35                varargout{1} = F;
36                varargout{2} = struct('convexity','none','monotonicity','none','definiteness','none');
37                varargout{3} = X;
38
39            otherwise
40                error('SDPVAR/SIN called with CHAR argument?');
41        end
42    otherwise
43        error('SDPVAR/SIN called with CHAR argument?');
44end
Note: See TracBrowser for help on using the repository browser.