source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/opt/yalmip/extras/presolve_fixvariables.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 
1function [fix_up,fix_down] = presolve_fixvariables(A,b,c,lb,ub,monotinicity)
2
3% These are optimally (or w.l.o.g) set to upper bound
4not_in_obj = find(c<=0);
5% Setting to 1 makes Ax<b increase feasible set for these variables
6constrained_blow = all(-A(:,not_in_obj)>=0,1);
7% and they enter via a psd matrix in all sdp constraints
8sdp_positive = monotinicity(not_in_obj) == -1;
9% these variables satisffy all constraints
10can_fix = not_in_obj(find(constrained_blow & sdp_positive));
11% these variables are still not fixed
12still_on = find(lb==0 & ub==1);
13% so we can fix these
14fix_up = intersect(can_fix,still_on);
15
16% These are optimally (or w.l.o.g) set to lower bound
17not_in_obj = find(c>=0);
18% Setting to 1 makes Ax<b increase feasible set for these variables
19constrained_blow = all(A(:,not_in_obj)>=0,1);
20% and they enter via a psd matrix in all sdp constraints
21sdp_positive = monotinicity(not_in_obj) == 1;
22% these variables satisffy all constraints
23can_fix = not_in_obj(find(constrained_blow & sdp_positive));
24% these variables are still not fixed
25still_on = find(lb==0 & ub==1);
26% so we can fix these
27fix_down = intersect(can_fix,still_on);
28
Note: See TracBrowser for help on using the repository browser.