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

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

Added original make3d

File size: 805 bytes
Line 
1% *************************************************************************
2% Code for setting the numerical values of nonlinear terms
3% *************************************************************************
4function p = updateonenonlinearbound(p,changed_var)
5if ~isempty(p.bilinears)
6    impactedVariables = find((p.bilinears(:,2) == changed_var) | (p.bilinears(:,3) == changed_var));
7    x = p.bilinears(impactedVariables,2);
8    y = p.bilinears(impactedVariables,3);
9    z = p.bilinears(impactedVariables,1);
10    x_lb = p.lb(x);
11    x_ub = p.ub(x);
12    y_lb = p.lb(y);
13    y_ub = p.ub(y);
14    bounds = [x_lb.*y_lb x_lb.*y_ub x_ub.*y_lb x_ub.*y_ub];
15    p.lb(z) = max([p.lb(z) min(bounds,[],2)],[],2);
16    p.ub(z) = min([p.ub(z) max(bounds,[],2)],[],2)';
17    p.lb(impactedVariables(x==y)<0) = 0;
18end
Note: See TracBrowser for help on using the repository browser.