1## Copyright (C) 2005, 2006, 2007, 2009 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 GLPK library. For Octave code, you should use
23## the @code{glpk} function instead.
26function [xopt, fopt, status, extra] = glpkmex (varargin)
28 ## If there is no input output the version and syntax
29 if (nargin < 4 || nargin > 11)
60 ctype = repmat ("U", nx, 1);
66 lb = repmat (-Inf, nx, 1);
72 ub = repmat (Inf, nx, 1);
76 vartype = varargin{8};
78 vartype = repmat ("C", nx, 1);
87 if (nargin > 9 && ! isfield (param, "lpsolver"))
88 param.lpsolver = varargin{10};
91 if (nargin > 10 && ! isfield (param, "save"))
92 param.save = varargin{11};
96 glpk (c, a, b, lb, ub, ctype, vartype, sense, param);
98 xopt = glpk (c, a, b, lb, ub, ctype, vartype, sense, param);
100 [xopt, fopt] = glpk (c, a, b, lb, ub, ctype, vartype, sense, param);
101 elseif (nargout == 3)
102 [xopt, fopt, status] = ...
103 glpk (c, a, b, lb, ub, ctype, vartype, sense, param);
105 [xopt, fopt, status, extra] = ...
106 glpk (c, a, b, lb, ub, ctype, vartype, sense, param);