# HG changeset patch # User Rik # Date 1296402756 28800 # Node ID c16ce72e0a22824f881e047405eb99e873341a55 # Parent 2c35dfd641fffa1d5a601734543f0ffa3db9a347 Deprecate glpkmex function and remove from documentation. diff -r 2c35dfd641ff -r c16ce72e0a22 ChangeLog --- a/ChangeLog Sun Jan 30 04:38:35 2011 -0500 +++ b/ChangeLog Sun Jan 30 07:52:36 2011 -0800 @@ -1,3 +1,7 @@ +2010-01-30 Rik + + * NEWS: Deprecate glpkmex function. + 2011-01-30 John W. Eaton * acinclude.m4 (OCTAVE_PROG_GHOSTSCRIPT): Update warning message. diff -r 2c35dfd641ff -r c16ce72e0a22 NEWS --- a/NEWS Sun Jan 30 04:38:35 2011 -0500 +++ b/NEWS Sun Jan 30 07:52:36 2011 -0800 @@ -409,9 +409,9 @@ be removed from Octave 3.8 (or whatever version is the second major release after 3.4): - autocor cellidx gammai replot - autocov dispatch is_global saveimage - betai fstat krylovb values + autocor cellidx gammai krylovb values + autocov dispatch glpkmex replot + betai fstat is_global saveimage * For compatibility with Matlab, mu2lin (x) is now equivalent to mu2lin (x, 0). diff -r 2c35dfd641ff -r c16ce72e0a22 doc/ChangeLog --- a/doc/ChangeLog Sun Jan 30 04:38:35 2011 -0500 +++ b/doc/ChangeLog Sun Jan 30 07:52:36 2011 -0800 @@ -1,3 +1,8 @@ +2011-01-30 Rik + + * interpreter/optim.txi: Deprecate glpkmex function and remove + from documentation. + 2011-01-30 John W. Eaton * interpreter/install.txi (Compiling Octave with 64-bit Indexing): diff -r 2c35dfd641ff -r c16ce72e0a22 doc/interpreter/optim.txi --- a/doc/interpreter/optim.txi Sun Jan 30 04:38:35 2011 -0500 +++ b/doc/interpreter/optim.txi Sun Jan 30 07:52:36 2011 -0800 @@ -70,8 +70,6 @@ @DOCSTRING(glpk) -@DOCSTRING(glpkmex) - @node Quadratic Programming @section Quadratic Programming diff -r 2c35dfd641ff -r c16ce72e0a22 scripts/ChangeLog --- a/scripts/ChangeLog Sun Jan 30 04:38:35 2011 -0500 +++ b/scripts/ChangeLog Sun Jan 30 07:52:36 2011 -0800 @@ -1,3 +1,8 @@ +2010-01-30 Rik + + * deprecated/module.mk, optimization/module.mk: Deprecate glpkmex + function. + 2011-01-30 John W. Eaton * plot/__gnuplot_drawnow__.m: Rename from gnuplot_drawnow.m diff -r 2c35dfd641ff -r c16ce72e0a22 scripts/deprecated/glpkmex.m --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scripts/deprecated/glpkmex.m Sun Jan 30 07:52:36 2011 -0800 @@ -0,0 +1,117 @@ +## Copyright (C) 2005-2011 Nicolo' Giorgetti +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or (at +## your option) any later version. +## +## Octave is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, see +## . + +## -*- texinfo -*- +## @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}) +## This function is provided for compatibility with the old @sc{matlab} +## interface to the GNU @sc{glpk} library. For Octave code, you should use +## the @code{glpk} function instead. +## @seealso{glpk} +## @end deftypefn + +function [xopt, fopt, status, extra] = glpkmex (varargin) + + persistent warned = false; + if (! warned) + warned = true; + warning ("Octave:deprecated-function", + "glpkmex is obsolete and will be removed from a future version of Octave; please use glpk instead"); + endif + + ## If there is no input output the version and syntax + if (nargin < 4 || nargin > 11) + print_usage (); + return; + endif + + ## reorder args: + ## + ## glpkmex glpk + ## + ## 1 sense c + ## 2 c a + ## 3 a b + ## 4 b lb + ## 5 ctype ub + ## 6 lb ctype + ## 7 ub vartype + ## 8 vartype sense + ## 9 param param + ## 10 lpsolver + ## 11 savepb + + sense = varargin{1}; + c = varargin{2}; + a = varargin{3}; + b = varargin{4}; + + nx = length (c); + + if (nargin > 4) + ctype = varargin{5}; + else + ctype = repmat ("U", nx, 1); + endif + + if (nargin > 5) + lb = varargin{6}; + else + lb = repmat (-Inf, nx, 1); + endif + + if (nargin > 6) + ub = varargin{7}; + else + ub = repmat (Inf, nx, 1); + endif + + if (nargin > 7) + vartype = varargin{8}; + else + vartype = repmat ("C", nx, 1); + endif + + if (nargin > 8) + param = varargin{9}; + else + param = struct (); + endif + + if (nargin > 9 && ! isfield (param, "lpsolver")) + param.lpsolver = varargin{10}; + endif + + if (nargin > 10 && ! isfield (param, "save")) + param.save = varargin{11}; + endif + + if (nargout == 0) + glpk (c, a, b, lb, ub, ctype, vartype, sense, param); + elseif (nargout == 1) + xopt = glpk (c, a, b, lb, ub, ctype, vartype, sense, param); + elseif (nargout == 2) + [xopt, fopt] = glpk (c, a, b, lb, ub, ctype, vartype, sense, param); + elseif (nargout == 3) + [xopt, fopt, status] = ... + glpk (c, a, b, lb, ub, ctype, vartype, sense, param); + else + [xopt, fopt, status, extra] = ... + glpk (c, a, b, lb, ub, ctype, vartype, sense, param); + endif + +endfunction diff -r 2c35dfd641ff -r c16ce72e0a22 scripts/deprecated/module.mk --- a/scripts/deprecated/module.mk Sun Jan 30 04:38:35 2011 -0500 +++ b/scripts/deprecated/module.mk Sun Jan 30 07:52:36 2011 -0800 @@ -12,6 +12,7 @@ deprecated/dmult.m \ deprecated/fstat.m \ deprecated/gammai.m \ + deprecated/glpkmex.m \ deprecated/intwarning.m \ deprecated/iscommand.m \ deprecated/is_global.m \ diff -r 2c35dfd641ff -r c16ce72e0a22 scripts/optimization/glpkmex.m --- a/scripts/optimization/glpkmex.m Sun Jan 30 04:38:35 2011 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,110 +0,0 @@ -## Copyright (C) 2005-2011 Nicolo' Giorgetti -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 3 of the License, or (at -## your option) any later version. -## -## Octave is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, see -## . - -## -*- texinfo -*- -## @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}) -## This function is provided for compatibility with the old @sc{matlab} -## interface to the GNU @sc{glpk} library. For Octave code, you should use -## the @code{glpk} function instead. -## @seealso{glpk} -## @end deftypefn - -function [xopt, fopt, status, extra] = glpkmex (varargin) - - ## If there is no input output the version and syntax - if (nargin < 4 || nargin > 11) - print_usage (); - return; - endif - - ## reorder args: - ## - ## glpkmex glpk - ## - ## 1 sense c - ## 2 c a - ## 3 a b - ## 4 b lb - ## 5 ctype ub - ## 6 lb ctype - ## 7 ub vartype - ## 8 vartype sense - ## 9 param param - ## 10 lpsolver - ## 11 savepb - - sense = varargin{1}; - c = varargin{2}; - a = varargin{3}; - b = varargin{4}; - - nx = length (c); - - if (nargin > 4) - ctype = varargin{5}; - else - ctype = repmat ("U", nx, 1); - endif - - if (nargin > 5) - lb = varargin{6}; - else - lb = repmat (-Inf, nx, 1); - endif - - if (nargin > 6) - ub = varargin{7}; - else - ub = repmat (Inf, nx, 1); - endif - - if (nargin > 7) - vartype = varargin{8}; - else - vartype = repmat ("C", nx, 1); - endif - - if (nargin > 8) - param = varargin{9}; - else - param = struct (); - endif - - if (nargin > 9 && ! isfield (param, "lpsolver")) - param.lpsolver = varargin{10}; - endif - - if (nargin > 10 && ! isfield (param, "save")) - param.save = varargin{11}; - endif - - if (nargout == 0) - glpk (c, a, b, lb, ub, ctype, vartype, sense, param); - elseif (nargout == 1) - xopt = glpk (c, a, b, lb, ub, ctype, vartype, sense, param); - elseif (nargout == 2) - [xopt, fopt] = glpk (c, a, b, lb, ub, ctype, vartype, sense, param); - elseif (nargout == 3) - [xopt, fopt, status] = ... - glpk (c, a, b, lb, ub, ctype, vartype, sense, param); - else - [xopt, fopt, status, extra] = ... - glpk (c, a, b, lb, ub, ctype, vartype, sense, param); - endif - -endfunction diff -r 2c35dfd641ff -r c16ce72e0a22 scripts/optimization/module.mk --- a/scripts/optimization/module.mk Sun Jan 30 04:38:35 2011 -0500 +++ b/scripts/optimization/module.mk Sun Jan 30 07:52:36 2011 -0800 @@ -10,7 +10,6 @@ optimization/fsolve.m \ optimization/fzero.m \ optimization/glpk.m \ - optimization/glpkmex.m \ optimization/lsqnonneg.m \ optimization/optimget.m \ optimization/optimset.m \