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