source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/opt/yalmip/dev/tests-mbg/bnb/test_bnb_yongyouhu.m @ 37

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

Added original make3d

File size: 928 bytes
Line 
1function micp
2
3
4Loc_n=4;
5Sen_n=3;
6Nvar=Loc_n*Sen_n;  %Variable number
7
8%Constants
9C=[1 1;1 0;0 1;0 1];
10s1=5.0693;
11s4=3.8259;
12Cov_M=[1.501 0.523 0.978 0.978; 3.002 1.046 1.956 1.956; 4.503 1.569 2.934 2.934]';
13Z=[2500 1500 800]; %$,cost
14
15%variable claim
16X=binvar(Nvar,1);    % [q11 q12 q13 q21 q22 q23 q31 q32 q33 q41 q42 q43]
17
18%Constraints (LMIs)
19
20for i=1:Loc_n
21    k=3*i-2;
22    Xigma_inv(i,i)=1./Cov_M(i,:).^2*X(k:k+2);
23end
24
25P1(2:3,2:3)=C'*Xigma_inv*C;
26P1(1,1)=s1;
27P1(1,2:3)=C(1,:);
28P1(2:3,1)=C(1,:)';
29
30P2=P1;
31P2(1,1)=s4;
32P2(1,2:3)=C(4,:);
33P2(2:3,1)=C(4,:)';
34
35P3(1,1)=1-sum(X(1:3));
36P3(2,2)=1-sum(X(4:6));
37P3(3,3)=1-sum(X(7:9));
38P3(4,4)=1-sum(X(10:12));
39
40
41F=set(P1>0)+set(P2>0)+set(diag(P3)>=0);
42
43%Objective
44cc=zeros(1,Nvar);
45cc(1:Sen_n)=Z;
46cc(Sen_n+1:2*Sen_n)=Z;
47cc(2*Sen_n+1:3*Sen_n)=Z;
48cc(3*Sen_n+1:end)=Z;
49
50obj=cc*X;
51
52sol = solvesdp(F,obj);
53
54mbg_asserttolequal(sol.problem,0);
55mbg_asserttolequal(double(obj), 3000, 1e-5);
56
Note: See TracBrowser for help on using the repository browser.