Line | |
---|
1 | function F = projection(F,x,method) |
---|
2 | % REDUCE Removes redundant constraints using MPT |
---|
3 | % |
---|
4 | % Freduced = reduce(F) |
---|
5 | % |
---|
6 | % F : Polytopic SET object |
---|
7 | % |
---|
8 | % See also POLYTOPE, PROJECTION |
---|
9 | |
---|
10 | % Author Johan Löfberg |
---|
11 | % $Id: reduce.m,v 1.3 2005/02/04 10:10:27 johanl Exp $ |
---|
12 | |
---|
13 | f = []; |
---|
14 | for i = 1:length(F) |
---|
15 | if F.clauses{i}.type==2 |
---|
16 | fi = F.clauses{i}.data; |
---|
17 | f = [f;fi(:)]; |
---|
18 | else |
---|
19 | error('Only linear element-wise inequalities can be reduced') |
---|
20 | end |
---|
21 | end |
---|
22 | |
---|
23 | if ~islinear(F) |
---|
24 | error('Only linear element-wise inequalities can be reduced') |
---|
25 | end |
---|
26 | |
---|
27 | B = full(getbase(f)); |
---|
28 | P = polytope(-B(:,2:end),B(:,1)); |
---|
29 | |
---|
30 | x_vars = getvariables(F); |
---|
31 | x = recover(x_vars); |
---|
32 | |
---|
33 | H = get(P,'H'); |
---|
34 | K = get(P,'K'); |
---|
35 | |
---|
36 | F = set(H*x < K); |
---|
Note: See
TracBrowser
for help on using the repository browser.