Line | |
---|
1 | function [p,x_min,upper] = initializesolution(p); |
---|
2 | |
---|
3 | x_min = zeros(length(p.c),1); |
---|
4 | upper = inf; |
---|
5 | if 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 |
---|
14 | else |
---|
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 |
---|
24 | end |
---|
25 | |
---|
Note: See
TracBrowser
for help on using the repository browser.