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

📄 find_simple_variable_bounds.m

📁 求解线性矩阵不等式简单方便--与LMI工具箱相比
💻 M
字号:
function [p,lower,upper] = find_simple_variable_bounds(p);

if any(p.K.q > 0) | any(p.K.s > 0)
    lower = -inf(length(p.c),1);
    upper = inf(length(p.c),1);
else
    [lower,upper,used_rows] = findulb(p.F_struc,p.K);
    used_rows = used_rows(~any(full(p.F_struc(used_rows,1+find(p.variabletype~=0))),2));
    if ~isempty(used_rows)
        p_temp = p;
        p_temp.F_struc(p.K.f+used_rows,:)=[];
        p_temp.K.l = p.K.l - length(used_rows);

        if size(p.F_struc,1) > 0
            % These variables are still used in some other constraints
            still_used = find(sum(abs(p_temp.F_struc(:,2:end)),1) > 0);
            if ~isempty(still_used)
                % we have to keep these variables
                lower(still_used) = -inf;
                upper(still_used) = inf;
                % They are used here
                keep_rows = find(sum(abs(p.F_struc(:,1+still_used)),2) > 0);
                if any(keep_rows>(p.K.l + p.K.f))
                    %  error('Tell johan to fix the SDP case in find_simple_variable_bounds!')
                end
                used_rows = used_rows + p.K.f;
                used_rows = setdiff(used_rows,keep_rows);
                p.F_struc(used_rows,:)=[];
                p.K.l = p.K.l - nnz(used_rows>p.K.f);
                p.K.f = p.K.f - nnz(used_rows<=p.K.f);
            else
                p = p_temp;
            end
        else
            p = p_temp;
        end
    end
end

⌨️ 快捷键说明

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