changeset 12304:c16ce72e0a22 release-3-4-x

Deprecate glpkmex function and remove from documentation.
author Rik <octave@nomad.inbox5.com>
date Sun, 30 Jan 2011 07:52:36 -0800
parents 2c35dfd641ff
children f8891edcfd35
files ChangeLog NEWS doc/ChangeLog doc/interpreter/optim.txi scripts/ChangeLog scripts/deprecated/glpkmex.m scripts/deprecated/module.mk scripts/optimization/glpkmex.m scripts/optimization/module.mk
diffstat 9 files changed, 135 insertions(+), 116 deletions(-) [+]
line wrap: on
line diff
--- 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  <octave@nomad.inbox5.com>
+
+	* NEWS: Deprecate glpkmex function.
+	
 2011-01-30  John W. Eaton  <jwe@octave.org>
 
 	* acinclude.m4 (OCTAVE_PROG_GHOSTSCRIPT): Update warning message.
--- 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).
--- 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  <octave@nomad.inbox5.com>
+
+	* interpreter/optim.txi: Deprecate glpkmex function and remove
+	from documentation.
+
 2011-01-30  John W. Eaton  <jwe@octave.org>
 
 	* interpreter/install.txi (Compiling Octave with 64-bit	Indexing):
--- 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
 
--- 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  <octave@nomad.inbox5.com>
+
+	* deprecated/module.mk, optimization/module.mk: Deprecate glpkmex
+	function.
+
 2011-01-30  John W. Eaton  <jwe@octave.org>
 
 	* plot/__gnuplot_drawnow__.m: Rename from gnuplot_drawnow.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
+## <http://www.gnu.org/licenses/>.
+
+## -*- 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
--- 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 \
--- 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
-## <http://www.gnu.org/licenses/>.
-
-## -*- 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
--- 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 \