Rev | Line | |
---|
[37] | 1 | function LU = getbounds(F) |
---|
| 2 | |
---|
| 3 | K.f = 0; |
---|
| 4 | K.l = 0; |
---|
| 5 | L = []; |
---|
| 6 | U = []; |
---|
| 7 | LU = yalmip('getbounds',1:yalmip('nvars')); |
---|
| 8 | for i = 1:length(F.clauses) |
---|
| 9 | if F.clauses{i}.type == 2 |
---|
| 10 | X = F.clauses{i}.data; |
---|
| 11 | AB = getbase(X); |
---|
| 12 | K.l = prod(size(X)); |
---|
| 13 | variables = getvariables(X); |
---|
| 14 | [lb,ub,cand_rows] = findulb(AB,K); |
---|
| 15 | LU(variables,1) = max([lb LU(variables,1)]')'; |
---|
| 16 | LU(variables,2) = min([ub LU(variables,2)]')'; |
---|
| 17 | elseif F.clauses{i}.type == 3 |
---|
| 18 | % FIX : Extract from equalities and binary constraints |
---|
| 19 | end |
---|
| 20 | end |
---|
| 21 | |
---|
| 22 | binary = yalmip('binvariables'); |
---|
| 23 | LU(binary,1) = 0; |
---|
| 24 | LU(binary,2) = 1; |
---|
| 25 | |
---|
| 26 | % Try to bound some nonlinear terms |
---|
| 27 | % FIX: complete code |
---|
| 28 | [mt,variable_type] = yalmip('monomtable'); |
---|
| 29 | quadratic = find(variable_type == 2); |
---|
| 30 | if ~isempty(quadratic) |
---|
| 31 | M = mt(quadratic,:); |
---|
| 32 | for i = 1:size(M,1) |
---|
| 33 | [ii,jj] = find(M(i,:)); |
---|
| 34 | if length(ii) == 1 |
---|
| 35 | LU(quadratic(i),1) = min([0 LU(jj,1)^2]); |
---|
| 36 | LU(quadratic(i),2) = max([LU(jj,1)^2 LU(jj,2)^2]); |
---|
| 37 | end |
---|
| 38 | end |
---|
| 39 | end |
---|
Note: See
TracBrowser
for help on using the repository browser.