source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/opt/yalmip/dev/regress_cp.m @ 37

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

Added original make3d

File size: 1.1 KB
Line 
1sdpvar x y z
2F = set(max(1,x)+max(y^2,z) < 3)+set(max(1,-min(x,y)) < 5)+set(norm([x;y],2) < z);
3sol = solvesdp(F,max(x,z)-min(y,z)-z);
4
5if ~(sol.problem == 0 & abs(double(max(x,z)-min(y,z)-z) - -sqrt(2))<1e-3)   
6    error('Failed')   
7end
8
9sdpvar x y z
10F = set(max(1,x)+max(y^2,z) < 3)+set(max(1,min(x,y)) < 5)+set(norm([x;y],2) < z);
11sol = solvesdp(F,max(x,z)-min(y,z)-z);
12if sol.problem ~= 14   
13    error('Failed')   
14end
15
16randn('seed',456);
17rand('seed',456);
18A = randn(15,2);
19b = rand(15,1)*5;
20x = sdpvar(2,1);
21sol = solvesdp([],-geomean(b-A*x));
22if ~(sol.problem == 0 & abs(double(-geomean(b-A*x)) - -2.7797)<1e-3)   
23    error('Failed')   
24end
25
26randn('seed',456);
27rand('seed',456);
28A = randn(15,2);
29b = rand(15,1)*5;
30x = sdpvar(2,1);
31sol = solvesdp([],-geomean([b-A*x;min(x)]));
32if ~(sol.problem == 0 & abs(double(-geomean([b-A*x;min(x)])) - -2.4936)<1e-3)   
33    error('Failed')   
34end
35
36n = 500;
37randn('seed',456);
38A = randn(2*n,n);
39b = randn(2*n,1);
40x=sdpvar(n,1);
41sol = solvesdp([],norm(A*x-b));
42if ~(sol.problem == 0 & abs(double(norm(A*x-b)) - 24.126)<1e-3)   
43    error('Failed')   
44end
45
46
47
48
Note: See TracBrowser for help on using the repository browser.