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

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

Added original make3d

File size: 1.2 KB
Line 
1function varargout=ceil(varargin)
2%CEIL (overloaded)
3
4% Author Johan Löfberg
5% $Id: ceil.m,v 1.1 2006/08/10 18:00:19 joloef Exp $
6
7switch class(varargin{1})
8
9    case 'sdpvar' % Overloaded operator for SDPVAR objects. Pass on args and save them.
10
11        x = varargin{1};
12       
13        dim = size(x);
14        x = reshape(x,prod(dim),1);
15        y = [];
16        for i = 1:prod(dim)
17            y = [y;yalmip('addextendedvariable',mfilename,extsubsref(x,i))];
18        end
19        y = reshape(y,dim);
20        varargout{1} = y;
21       
22    case 'char' % YALMIP send 'graph' when it wants the epigraph or hypograph
23        switch varargin{1}
24            case {'milp','graph'}
25                % Description using epigraphs
26                t = varargin{2};
27                X = varargin{3};
28               
29                c = intvar(1,1);
30                F = set(x <= c <= x + 1);
31
32                varargout{1} = F;
33                varargout{2} = struct('convexity','milp','monotonicity','milp','definiteness','milp');
34                varargout{3} = X;
35               
36            otherwise
37                error('SDPVAR/SORT called with CHAR argument?');
38        end
39    otherwise
40        error('Strange type on first argument in SDPVAR/SORT');
41end
Note: See TracBrowser for help on using the repository browser.