integer.m

来自「optimization toolbox」· M 代码 · 共 30 行

M
30
字号
function x = integer(x)
%INTEGER Constrains variables to be integer
%
%   F = INTEGER(x) is used to posteriori constrain 
%   variables to be integer, in contrast to INTVAR 
%   that declares variables as integer a priori.
%
%   NOTE
%    The integrality constraint is imposed on the involved
%    decision variables, not on the actual SDPVAR object.
%
%   INPUT
%    x : SDPVAR object
%
%   OUTPUT
%    F : SET object
%
%   EXAMPLE
%    F = set(integer(x));             % Full verbose notation
%    F = integer(x);                  % Short notation
%    F = integer(x*pi)                % Equivalent to code above
%    solvesdp(G+set(integer(x)),obj)  % Add integer constraint on the fly
%
%   See also BINARY, SET, SDPVAR, INTVAR, BINVAR

% Author Johan L鰂berg
% $Id: integer.m,v 1.3 2004/07/06 14:08:12 johanl Exp $

x.typeflag = 7;
x = lmi(x);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?