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

📄 addevalvariablecuts.m

📁 optimization toolbox
💻 M
字号:
function pcut = addEvalVariableCuts(p)

temp = p.F_struc(1:p.K.f,:);
p.F_struc(1:p.K.f,:) = [];
pcut = p;
for i = 1:length(p.evalMap)
    y = p.evalVariables(i);
    x = p.evalMap{i}.variableIndex;
    xL = p.lb(x);
    xU = p.ub(x);

    switch p.evalMap{i}.fcn
        case 'exp'
            [Ax, Ay, b] = bound_exp(xL,xU);
        case {'sqrtm','sqrtm_internal'}
            [Ax, Ay, b] = bound_sqrtm(xL,xU);
        otherwise
            Ax = zeros(0,1);
            Ay = zeros(0,1);
            b = zeros(0,1);
    end
    F_structemp = zeros(size(b,1),length(p.c)+1);
    F_structemp(:,1+y) = -Ay;
    F_structemp(:,1+x) = -Ax;
    F_structemp(:,1) = b;
    pcut.F_struc = [F_structemp; pcut.F_struc];
    pcut.K.l = pcut.K.l + length(b);

end
pcut.F_struc = [temp;pcut.F_struc];

⌨️ 快捷键说明

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