domain_reduction.m

来自「matlab波形优化算法经常要用到的matlab toolbox工具箱:yalm」· M 代码 · 共 24 行

M
24
字号
function [p,feasible,vol_reduction] = domain_reduction(p,upper,lower,lpsolver,xmin);
% This is just too expensive
LU = [p.lb p.ub];
t1 = p.binary_variables;
t2 = p.integer_variables;
p.binary_variables = [];
p.integer_variables = [];
if ~p.options.bmibnb.lpreduce | ((size(p.lpcuts,1)==0) & (any(p.lb(p.linears)<-1e8) & any(p.ub(p.linears)>1e8)))
    vol_reduction = 1;
    p.feasible = 1;

    p.lb(p.integer_variables) = ceil(p.lb(p.integer_variables));
    p.ub(p.integer_variables) = floor(p.ub(p.integer_variables));
    p.lb(p.binary_variables) = ceil(p.lb(p.binary_variables));
    p.ub(p.binary_variables) = floor(p.ub(p.binary_variables));

else
    [p,p.feasible] =  boxreduce(p,upper,lower,lpsolver,p.options,xmin);
end
p.binary_variables  = t1;
p.integer_variables = t2;
if ~isequal(LU,[p.lb p.ub])
    p.changedbounds = 1;
end

⌨️ 快捷键说明

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