Rev | Line | |
---|
[37] | 1 | function X=sos(X,r) |
---|
| 2 | %SOS Declare sum-of-squares structure |
---|
| 3 | % |
---|
| 4 | % F = set(sos(p),r) |
---|
| 5 | % |
---|
| 6 | % Input |
---|
| 7 | % p : SDPVAR object |
---|
| 8 | % r : Desired rank (optional) |
---|
| 9 | % Output |
---|
| 10 | % F : SET object |
---|
| 11 | % |
---|
| 12 | % Example: |
---|
| 13 | % Typical usage is |
---|
| 14 | % |
---|
| 15 | % F = set(sos(p)) |
---|
| 16 | % |
---|
| 17 | % An experimental feature is to search for |
---|
| 18 | % low rank decompositions. To search for a |
---|
| 19 | % decomposition using at most 3 terms, use |
---|
| 20 | % a second argument |
---|
| 21 | % |
---|
| 22 | % F = set(sos(p,3)) |
---|
| 23 | % |
---|
| 24 | % Note that his feature requires the solver LMIRANK. |
---|
| 25 | % |
---|
| 26 | % See also SOSEX |
---|
| 27 | |
---|
| 28 | % Author Johan Löfberg |
---|
| 29 | % $Id: sos.m,v 1.1 2006/08/10 18:00:22 joloef Exp $ |
---|
| 30 | |
---|
| 31 | if ~issymmetric(X)% X.n>1 | X.m>1 |
---|
| 32 | error('SOS can only be applied to symmetric polynomial matrices'); |
---|
| 33 | end |
---|
| 34 | if nargin<2 |
---|
| 35 | r = inf; |
---|
| 36 | end |
---|
| 37 | X.typeflag = 11; |
---|
| 38 | X.extra.sosid = yalmip('sosid'); |
---|
| 39 | X.extra.rank = r; |
---|
Note: See
TracBrowser
for help on using the repository browser.