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

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

Added original make3d

File size: 1.8 KB
Line 
1function output = callqsopt(interfacedata)
2
3% Author Johan Löfberg
4% $Id: callqsopt.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;
11ub      = interfacedata.ub;
12lb      = interfacedata.lb;
13
14n = length(c);
15% Bounded variables converted to constraints
16if ~isempty(ub)
17    % TODO : MAKE SURE SIZES ARE CORRECT 
18    lb(lb==-inf) = -1e30;
19    ub(ub==inf) = 1e30;
20else
21    lb=repmat(-1e30,n,1);    % just for sure
22    ub=repmat(1e30,n,1);         
23end
24
25if options.showprogress;showprogress('Calling QSOPT',options.showprogress);end
26
27options.qsopt.verbose = options.verbose;
28
29% Call mex-interface
30if options.savedebug
31    save qsoptdebug
32end
33solvertime = clock;
34
35[x,lambda,STATUS] = qsopt(c,-F_struc(1+K.f:end,2:end),F_struc(1+K.f:end,1),-F_struc(1:K.f,2:end),F_struc(1:K.f,1),lb,ub,options.qsopt);
36solvertime = etime(clock,solvertime);
37problem = 0;
38
39if options.saveduals
40    D_struc = -lambda;   
41else
42    D_struc = [];
43end
44
45% Check, currently not exhaustive...
46switch STATUS
47    case 1
48        problem = 0;
49    case 2
50        problem = 1;
51    case 3
52        problem = 2;
53    case 4       
54        problem = 3;
55    case {5,6}
56        problem = 4; 
57    otherwise
58        problem = -1;
59end
60infostr = yalmiperror(problem,'QSOPT');
61
62% Save all data sent to solver?
63if options.savesolverinput
64        solverinput = [];       
65else
66        solverinput = [];
67end
68
69% Save all data from the solver?
70if options.savesolveroutput
71        solveroutput = [];     
72else
73        solveroutput = [];
74end
75
76% Standard interface
77output.Primal      = x(:);
78output.Dual        = D_struc;
79output.Slack       = [];
80output.problem     = problem;
81output.infostr     = infostr;
82output.solverinput = solverinput;
83output.solveroutput= solveroutput;
84output.solvertime  = solvertime;
Note: See TracBrowser for help on using the repository browser.