source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/opt/yalmip/extras/@lmi/getbounds.m @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

File size: 1.0 KB
Line 
1function LU = getbounds(F)
2
3K.f = 0;
4K.l = 0;
5L = [];
6U = [];
7LU =  yalmip('getbounds',1:yalmip('nvars'));
8for 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
20end
21
22binary = yalmip('binvariables');
23LU(binary,1) = 0;
24LU(binary,2) = 1;
25
26% Try to bound some nonlinear terms
27% FIX: complete code
28[mt,variable_type] = yalmip('monomtable');
29quadratic = find(variable_type == 2);
30if ~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
39end
Note: See TracBrowser for help on using the repository browser.