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

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

Added original make3d

File size: 1.9 KB
Line 
1function output = callclp(interfacedata)
2
3% Author Johan Löfberg
4% $Id: callclp.m,v 1.15 2006/05/30 18:25:32 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;
13Q       = interfacedata.Q;
14
15n = length(c);
16
17if options.showprogress;showprogress(['Calling ' interfacedata.solver.tag],options.showprogress);end
18
19if K.f>0
20    Aeq = -F_struc(1:K.f,2:end);
21    beq = F_struc(1:K.f,1);
22else
23    Aeq = [];
24    beq = [];
25end
26
27if K.l > 0
28    A = -F_struc(1+K.f:end,2:end);
29    b = F_struc(1+K.f:end,1);
30else
31    A = [];
32    b = [];
33end
34
35% Fix for bug in mexclp or clp
36fixed = 0;
37if size(A,1)==0 & size(Aeq,2)==0
38    A = [ones(1,length(c))];
39    if ~isempty(ub)
40        A(isinf(ub)) = 0;       
41        dummy = ub;
42        dummy(isinf(ub)) = 0;
43        b = sum(dummy);
44    else
45        b = 1e8;
46    end
47    fixed = 1;
48    options.saveduals = 0;
49end
50
51ops = options.clp;
52ops.verbose = options.verbose;
53
54if options.savedebug
55    save clpdebug
56end
57
58% Call mex-interfacec
59solvertime = clock;
60[x,lambda,problem] = clp(2*Q,c,A,b,Aeq,beq,lb,ub,ops);%,interfacedata.integer_variables);
61if interfacedata.getsolvertime solvertime = etime(clock,solvertime);else solvertime = 0;end
62
63if options.saveduals
64    D_struc = -lambda;   
65else
66    D_struc = [];
67end
68
69infostr = yalmiperror(problem,interfacedata.solver.tag);
70
71% Save all data sent to solver?
72if options.savesolverinput
73        solverinput = [];       
74else
75        solverinput = [];
76end
77
78% Save all data from the solver?
79if options.savesolveroutput
80        solveroutput = [];     
81else
82        solveroutput = [];
83end
84
85% Standard interface
86output.Primal      = x;
87output.Dual        = D_struc;
88output.Slack       = [];
89output.problem     = problem;
90output.infostr     = infostr;
91output.solverinput = solverinput;
92output.solveroutput= solveroutput;
93output.solvertime  = solvertime;
Note: See TracBrowser for help on using the repository browser.