?? find_simple_variable_bounds.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 + -