⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 presolve_probebinary.m

📁 matlab波形优化算法经常要用到的matlab toolbox工具箱:yalmip
💻 M
字号:
function  [oldlb,oldub] = presolve_probebinary(A,b,c,lb,ub,binary_variables);

% Author Johan L鰂berg
% $Id: presolve_probebinary.m,v 1.1 2005/10/05 14:54:55 joloef Exp $


goon = 1;

AL0A  = (A>0).*A;
AG0A  = (A<0).*A;

At = A';
%used = full(any(A(:,find(changed_bounds)),2));
isbinary  = ismembc(1:length(lb),binary_variables);
isinteger = ismembc(1:length(lb),binary_variables);

goon = all(lb<=ub);

oldub = ub;
oldlb = lb;

for i = 1:length(binary_variables)
        
    % Probe up
    lb = oldlb;
    ub = oldub;
    if lb(binary_variables(i))~=ub(binary_variables(i))
        lb(binary_variables(i)) = 1;   
        bi_dn = AL0A*lb+AG0A*ub;
        if any(bi_dn>b)
            oldlb(binary_variables(i)) = 0;   
            oldub(binary_variables(i)) = 0;   
        end
    end
    % Probe down
    lb = oldlb;
    ub = oldub;
    if lb(binary_variables(i))~=ub(binary_variables(i))
        ub(binary_variables(i)) = 0;   
        bi_dn = AL0A*lb+AG0A*ub;
        if any(bi_dn>b)
            oldlb(binary_variables(i)) = 1;   
            oldub(binary_variables(i)) = 1;   
        end
    end
end

fix_this = [];
fix_value = [];

⌨️ 快捷键说明

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