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

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

Added original make3d

File size: 1.1 KB
Line 
1function varargout = bounds(x,lower,upper,aux)
2%BOUNDS Adds implicit bounds on variables.
3%
4% BOUNDS IS OBSOLETE: Use standard SET constraints
5%
6% BOUNDS(x,Lower,Upper)   Adds bound constraints on variables.
7%                         These bounds are used when performing
8%                         big M formulations and similar things.
9
10% Author Johan Löfberg
11% $Id: bounds.m,v 1.6 2006/05/11 10:49:13 joloef Exp $   
12
13variables = getvariables(x);
14if nargin == 1
15    lb = yalmip('getbounds',variables);
16    lower = lb(:,1);
17    upper = lb(:,2);
18else
19    lower = lower(:);
20    upper = upper(:);
21    if length(lower)==1
22        lower = repmat(lower,length(variables),1);
23    end
24    if length(upper)==1
25        upper = repmat(upper,length(variables),1);
26    end
27    % 0 - No problems
28    % 1 - Trying to bound nonlinear variable
29    % 2 - Trying to bound nonlinear operator     
30    fail = yalmip('setbounds',variables,lower,upper);
31    switch fail
32        case {1,2}
33            error('BOUNDS can only be applied to linear unitary SDPVAR variables.')
34        otherwise
35    end
36end
37
38if nargout>0
39    varargout{1} = lower;
40    varargout{2} = upper;
41end
Note: See TracBrowser for help on using the repository browser.