Line | |
---|
1 | function x = unique(x) |
---|
2 | %UNIQUE (overloaded) |
---|
3 | |
---|
4 | % Author Johan Löfberg |
---|
5 | % $Id: unique.m,v 1.4 2006/07/26 20:17:58 joloef Exp $ |
---|
6 | |
---|
7 | if min(x.dim(1),x.dim(2))~=1 |
---|
8 | error('UNIQUE currently only supported for vectors') |
---|
9 | end |
---|
10 | |
---|
11 | base = x.basis; |
---|
12 | vars = x.lmi_variables; |
---|
13 | [new_base,i,j] = unique(base,'rows'); |
---|
14 | |
---|
15 | x.basis = new_base; |
---|
16 | if x.dim(2)==1 |
---|
17 | x.dim(1) = size(new_base,1); |
---|
18 | else |
---|
19 | x.dim(2) = size(new_base,1); |
---|
20 | end |
---|
21 | % Reset info about conic terms |
---|
22 | x.conicinfo = [0 0]; |
---|
23 | |
---|
Note: See
TracBrowser
for help on using the repository browser.