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

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

Added original make3d

File size: 753 bytes
Line 
1function p = polytope(X)
2% polytope  Converts set object to polytope object       
3%
4% P     = polytope(F)
5% [P,x] = polytope(F)
6%
7% P : polytope object (Requires the Multi-parametric Toolbox)
8% x : sdpvar object defining the variables in the polytope P.H*x<P.K
9% F : set-object with linear inequalities
10
11% Author Johan Löfberg
12% $Id: polytope.m,v 1.3 2005/02/04 10:10:27 johanl Exp $
13
14
15if all(is(X,'element-wise'))% & all(is(X,'linear'))
16    f = [];
17    for i = 1:length(X)
18        if  X.clauses{i}.type==2
19            fi =  X.clauses{i}.data;
20            f = [f;fi(:)];
21        end
22    end
23   
24    B = full(getbase(f));
25    p = polytope(-B(:,2:end),B(:,1));
26else
27    error('polytope can only be applied to SET objects with linear inequalities.')
28end
Note: See TracBrowser for help on using the repository browser.