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

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

Added original make3d

File size: 2.5 KB
Line 
1function output = callnage04mbf(varargin)
2% Author Johan Löfberg
3% $Id: callnage04mbf.m,v 1.6 2006/04/10 08:08:47 joloef Exp $
4
5% Retrieve needed data
6interfacedata = varargin{1};
7options = interfacedata.options;
8F_struc = interfacedata.F_struc;
9c       = interfacedata.c;
10K       = interfacedata.K;
11x0      = interfacedata.x0;
12Q       = 2*interfacedata.Q;
13ub      = interfacedata.ub;
14lb      = interfacedata.lb;
15
16bigbnd = options.nag.bigbnd;
17sent_bounds = 1;
18if isempty(ub)
19    sent_bounds = 0;
20    ub =  bigbnd*ones(length(c),1);
21    lb = -bigbnd*ones(length(c),1);
22end   
23
24showprogress('Calling NAG',options.showprogress);
25
26if ~isempty(F_struc)
27    A =-F_struc(1:end,2:end);
28    beq = F_struc(1:1:K.f,1);
29    b = F_struc(K.f+1:end,1);   
30   
31    ub = full([ub;beq;b]);
32    lb = full([lb;beq;-bigbnd*ones(length(b),1)]);
33else
34    A=zeros(1,length(c));
35end
36
37lp   = 0;
38cold = 1;
39istate = zeros(length(ub),1);
40featol = options.nag.featol*ones(length(ub),1);
41switch options.verbose
42case 0
43    msglev = -1;
44    ifail = 1;
45case 1
46    msglev = 2;
47    ifail = -1;
48otherwise
49    msglev = 5*options.verbose;
50    ifail = -1;
51end
52solvertime = clock;
53[x,istate,objlp,clambda,ifail] = e04mbf(full(lb),full(ub),zeros(length(c),1),full(c),full(A),msglev,options.nag.itmax,ifail);%options.nag.bigbnd,options.nag.orthog);
54solvertime = etime(clock,solvertime);
55problem = 0;
56
57% Internal format for duals
58%if sent_bounds
59  %  D_struc_bound = -clambda(1:length(c));
60 %   D_struc = -clambda(length(c)+1:end);   
61 %   D_struc = [repmat(inf,length(c)*2,1);D_struc];
62 %else
63    D_struc = -clambda(length(c)+1:end);
64    %end
65
66switch ifail
67case {-1,0}
68    problem = 0;
69case 1
70    problem = 1;
71case 2
72    problem = 2;
73case 3
74    problem = 4;
75case 4
76    problem = 3;
77case 5
78    problem = 7;
79otherwise
80    problem = -1;
81end   
82infostr = yalmiperror(problem,'NAG'); 
83
84% Save all data sent to solver?
85if options.savesolverinput
86    solverinput.bl = full(lb);
87    solverinput.bu = full(ub);
88    solverinput.X = zeros(length(c),1);
89    solverinput.cvec = full(c);
90    solverinput.A = full(A);
91else
92    solverinput = [];
93end
94
95% Save all data from the solver?
96if options.savesolveroutput
97    solveroutput.x = x;
98    solveroutput.objlp = objlp;
99    solveroutput.clambda=clambda;
100    solveroutput.istate=istate; 
101    solveroutput.ifail=ifail; 
102else
103    solveroutput = [];
104end
105
106% Standard interface
107output.Primal      = x;
108output.Dual        = D_struc;
109output.Slack       = [];
110output.problem     = problem;
111output.infostr     = infostr;
112output.solverinput = solverinput;
113output.solveroutput= solveroutput;
114output.solvertime  = solvertime;
Note: See TracBrowser for help on using the repository browser.