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

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

Added original make3d

File size: 1019 bytes
Line 
1function used = getvariables(F)
2
3used = recursivegetvariables(F,1,length(F.clauses));
4return
5
6m = length(F.clauses);
7if m == 1
8    used = getvariables(F.clauses{1}.data);
9else
10    if m>50
11        for i = 1:m
12            Fivars = getvariables(F.clauses{i}.data);
13            used = [used Fivars(:)'];
14        end
15        used = uniquestripped(used);
16    else
17        for i = 1:m
18            Fivars = getvariables(F.clauses{i}.data);
19            used = uniquestripped([used Fivars(:)']);
20        end
21    end
22end
23
24
25function used = recursivegetvariables(F,startindex,endindex)
26
27if endindex-startindex>50
28    newstart = startindex;
29    mid = ceil((startindex + endindex)/2);
30    newend = endindex;
31    used1 = recursivegetvariables(F,newstart,mid);
32    used2 = recursivegetvariables(F,mid+1,newend);
33    used = uniquestripped([used1 used2]);
34else
35    used = [];
36    for i = startindex:endindex
37        Fivars = getvariables(F.clauses{i}.data);
38        used = [used Fivars(:)'];
39    end
40    used = uniquestripped(used);
41end
Note: See TracBrowser for help on using the repository browser.