source:
proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/opt/yalmip/dev/tests-mbg/dualize/test_primalize_2.m
@
37
Last change on this file since 37 was 37, checked in by , 14 years ago | |
---|---|
File size: 406 bytes |
Line | |
---|---|
1 | function sdp1 |
2 | |
3 | n = 10; |
4 | randn('seed',123456789); |
5 | |
6 | A = randn(n);A = A - max(real(eig(A)))*eye(n)*1.5; |
7 | B = randn(n,1); |
8 | C = randn(1,n); |
9 | |
10 | t = sdpvar(1,1); |
11 | P = sdpvar(n,n); |
12 | |
13 | obj = t; |
14 | F = set(kyp(A,B,P,blkdiag(C'*C,-t)) < 0) |
15 | |
16 | [Fp,objp,free] = primalize(F,-obj); |
17 | |
18 | sol = solvesdp(Fp,objp,sdpsettings('removeequalities',1)) |
19 | |
20 | mbg_asserttolequal(sol.problem,0); |
21 | mbg_asserttolequal(double(obj),3.38842085719774, 1e-5); |
Note: See TracBrowser
for help on using the repository browser.