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

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

Added original make3d

File size: 970 bytes
Line 
1function sys = intvar(varargin)
2%INTVAR Create symbolic integer variable
3%   
4%   INTVAR works exactly as SDPVAR, with the only difference that
5%   the elements in the variable automatically will be constrained
6%   to be integer when an optimization problem is solved.
7%
8%   See also SDPVAR, BINVAR, INTEGER, BINARY
9
10% Author Johan Löfberg
11% $Id: intvar.m,v 1.7 2006/05/17 13:22:29 joloef Exp $
12
13all_variable_names = 1;
14i = 1;
15while all_variable_names & i<=nargin
16    all_variable_names = all_variable_names & isvarname(varargin{i});
17    i = i + 1;
18end
19if all_variable_names
20    for k = 1:nargin
21        varname = varargin{k};
22        assignin('caller',varname,intvar(1,1));
23    end
24else
25    sys = sdpvar(varargin{:});
26    if isa(sys,'cell')
27        for i = 1:length(sys)
28            yalmip('setintvariables',[yalmip('intvariables') getvariables(sys{i})]);
29        end
30    else
31        yalmip('setintvariables',[yalmip('intvariables') getvariables(sys)]);
32    end
33end
Note: See TracBrowser for help on using the repository browser.