source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/opt/yalmip/modules/robust/robustify_sdp_conic.m @ 37

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

Added original make3d

File size: 1.7 KB
Line 
1function F = robustify_sdp_conic(F_xw,Zmodel,x,w)
2
3if length(F_xw) == 0
4    F = [];
5    return;
6else
7    Ftemp = [];
8    for i = 1:length(F_xw)
9        Fi = sdpvar(F_xw(i));
10        if degree(Fi(:),w) > 1
11            [BilinearizeringConstraints,failure] = deriveBilinearizing(Fi,w);
12            if failure
13                error('Cannot get rid of nonlinear uncertainty in uncertain SDP')
14            else
15                Ftemp = Ftemp + BilinearizeringConstraints;
16            end
17        end
18    end
19    F_xw = F_xw + Ftemp;
20
21    if any(Zmodel.K.q) | any(Zmodel.K.s)
22        error('Only polytope uncertainty supported for uncertain SDPs');
23    else
24        % FIX : Assumes all uncertainty in all constraints
25        K = Zmodel.K;
26        A = -Zmodel.F_struc((1+K.f):(K.f + K.l),2:end);
27        b =  Zmodel.F_struc((1+K.f):(K.f + K.l),1);
28
29        try
30            vertices = extreme(polytope(A,b))';
31        catch
32            disp('You probably need to install MPT (needed for vertex enumeration)')
33            disp('http://control.ee.ethz.ch/~joloef/wiki/pmwiki.php?n=Solvers.MPT')
34            error('MPT missing');
35        end
36        if K.f > 0
37            Aeq = -Zmodel.F_struc(1:K.f,2:end);
38            beq =  Zmodel.F_struc(1:K.f,1);
39            feasible = sum(abs(Aeq*vertices - repmat(beq,1,size(vertices,2))),1) < 1e-6;
40            vertices = vertices(:,feasible);
41            if isempty(feasible)
42                error('The uncertainty space is infeasible.')               
43            end
44        end
45
46        F = set([]);
47        for j = 1:length(F_xw)
48            for i = 1:size(vertices,2)
49                F = F + set(replace(F_xw(j),w,vertices(:,i)));
50            end
51        end
52    end
53end
Note: See TracBrowser for help on using the repository browser.