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

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

Added original make3d

File size: 2.2 KB
Line 
1function output = callquadprog(interfacedata)
2
3% Author Johan Löfberg
4% $Id: callooqp.m,v 1.2 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;
12Q       = interfacedata.Q;
13lb      = interfacedata.lb;
14ub      = interfacedata.ub;
15
16switch options.verbose
17case 0
18    options.quadprog.Display = 'off';
19case 1
20    options.quadprog.Display = 'final';
21otherwise
22    options.quadprog.Display = 'iter';
23end
24   
25showprogress('Calling QUADPROG',options.showprogress);
26
27if ~isempty(F_struc)
28    A = -F_struc(1:1:K.f,2:end);
29    dA = full(F_struc(1:1:K.f,1));       
30    C =-F_struc(K.f+1:end,2:end);
31    cupp = full(F_struc(K.f+1:end,1));   
32    clow = full(-ones(size(C,1),1)*1e4);
33else
34    A  = [];
35    dA = [];
36    C  = [];
37    cupp = [];
38    clow = [];
39end
40
41n = length(c);
42if isempty(lb)
43    xlow = -ones(n,1)*1e6;
44    xupp = ones(n,1)*1e6;
45else
46    xlow = lb;
47    xupp = ub;
48end
49
50if options.verbose==0
51    doprint = 'no';
52else
53    doprint = 'yes';
54end
55solvertime = clock;
56[status, x, gamma, phi, y, z, lambda, pi] = ooqp( c, 2*Q, xlow, xupp, A, dA, C, clow, cupp, doprint);
57solvertime = etime(clock,solvertime);
58
59problem = 0;
60
61% Internal format for duals
62D_struc = -[y;z];
63
64% Check, currently not exhaustive...
65switch status
66    case 0
67        problem = 0;
68    otherwise
69        problem = 13;
70end
71infostr = yalmiperror(problem,'OOQP');       
72
73% Save all data sent to solver?
74if options.savesolverinput
75    solverinput.A = A;
76    solverinput.b = b;
77    solverinput.Aeq = Aq;
78    solverinput.beq = beq;
79    solverinput.c = c;
80    solverinput.H = Q;
81    solverinput.options = options.quadprog;
82else
83    solverinput = [];
84end
85
86% Save all data from the solver?
87if options.savesolveroutput
88    solveroutput.x = x;
89    solveroutput.fmin = fmin;
90    solveroutput.flag = flag;
91    solveroutput.output=output;
92    solveroutput.lambda=lambda; 
93else
94    solveroutput = [];
95end
96
97
98
99% Standard interface
100output.Primal      = x(:);
101output.Dual        = D_struc;
102output.Slack       = [];
103output.problem     = problem;
104output.infostr     = infostr;
105output.solverinput = solverinput;
106output.solveroutput= solveroutput;
107output.solvertime  = solvertime;
Note: See TracBrowser for help on using the repository browser.