source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/opt/yalmip/solvers/callcdd.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 = callcdd(interfacedata)
2
3% Author Johan Löfberg
4% $Id: callcdd.m,v 1.3 2005/05/07 13:53:20 joloef Exp $
5
6% Standard input interface
7options = interfacedata.options;
8F_struc = interfacedata.F_struc;
9c       = interfacedata.c;
10K       = interfacedata.K;
11Q       = interfacedata.Q;
12ub      = interfacedata.ub;
13lb      = interfacedata.lb;
14
15if ~isempty(ub)
16    [F_struc,K] = addbounds(F_struc,K,ub,lb);
17end
18
19IN = struct('obj',full(c(:))','A',full(-F_struc(:,2:end)),'B',full(F_struc(:,1)));
20if K.f>0
21    IN.lin = 1:K.f;
22end
23
24% % CDD does not check this..
25% % Fix the duals...
26% valid_constraints = find(any(IN.A'));
27% IN.A = IN.A(valid_constraints,:);
28% IN.B = IN.B(valid_constraints,:);
29
30showprogress('Calling CDD',options.showprogress);
31solvertime = clock;
32
33if options.savedebug
34    save cdddebug IN
35end
36
37switch options.cdd.method
38    case 'criss-cross'
39        OUT = cddmex('solve_lp',IN);
40    case 'dual-simplex'
41        OUT = cddmex('solve_lp_DS',IN);
42    otherwise
43end
44solvertime = etime(clock,solvertime);
45problem = 0;
46
47% Internal format for duals
48D_struc = [-OUT.lambda];
49
50switch OUT.how
51    case 1
52        problem = 0;
53    case {2,7}
54        problem = 1;
55    case {3,6}
56        problem = 2;
57    case {0,4,5}
58        problem = 11;
59    otherwise
60        problem = -1;
61end
62infostr = yalmiperror(problem,'CDD');
63
64% Save all data sent to solver?
65if options.savesolverinput
66    solverinput.IN = IN;
67else
68    solverinput = [];
69end
70
71% Save all data from the solver?
72if options.savesolveroutput
73    solveroutput.OUT = OUT;
74else
75    solveroutput = [];
76end
77
78% Standard interface
79output.Primal      = OUT.xopt;
80output.Dual        = D_struc;
81output.Slack       = [];
82output.problem     = problem;
83output.infostr     = infostr;
84output.solverinput = solverinput;
85output.solveroutput= solveroutput;
86output.solvertime  = solvertime;
Note: See TracBrowser for help on using the repository browser.