1 ## Copyright (C) 2005-2012 Nicolo' Giorgetti
3 ## This file is part of Octave.
5 ## Octave is free software; you can redistribute it and/or modify it
6 ## under the terms of the GNU General Public License as published by
7 ## the Free Software Foundation; either version 3 of the License, or (at
8 ## your option) any later version.
10 ## Octave is distributed in the hope that it will be useful, but
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 ## General Public License for more details.
15 ## You should have received a copy of the GNU General Public License
16 ## along with Octave; see the file COPYING. If not, see
17 ## <http://www.gnu.org/licenses/>.
20 ## @deftypefn {Function File} {[@var{xopt}, @var{fmin}, @var{status}, @var{extra}] =} glpkmex (@var{sense}, @var{c}, @var{A}, @var{b}, @var{ctype}, @var{lb}, @var{ub}, @var{vartype}, @var{param}, @var{lpsolver}, @var{save_pb})
21 ## This function is provided for compatibility with the old @sc{matlab}
22 ## interface to the GNU @sc{glpk} library. For Octave code, you should use
23 ## the @code{glpk} function instead.
27 function [xopt, fopt, status, extra] = glpkmex (varargin)
29 persistent warned = false;
32 warning ("Octave:deprecated-function",
33 "glpkmex is obsolete and will be removed from a future version of Octave; please use glpk instead");
36 ## If there is no input output the version and syntax
37 if (nargin < 4 || nargin > 11)
68 ctype = repmat ("U", nx, 1);
74 lb = repmat (-Inf, nx, 1);
80 ub = repmat (Inf, nx, 1);
84 vartype = varargin{8};
86 vartype = repmat ("C", nx, 1);
95 if (nargin > 9 && ! isfield (param, "lpsolver"))
96 param.lpsolver = varargin{10};
99 if (nargin > 10 && ! isfield (param, "save"))
100 param.save = varargin{11};
104 glpk (c, a, b, lb, ub, ctype, vartype, sense, param);
105 elseif (nargout == 1)
106 xopt = glpk (c, a, b, lb, ub, ctype, vartype, sense, param);
107 elseif (nargout == 2)
108 [xopt, fopt] = glpk (c, a, b, lb, ub, ctype, vartype, sense, param);
109 elseif (nargout == 3)
110 [xopt, fopt, status] = ...
111 glpk (c, a, b, lb, ub, ctype, vartype, sense, param);
113 [xopt, fopt, status, extra] = ...
114 glpk (c, a, b, lb, ub, ctype, vartype, sense, param);