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

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

Added original make3d

File size: 846 bytes
Line 
1function [b,AC] = sedumi2dsdp(F_struc,c,K)
2%SEDUMI2DSDP5 Internal function to convert SeDuMi structure to format needed in DSDP 5
3
4% Author Johan Löfberg
5% $Id: sedumi2dsdp5.m,v 1.1 2004/10/06 18:11:26 johanl Exp $
6
7nvars = size(F_struc,2)-1;
8
9A = [];
10block  = 1;
11top = 1;
12
13if K.l>0   
14    AC{block,1} = 'LP';
15    AC{block,2} = K.l;
16    A = F_struc(top:top+K.l-1,:);   
17    AC{block,3} = [-A(:,2:end) A(:,1)];
18    block = block+1;
19    top = top+K.l;
20end
21
22if K.s>0
23    for i = 1:length(K.s)
24        n = K.s(i);
25        AC{block,1} = 'SDP';
26        AC{block,2} = n;
27        A = F_struc(top:top+n^2-1,:);
28        indicies = triu(reshape(1:n^2,n,n));
29        indicies = indicies(find(indicies));
30        AC{block,3} = [-A(indicies,2:end) A(indicies,1)];
31        block = block+1;
32        top = top+n*n;
33    end
34end
35% And we solve dual...
36b = -c(:);
Note: See TracBrowser for help on using the repository browser.