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

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

Added original make3d

File size: 807 bytes
Line 
1function [equalities,redundant] = mpt_detect_fixed_rows(Matrices)
2
3A = [ Matrices.G -Matrices.E];
4b = Matrices.W;
5lb = Matrices.lb;
6ub = Matrices.ub;
7
8fixed = find(lb == ub);
9if ~isempty(fixed)
10    b = b-A(:,fixed)*lb(fixed);
11    A(:,fixed) = [];
12    ub(fixed)=[];
13    lb(fixed)=[];
14end
15
16[AA, BB, AAeq, BBeq,indeq] = mpt_ineq2eq(A, b);
17if ~isempty(indeq)
18    i = indeq(:,1);
19    j = indeq(:,2);
20    equalities = unique(i);
21    redundant = unique([i;j]);
22    equalities = setdiff(equalities,intersect(i,j));  % The case [43 51;51 89;89 97]
23    AL0A  = (A>0).*A;
24    AG0A  = (A<0).*A;
25    bi_up = AL0A*ub+AG0A*lb;
26    redundant = unique([redundant;find([bi_up<b])]);
27else
28    AL0A  = (A>0).*A;
29    AG0A  = (A<0).*A;
30    bi_up = AL0A*ub+AG0A*lb;
31    redundant = unique(find(bi_up<b));
32    equalities = [];
33end
Note: See TracBrowser for help on using the repository browser.