1 | |
---|
2 | function [At,c,K,yfeas,y,info] = lmiranktest |
---|
3 | % [At,c,K,yfeas,y,info] = lmiranktest; |
---|
4 | % |
---|
5 | % LMIRANKTEST runs a test problem for LMIRANK. It uses randomly generated |
---|
6 | % feasible rank constrained LMI problems created by CREATERANDOMDATA. |
---|
7 | %
|
---|
8 | % Problem parameters:
|
---|
9 | % nLP : no. of LP inequalities. This can be 0.
|
---|
10 | % nF : the Fi matrices are size nF x nF
|
---|
11 | % nG : the Gi matrices are size nG x nG
|
---|
12 | % r : rank bound
|
---|
13 | % m : number of variables
|
---|
14 | % maxiter : max. no. of iterations
|
---|
15 | %
|
---|
16 | % Outputs: (LP ineq. data at the start of At and c is not shown)
|
---|
17 | % At = -[vec(F1),...,vec(Fm);
|
---|
18 | % vec(G1),...,vec(Gm)]
|
---|
19 | % c = [vec(F0);
|
---|
20 | % vec(G0)]
|
---|
21 | % yfeas : known feasible solution
|
---|
22 | % y : calculated solution |
---|
23 | % info.solved : 1 if a solution was found, 0 otherwise |
---|
24 | % info.cpusec : solution time |
---|
25 | % info.iters : no. of iterations required to find a solution
|
---|
26 | % info.gap : constraint gap |
---|
27 | % info.rank : ranks (with respect to tolerance pars.eps) |
---|
28 | % |
---|
29 | % See also LMIRANK, CREATERANDOMDATA. |
---|
30 | |
---|
31 | % Author Robert Orsi |
---|
32 | % Feb 2005 |
---|
33 | |
---|
34 |
|
---|
35 | %%%% Random problem parameters
|
---|
36 | nLP=3;
|
---|
37 | nF=10;
|
---|
38 | nG=10;
|
---|
39 | r=5;
|
---|
40 | m=20;
|
---|
41 |
|
---|
42 | %%%% Max. no. of iterations
|
---|
43 | maxiter=100;
|
---|
44 |
|
---|
45 | %%%% Create random data
|
---|
46 | [At,c,K,yfeas] = createrandomdata(nF,nG,r,m);
|
---|
47 | %%%% Add LP ineq. constraints
|
---|
48 | At=[rand(nLP,m); At];
|
---|
49 | c=[(At(1:nLP,:)*yfeas+max(randn(nLP,1),0)); c];
|
---|
50 | K.l=nLP;
|
---|
51 |
|
---|
52 | %%%% Call LMIRank |
---|
53 | pars.maxiter=maxiter;
|
---|
54 | [y,info] = lmirank(At,c,K,pars);
|
---|
55 |
|
---|