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

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

Added original make3d

File size: 772 bytes
Line 
1function 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
31if ~issymmetric(X)% X.n>1 | X.m>1
32    error('SOS can only be applied to symmetric polynomial matrices');
33end
34if nargin<2
35    r = inf;
36end   
37X.typeflag = 11;
38X.extra.sosid = yalmip('sosid');
39X.extra.rank = r;
Note: See TracBrowser for help on using the repository browser.