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

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

Added original make3d

File size: 763 bytes
Line 
1function [p,x_min,upper] = initializesolution(p);
2
3x_min = zeros(length(p.c),1);
4upper = inf;
5if p.options.usex0
6    x = p.x0;
7    z = evaluate_nonlinear(p,x);
8    residual = constraint_residuals(p,z);
9    relaxed_feasible = all(residual(1:p.K.f)>=-p.options.bmibnb.eqtol) & all(residual(1+p.K.f:end)>=p.options.bmibnb.pdtol);
10    if relaxed_feasible
11        upper = p.f+p.c'*z+z'*p.Q*z;
12        x_min = x;
13    end
14else
15    p.x0 = zeros(length(p.c),1);
16    x = p.x0;
17    z = evaluate_nonlinear(p,x);
18    residual = constraint_residuals(p,z);
19    relaxed_feasible = all(residual(1:p.K.f)>=-p.options.bmibnb.eqtol) & all(residual(1+p.K.f:end)>=p.options.bmibnb.pdtol);
20    if relaxed_feasible
21        upper = p.f+p.c'*z+z'*p.Q*z;
22        x_min = x;
23    end   
24end
25
Note: See TracBrowser for help on using the repository browser.