source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/opt/yalmip/extras/presolve_probebinary.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  [oldlb,oldub] = presolve_probebinary(A,b,c,lb,ub,binary_variables);
2
3% Author Johan Löfberg
4% $Id: presolve_probebinary.m,v 1.1 2005/10/05 14:54:55 joloef Exp $
5
6
7goon = 1;
8
9AL0A  = (A>0).*A;
10AG0A  = (A<0).*A;
11
12At = A';
13%used = full(any(A(:,find(changed_bounds)),2));
14isbinary  = ismembc(1:length(lb),binary_variables);
15isinteger = ismembc(1:length(lb),binary_variables);
16
17goon = all(lb<=ub);
18
19oldub = ub;
20oldlb = lb;
21
22for i = 1:length(binary_variables)
23       
24    % Probe up
25    lb = oldlb;
26    ub = oldub;
27    if lb(binary_variables(i))~=ub(binary_variables(i))
28        lb(binary_variables(i)) = 1;   
29        bi_dn = AL0A*lb+AG0A*ub;
30        if any(bi_dn>b)
31            oldlb(binary_variables(i)) = 0;   
32            oldub(binary_variables(i)) = 0;   
33        end
34    end
35    % Probe down
36    lb = oldlb;
37    ub = oldub;
38    if lb(binary_variables(i))~=ub(binary_variables(i))
39        ub(binary_variables(i)) = 0;   
40        bi_dn = AL0A*lb+AG0A*ub;
41        if any(bi_dn>b)
42            oldlb(binary_variables(i)) = 1;   
43            oldub(binary_variables(i)) = 1;   
44        end
45    end
46end
47
48fix_this = [];
49fix_value = [];
Note: See TracBrowser for help on using the repository browser.