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

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

Added original make3d

File size: 480 bytes
Line 
1function milp
2
3rand('seed',1234);
4
5a = [1 2 3 4 5 6]';
6t = (0:0.02:2*pi)';
7x = [sin(t) sin(2*t) sin(3*t) sin(4*t) sin(5*t) sin(6*t)];
8y = x*a+(-4+8*rand(length(x),1));
9
10a_hat = intvar(6,1);
11
12residuals = y-x*a_hat;
13bound = sdpvar(length(residuals),1);
14F = set(-bound <= residuals <= bound);
15ops = sdpsettings('solver','bnb');
16
17% Test QP
18obj = sum(bound);
19sol = solvesdp(F,obj,ops);
20mbg_asserttolequal(sol.problem,0);
21mbg_asserttolequal(double(obj), 6.168422746718130e+002, 1e-5);
22
Note: See TracBrowser for help on using the repository browser.