source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/opt/yalmip/solvers/callsdpt330.m @ 37

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

Added original make3d

File size: 3.3 KB
Line 
1function output = callsdpt330(interfacedata)
2
3% Author Johan Löfberg
4% $Id: callsdpt330.m,v 1.3 2005/05/07 13:53:20 joloef Exp $
5
6% Retrieve needed data
7options = interfacedata.options;
8F_struc = interfacedata.F_struc;
9c       = interfacedata.c;
10K       = interfacedata.K;
11x0      = interfacedata.x0;
12ub      = interfacedata.ub;
13lb      = interfacedata.lb;
14
15% Bounded variables converted to constraints
16if ~isempty(ub)
17    [F_struc,K] = addbounds(F_struc,K,ub,lb);
18end
19
20% Convert from internal (sedumi) format
21[C,A,b,blk] = sdpt3struct2sdpt3block(F_struc,c,K);
22
23% To be sure
24global CACHE_SIZE   % cache size in kbytes
25global LOOP_LEVEL   % loop unrolling level
26CACHE_SIZE = options.sdpt3.CACHE_SIZE;
27LOOP_LEVEL = options.sdpt3.LOOP_LEVEL;
28
29solvertime = clock;
30A = svec(blk,A,ones(size(blk,1),1));
31
32if options.savedebug
33    save sdpt3debug blk A C b x0 options.sdpt3
34end
35
36showprogress('Calling SDPT3',options.showprogress);
37if options.verbose==0
38    evalc('[obj,X,y,Z,gaphist,infeashist,info,Xiter,yiter,Ziter] =  sqlp(blk,A,C,b,[],x0,[],options.sdpt3);');
39else
40    [obj,X,y,Z,gaphist,infeashist,info,Xiter,yiter,Ziter] =  sqlp(blk,A,C,b,[],x0,[],options.sdpt3);
41end
42solvertime = etime(clock,solvertime);
43
44% Create dual variable in internal format
45D_struc = [];
46if K.l>0
47    D_struc = [D_struc;X{1}(:)];
48    if length(X)>1
49        X = {X{2:end}};
50    end
51end
52if K.q(1)>0
53    D_struc = [D_struc;X{1}(:)];
54    if length(X)>1
55        X = {X{2:end}};
56    end
57end
58if K.r(1)>0
59    D_struc = [D_struc;X{1}(:)];
60    if length(X)>1
61        X = {X{2:end}};
62    end
63end
64if K.s(1)>0
65    top = 1;
66    j = 1;
67    for i = 1:1:length(K.s)
68        Xi = X{j}(top:top+K.s(i)-1,top:top+K.s(i)-1);
69        D_struc = [D_struc;Xi(:)];
70        top = top + K.s(i);
71        if top>length(X{j})
72            j = j + 1;
73            top = 1;
74        end
75    end
76end
77
78x = y;  % Our notation do not coincide ...
79
80% Convert error code
81switch info(1)
82    case 0
83        problem = 0; % No problems detected
84    case -1
85        problem = 5; % Lack of progress
86    case {-2,-3,-4,-5}
87        problem = 4; % Numerical problems
88    case -6
89        problem = 3; % Maximum iterations exceeded
90    case -10
91        problem = 7; % YALMIP sent incorrect input to solver
92    case 1
93        problem = 2; % Dual feasibility
94    case 2
95        problem = 1; % Primal infeasibility
96    otherwise
97        problem = -1; % Unknown error
98end
99infostr = yalmiperror(problem,interfacedata.solver.tag);
100
101if options.savesolveroutput
102    solveroutput.obj = obj;
103    solveroutput.X = X;
104    solveroutput.y = y;
105    solveroutput.Z = Z;
106    solveroutput.gaphist = gaphist;
107    solveroutput.infeashist = infeashist;
108    solveroutput.info = info;
109    solveroutput.Xiter = Xiter;
110    solveroutput.yiter = yiter;
111    solveroutput.Ziter = Ziter;
112else
113    solveroutput = [];
114end
115
116if options.savesolverinput
117    solverinput.blk = blk;
118    solverinput.A   = A;
119    solverinput.C   = C;
120    solverinput.b   = b;
121    solverinput.X0   = [];
122    solverinput.y0   = x0;
123    solverinput.Z0   = [];
124    solverinput.options   = options.sdpt3;
125else
126    solverinput = [];
127end
128
129
130% Standard interface
131output.Primal      = x(:);
132output.Dual        = D_struc;
133output.Slack       = [];
134output.problem     = problem;
135output.infostr     = infostr;
136output.solverinput = solverinput;
137output.solveroutput= solveroutput;
138output.solvertime  = solvertime;
Note: See TracBrowser for help on using the repository browser.