1 |
|
---|
2 | function y = trheuristic(At,c,K)
|
---|
3 | % y = trheuristic(At,c,K); |
---|
4 | %
|
---|
5 | % TRHEURISTIC uses SeDuMi to solve |
---|
6 | % |
---|
7 | % min tr(G(y)) |
---|
8 | % s.t. F(y) := F0 + y1*F1 + ... + ym*Fm >= 0, |
---|
9 | % G(y) := G0 + y1*G1 + ... + ym*Gm >= 0. |
---|
10 | %
|
---|
11 | % This is the trace heuristic for trying to solve rank constrained LMIs.
|
---|
12 | %
|
---|
13 | % TRHEURISTIC is used by LMIRANK for initialization.
|
---|
14 | %
|
---|
15 | % Inputs:
|
---|
16 | % At = -[vec(F1),...,vec(Fm);
|
---|
17 | % vec(G1),...,vec(Gm)]
|
---|
18 | % c = [vec(F0);
|
---|
19 | % vec(G0)]
|
---|
20 | % K : problem parameters (K.s and K.rank)
|
---|
21 | %
|
---|
22 | % Outputs:
|
---|
23 | % y : solution
|
---|
24 | %
|
---|
25 | % NOTE: It is possible to have multiple 'F' LMIs and multiple 'G' LMIs.
|
---|
26 | % For simplicity, the description above assumes there is only
|
---|
27 | % one 'F' LMI and one 'G' LMI. If there are multiple 'G' LMIs,
|
---|
28 | % i.e., if K.s(j)~=K.rank(j) for more than one j, then only the
|
---|
29 | % last 'G' LMI is treated as such; the others are treated as
|
---|
30 | % 'F' LMIs. LP inequality constraints can also be included. |
---|
31 | %
|
---|
32 | % See also LMIRANK.
|
---|
33 |
|
---|
34 | % Author Robert Orsi
|
---|
35 | % Feb 2005
|
---|
36 |
|
---|
37 |
|
---|
38 | %%%% SeDuMi:
|
---|
39 | % min -b'*y
|
---|
40 | % s.t. c-At*y \in K
|
---|
41 |
|
---|
42 | %%%% Create b
|
---|
43 | m=size(At,2);
|
---|
44 | b=zeros(m,1);
|
---|
45 | if isfield(K,'l')
|
---|
46 | index=K.l;
|
---|
47 | else
|
---|
48 | index=0;
|
---|
49 | end
|
---|
50 | for j=1:length(K.s),
|
---|
51 | if K.s(j)~=K.rank(j)
|
---|
52 | for i=1:m,
|
---|
53 | P=reshape(At(index+1:index+K.s(j)^2,i),K.s(j),K.s(j));
|
---|
54 | b(i)=trace(P);
|
---|
55 | end
|
---|
56 | end
|
---|
57 | index=index+K.s(j)^2;
|
---|
58 | end
|
---|
59 |
|
---|
60 | %%%% Set parameters
|
---|
61 | pars.fid=0; % Suppress SeDuMi on-screen output.
|
---|
62 | pars.eps=0; % was 1e-14.
|
---|
63 | % pars.eps=0 means SeDuMi runs as long as it can make progress.
|
---|
64 |
|
---|
65 | %%%% Call SeDuMi
|
---|
66 | [x,y,info] = sedumi(At',b,c,K,pars);
|
---|
67 |
|
---|
68 |
|
---|
69 |
|
---|
70 |
|
---|