source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/opt/yalmip/extras/findulb.m @ 37

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

Added original make3d

File size: 1.0 KB
Line 
1function [lb,ub,cand_rows] = findulb(F_struc,K)
2%FINDULB Internal function to extract upper and lower variable bounds
3
4% Author Johan Löfberg
5% $Id: findulb.m,v 1.4 2006/09/08 08:40:55 joloef Exp $
6
7n = size(F_struc,2)-1;
8lb = -inf*ones(n,1);
9ub = inf*ones(n,1);
10cand_rows = [];
11
12if (K.f ~=0)
13    A = -F_struc(1:K.f,2:end);
14    b = F_struc(1:K.f,1);
15    n = size(F_struc,2)-1;
16    cand_rows = find(sum(A~=0,2)==1);
17    for i = 1:length(cand_rows)
18        j = find(A(cand_rows(i),:));
19        ub(j)=min(ub(j),b(cand_rows(i))/A(cand_rows(i),j));
20        lb(j)=max(lb(j),b(cand_rows(i))/A(cand_rows(i),j));
21    end
22end
23
24if (K.l ~=0)   
25    A = -F_struc(K.f+1:K.f+K.l,2:end);
26    b = F_struc(K.f+1:K.f+K.l,1);       
27    n = size(F_struc,2)-1;   
28    cand_rows = find(sum(A~=0,2)==1);
29    for i = 1:length(cand_rows)
30        j = find(A(cand_rows(i),:));
31        if A(cand_rows(i),j)>0
32            ub(j)=min(ub(j),b(cand_rows(i))/A(cand_rows(i),j));
33        else
34            lb(j)=max(lb(j),b(cand_rows(i))/A(cand_rows(i),j));
35        end
36    end
37end
Note: See TracBrowser for help on using the repository browser.