Mercurial > hg > octave-nkf
changeset 19842:ebd27d8c63fd
update default branch to release as 4.0
Now that we plan to release default instead of the gui-release branch
as 4.0, restore functions removed from the default branch.
* java_new.m, default_save_options.m, gen_doc_cache.m, interp1q.m,
isequalwithequalnans.m, java_convert_matrix.m, java_debug.m,
java_invoke.m, java_unsigned_conversion.m, javafields.m,
javamethods.m, re_read_readline_init_file.m,
read_readline_init_file.m, saving_history.m:
Restore deprecated functions.
* scripts/deprecated/module.mk: Update.
* NEWS: Update.
* configure.ac (AC_INIT): Set version to 3.9.0+.
(OCTAVE_MAJOR_VERSION): Now 3.
(OCTAVE_MINOR_VERSION): Now 9.
line wrap: on
line diff
--- a/NEWS +++ b/NEWS @@ -1,4 +1,4 @@ -Summary of important user-visible changes for version 4.2: +Summary of important user-visible changes for version 4.0: --------------------------------------------------------- ** A new syntax for object oriented programming termed classdef has been @@ -19,7 +19,7 @@ audioinfo audiorecorder audioplayer audiowrite - ** Other new classes in Octave 4.2: + ** Other new classes in Octave 4.0: audioplayer inputParser audiorecorder @@ -37,6 +37,30 @@ All three optimizations are disabled if Octave is started with the --braindead command line option. + ** For compatibility with Matlab, the "backtrace" warning option is now + enabled by default. + + ** The preference + + do_braindead_shortcircuit_evaluation + + is now enabled by default. + + ** The preference + + allow_noninteger_range_as_index + + is now enabled by default and the warning ID + + Octave:noninteger-range-as-index + + is now set to "on" by default instead of "error" by default and "on" + for --traditional. + + ** polyeig now returns a row vector of eigenvalues rather than a matrix + with the eigenvalues on the diagonal. This change was made for Matlab + compatibility. + ** Interpolation function changes for Matlab compatibility The interpolation method 'cubic' is now equivalent to 'pchip' @@ -122,7 +146,7 @@ previous separate warning IDs "Octave:fopen-file-in-path", "Octave:load-file-in-path", and "Octave:md5sum-file-in-path". - ** Other new functions added in 4.2: + ** Other new functions added in 4.0: bandwidth cubehelix @@ -146,6 +170,7 @@ rotate sylvester unsetenv + validateattributes zoom ** inline() scheduled for eventual deprecation by Matlab @@ -157,9 +182,9 @@ ** Deprecated functions. - The following functions have been deprecated in Octave 4.2 and will - be removed from Octave 4.6 (or whatever version is the second major - release after 4.2): + The following functions have been deprecated in Octave 4.0 and will + be removed from Octave 4.4 (or whatever version is the second major + release after 4.0): Function | Replacement ---------------------|------------------ @@ -176,8 +201,12 @@ syl | sylvester usage | print_usage - The following functions were deprecated in Octave 3.8 and have been - removed from Octave 4.2. + allow_noninteger_range_as_index + do_braindead_shortcircuit_evaluation + + ** The following functions were deprecated in Octave 3.8 and will be + removed from Octave 4.2 (or whatever version is the second major + release after 3.8): default_save_options java_new gen_doc_cache java_unsigned_conversion @@ -187,19 +216,33 @@ java_debug read_readline_init_file java_invoke saving_history - The following keywords were deprecated in Octave 3.8 and have been - removed from Octave 4.2 + ** The following functions were deprecated in Octave 3.6 and have been + removed from Octave 4.0. + + cut polyderiv + cor shell_cmd + corrcoef studentize + __error_text__ sylvester_matrix + error_text + + ** The following keywords were deprecated in Octave 3.8 and have been + removed from Octave 4.0 static - The following configuration variables were deprecated in Octave 3.8 - and have been removed from Octave 4.2 + ** The following configuration variables were deprecated in Octave 3.8 + and have been removed from Octave 4.0 CC_VERSION (now GCC_VERSION) CXX_VERSION (now GXX_VERSION) - The internal class <Octave_map> was deprecated in Octave 3.8 and has - been removed from Octave 4.2. Replacement classes are + ** The internal function atan2 of the sparse matrix class has been deprecated + in Octave 4.0 and will be removed from Octave 4.4 (or whatever version is + the second major release after 4.0). Use the Fatan2 function with sparse + inputs as a replacement. + + ** The internal class <Octave_map> was deprecated in Octave 3.8 and has + been removed from Octave 4.0. Replacement classes are <octave_map> (struct array) or <octave_scalar_map> for a single structure. ** The warning ID Octave:singular-matrix-div has been replaced by @@ -212,60 +255,6 @@ and DEFINE_OCTAVE_ALLOCATOR2) are now unconditionally defined to be empty. -Summary of important user-visible changes for version 4.0: ---------------------------------------------------------- - - ** For compatibility with Matlab, the "backtrace" warning option is now - enabled by default. - - ** The preference - - do_braindead_shortcircuit_evaluation - - is now enabled by default. - - ** The preference - - allow_noninteger_range_as_index - - is now enabled by default and the warning ID - - Octave:noninteger-range-as-index - - is now set to "on" by default instead of "error" by default and "on" - for --traditional. - - ** polyeig now returns a row vector of eigenvalues rather than a matrix - with the eigenvalues on the diagonal. This change was made for Matlab - compatibility. - - ** Other new functions added in 4.0.0: - - validateattributes - - ** Deprecated functions. - - The following functions were deprecated in Octave 3.6 and have been - removed from Octave 4.0. - - cut polyderiv - cor shell_cmd - corrcoef studentize - __error_text__ sylvester_matrix - error_text - - The following functions have been deprecated in Octave 4.0 and will - be removed from Octave 4.4 (or whatever version is the second major - release after 4.0): - - allow_noninteger_range_as_index - do_braindead_shortcircuit_evaluation - - The internal function atan2 of the sparse matrix class has been deprecated - in Octave 4.0 and will be removed from Octave 4.4 (or whatever version is - the second major release after 4.0). Use the Fatan2 function with sparse - inputs as a replacement. - --------------------------------------------------------- See NEWS.3 for old news.
--- a/configure.ac +++ b/configure.ac @@ -19,13 +19,13 @@ ### <http://www.gnu.org/licenses/>. AC_PREREQ([2.62]) -AC_INIT([GNU Octave], [4.1.0+], [http://octave.org/bugs.html], [octave]) +AC_INIT([GNU Octave], [3.9.0+], [http://octave.org/bugs.html], [octave]) dnl Note that the version number is duplicated here and in AC_INIT dnl because AC_INIT requires it to be static, not computed from dnl shell variables. -OCTAVE_MAJOR_VERSION=4 -OCTAVE_MINOR_VERSION=1 +OCTAVE_MAJOR_VERSION=3 +OCTAVE_MINOR_VERSION=9 OCTAVE_PATCH_VERSION=0+ dnl PACKAGE_VERSION is set by the AC_INIT VERSION arg
--- a/libinterp/corefcn/spparms.cc +++ b/libinterp/corefcn/spparms.cc @@ -131,7 +131,7 @@ if (str == "defaults" || str == "default") { - // FIXME: deprecated in 4.2, remove "defaults" for 4.6 release + // FIXME: deprecated in 4.0, remove "defaults" for 4.4 release static bool warned = false; if (! warned && str == "defaults") {
--- a/scripts/deprecated/bicubic.m +++ b/scripts/deprecated/bicubic.m @@ -19,7 +19,7 @@ ## -*- texinfo -*- ## @deftypefn {Function File} {@var{zi} =} bicubic (@var{x}, @var{y}, @var{z}, @var{xi}, @var{yi}, @var{extrapval}) ## -## @code{bicubic} is deprecated and will be removed in Octave version 4.6. +## @code{bicubic} is deprecated and will be removed in Octave version 4.4. ## Use @code{interp2 (@dots{}, "spline")} for the equivalent functionality. ## ## Return a matrix @var{zi} corresponding to the bicubic @@ -35,7 +35,7 @@ ## Bicubic interpolation method. ## Author: Hoxide Ma <hoxide_dirac@yahoo.com.cn> -## Deprecated in version 4.2 +## Deprecated in version 4.0 function zi = bicubic (x, y, z, xi, yi, extrapval, spline_alpha)
new file mode 100644 --- /dev/null +++ b/scripts/deprecated/default_save_options.m @@ -0,0 +1,42 @@ +## Copyright (C) 2013 Rik Wehbring +## +## 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 {Built-in Function} {@var{val} =} default_save_options () +## @deftypefnx {Built-in Function} {@var{old_val} =} default_save_options (@var{new_val}) +## @deftypefnx {Built-in Function} {} default_save_options (@var{new_val}, "local") +## This function has been deprecated. Use @code{@file{save_default_options}} +## instead. +## @seealso{save_default_options} +## @end deftypefn + +## Deprecated in 3.8 + +function retval = default_save_options (varargin) + + persistent warned = false; + if (! warned) + warned = true; + warning ("Octave:deprecated-function", + "default_save_options is obsolete and will be removed from a future version of Octave, please use save_default_options instead"); + endif + + retval = save_default_options (varargin{:}); + +endfunction +
--- a/scripts/deprecated/delaunay3.m +++ b/scripts/deprecated/delaunay3.m @@ -20,7 +20,7 @@ ## @deftypefn {Function File} {@var{tetr} =} delaunay3 (@var{x}, @var{y}, @var{z}) ## @deftypefnx {Function File} {@var{tetr} =} delaunay3 (@var{x}, @var{y}, @var{z}, @var{options}) ## -## @code{delaunay3} is deprecated and will be removed in Octave version 4.6. +## @code{delaunay3} is deprecated and will be removed in Octave version 4.4. ## Please use @code{delaunay} in all new code. ## ## Compute the Delaunay triangulation for a 3-D set of points. @@ -51,6 +51,8 @@ ## Author: Kai Habel <kai.habel@gmx.de> +## Deprecated in 4.0 + function tetr = delaunay3 (x, y, z, options) persistent warned = false;
--- a/scripts/deprecated/dump_prefs.m +++ b/scripts/deprecated/dump_prefs.m @@ -20,7 +20,7 @@ ## @deftypefn {Function File} {} dump_prefs () ## @deftypefnx {Function File} {} dump_prefs (@var{fid}) ## -## @code{dump_prefs} is deprecated and will be removed in Octave version 4.6. +## @code{dump_prefs} is deprecated and will be removed in Octave version 4.4. ## Please use individual preference get/set routines in all new code. ## ## Dump the current settings of all user preferences to stdout in a format that @@ -33,6 +33,8 @@ ## Author: jwe +## Deprecated in 4.0 + function dump_prefs (fid) persistent warned = false;
--- a/scripts/deprecated/find_dir_in_path.m +++ b/scripts/deprecated/find_dir_in_path.m @@ -23,7 +23,7 @@ ## @seealso{dir_in_loadpath} ## @end deftypefn -## Deprecated in version 4.2 +## Deprecated in version 4.0 function retval = find_dir_in_path (varargin)
--- a/scripts/deprecated/finite.m +++ b/scripts/deprecated/finite.m @@ -19,7 +19,7 @@ ## -*- texinfo -*- ## @deftypefn {Mapping Function} {} finite (@var{x}) ## -## @code{finite} is deprecated and will be removed in Octave version 4.6. +## @code{finite} is deprecated and will be removed in Octave version 4.4. ## Please use @code{isfinite} in all new code. ## ## Return a logical array which is true where the elements of @var{x} are @@ -35,7 +35,7 @@ ## @seealso{isfinite, isinf, isnan, isna} ## @end deftypefn -## Deprecated in version 4.2 +## Deprecated in version 4.0 function retval = finite (varargin)
--- a/scripts/deprecated/fmod.m +++ b/scripts/deprecated/fmod.m @@ -19,7 +19,7 @@ ## -*- texinfo -*- ## @deftypefn {Mapping Function} {} fmod (@var{x}, @var{y}) ## -## @code{fmod} is deprecated and will be removed in Octave version 4.6. +## @code{fmod} is deprecated and will be removed in Octave version 4.4. ## Please use @code{rem} in all new code. ## ## Return the remainder of the division @code{@var{x} / @var{y}}, computed @@ -34,7 +34,7 @@ ## @seealso{rem, mod} ## @end deftypefn -## Deprecated in version 4.2 +## Deprecated in version 4.0 function retval = fmod (varargin)
--- a/scripts/deprecated/fnmatch.m +++ b/scripts/deprecated/fnmatch.m @@ -19,7 +19,7 @@ ## -*- texinfo -*- ## @deftypefn {Built-in Function} {} fnmatch (@var{pattern}, @var{string}) ## -## @code{fnmatch} is deprecated and will be removed in Octave version 4.6. +## @code{fnmatch} is deprecated and will be removed in Octave version 4.4. ## Please use @code{glob} or @code{regexp} in all new code. ## ## Return true or false for each element of @var{string} that matches any of @@ -35,7 +35,7 @@ ## @seealso{glob, regexp} ## @end deftypefn -## Deprecated in version 4.2 +## Deprecated in version 4.0 function retval = fnmatch (varargin)
new file mode 100644 --- /dev/null +++ b/scripts/deprecated/gen_doc_cache.m @@ -0,0 +1,39 @@ +## Copyright (C) 2013 Rik Wehbring +## +## 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} {} gen_doc_cache (@var{out_file}, @var{directory}) +## This function has been deprecated. Use @code{doc_cache_create} instead. +## @seealso{doc_cache_create} +## @end deftypefn + +## Deprecated in 3.8 + +function gen_doc_cache (varargin) + + persistent warned = false; + if (! warned) + warned = true; + warning ("Octave:deprecated-function", + "gen_doc_cache is obsolete and will be removed from a future version of Octave, please use doc_cache_create instead"); + endif + + doc_cache_create (varargin{:}); + +endfunction +
new file mode 100644 --- /dev/null +++ b/scripts/deprecated/interp1q.m @@ -0,0 +1,81 @@ +## Copyright (C) 2008-2013 David Bateman +## +## 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{yi} =} interp1q (@var{x}, @var{y}, @var{xi}) +## One-dimensional linear interpolation without error checking. +## Interpolates @var{y}, defined at the points @var{x}, at the points +## @var{xi}. The sample points @var{x} must be a strictly monotonically +## increasing column vector. If @var{y} is a matrix or an N-dimensional +## array, the interpolation is performed on each column of @var{y}. If +## @var{y} is a vector, it must be a column vector of the same length as +## @var{x}. +## +## Values of @var{xi} beyond the endpoints of the interpolation result +## in NA being returned. +## +## Note that the error checking is only a significant portion of the +## execution time of this @code{interp1} if the size of the input arguments +## is relatively small. Therefore, the benefit of using @code{interp1q} +## is relatively small. +## @seealso{interp1} +## @end deftypefn + +function yi = interp1q (x, y, xi) + + persistent warned = false; + if (! warned) + warned = true; + warning ("Octave:deprecated-function", + "interp1q is obsolete and will be removed from a future version of Octave; use interp1 instead"); + endif + + x = x(:); + nx = rows (x); + szy = size (y); + y = y(:,:); + [ny, nc] = size (y); + szx = size (xi); + xi = xi (:); + dy = diff (y); + dx = diff (x); + idx = lookup (x, xi, "lr"); + s = (xi - x (idx)) ./ dx (idx); + yi = bsxfun (@times, s, dy(idx,:)) + y(idx,:); + range = xi < x(1) | !(xi <= x(nx)); + yi(range,:) = NA; + if (length (szx) == 2 && any (szx == 1)) + yi = reshape (yi, [max(szx), szy(2:end)]); + else + yi = reshape (yi, [szx, szy(2:end)]); + endif +endfunction + + +%!shared xp, yp, xi, yi +%! xp = [0:2:10].'; yp = sin (2*pi*xp/5); +%! xi = [-1; 0; 2.2; 4; 6.6; 10; 11]; +%! yi = interp1 (xp,yp,xi); +%!assert (interp1q (xp,yp, [min(xp)-1; max(xp)+1]), [NA; NA]); +%!assert (interp1q (xp,yp,xp), yp, 100*eps); +%!assert (isempty (interp1q (xp,yp,[]))); +%!assert (interp1q (xp,yp,xi), yi); +%!assert (interp1q (xp,[yp,yp],xi), [yi, yi]); +%!assert (interp1q (xp,yp,[xi,xi]), [yi, yi]); +%!assert (interp1q (xp,[yp,yp],[xi,xi]), cat (3, [yi, yi], [yi, yi])); +
new file mode 100644 --- /dev/null +++ b/scripts/deprecated/isequalwithequalnans.m @@ -0,0 +1,50 @@ +## Copyright (C) 2005-2013 William Poetra Yoga Hadisoeseno +## +## 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} {} isequalwithequalnans (@var{x1}, @var{x2}, @dots{}) +## This function has been deprecated. Use @code{@file{isequaln}} instead. +## @seealso{isequaln} +## @end deftypefn + +## Deprecated in 3.8 + +function retval = isequalwithequalnans (varargin) + + persistent warned = false; + if (! warned) + warned = true; + warning ("Octave:deprecated-function", + "isequalwithequalnans is obsolete and will be removed from a future version of Octave, please use isequaln instead"); + endif + + retval = isequaln (varargin{:}); + +endfunction + + +## test for equality +%!assert (isequalwithequalnans ({1,2,NaN,4},{1,2,NaN,4}), true) +%!assert (isequalwithequalnans ([1,2,NaN,4],[1,2,NaN,4]), true) +## test for inequality +%!assert (isequalwithequalnans ([1,2,NaN,4],[1,NaN,3,4]), false) +%!assert (isequalwithequalnans ([1,2,NaN,4],[1,2,3,4]), false) +## test for equality (struct) +%!assert (isequalwithequalnans (struct ('a',NaN,'b',2),struct ('a',NaN,'b',2),struct ('a',NaN,'b',2)), true) +%!assert (isequalwithequalnans (1,2,1), false) +
new file mode 100644 --- /dev/null +++ b/scripts/deprecated/java_convert_matrix.m @@ -0,0 +1,48 @@ +## Copyright (C) 2012-2013 Rik Wehbring +## +## 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 {Built-in Function} {@var{val} =} java_convert_matrix () +## @deftypefnx {Built-in Function} {@var{old_val} =} java_convert_matrix (@var{new_val}) +## @deftypefnx {Built-in Function} {} java_convert_matrix (@var{new_val}, "local") +## Query or set the internal variable that controls whether Java arrays are +## automatically converted to Octave matrices. The default value is false. +## +## When called from inside a function with the @qcode{"local"} option, the +## variable is changed locally for the function and any subroutines it calls. +## The original variable value is restored when exiting the function. +## @seealso{java_matrix_autoconversion, java_unsigned_conversion, java_debug} +## @end deftypefn + +function old_val = java_convert_matrix (varargin) + + persistent warned = false; + if (! warned) + warned = true; + warning ("Octave:deprecated-function", + "java_convert_matrix is obsolete and will be removed from a future version of Octave; use java_matrix_autoconversion instead"); + endif + + if (nargin > 2) + print_usage (); + endif + + old_val = java_matrix_autoconversion (varargin{:}); + +endfunction +
new file mode 100644 --- /dev/null +++ b/scripts/deprecated/java_debug.m @@ -0,0 +1,49 @@ +## Copyright (C) 2012-2013 Rik Wehbring +## +## 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 {Built-in Function} {@var{val} =} java_debug () +## @deftypefnx {Built-in Function} {@var{old_val} =} java_debug (@var{new_val}) +## @deftypefnx {Built-in Function} {} java_debug (@var{new_val}, "local") +## Query or set the internal variable that determines whether extra debugging +## information regarding the initialization of the JVM and any Java exceptions +## is printed. +## +## When called from inside a function with the @qcode{"local"} option, the +## variable is changed locally for the function and any subroutines it calls. +## The original variable value is restored when exiting the function. +## @seealso{debug_java, java_convert_matrix, java_unsigned_conversion} +## @end deftypefn + +function old_val = java_debug (varargin) + + persistent warned = false; + if (! warned) + warned = true; + warning ("Octave:deprecated-function", + "java_debug is obsolete and will be removed from a future version of Octave; use debug_java instead"); + endif + + if (nargin > 2) + print_usage (); + endif + + old_val = debug_java (varargin{:}); + +endfunction +
new file mode 100644 --- /dev/null +++ b/scripts/deprecated/java_invoke.m @@ -0,0 +1,57 @@ +## Copyright (C) 2007, 2013 Michael Goffioul +## +## 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 {Built-in Function} {@var{ret} =} java_invoke (@var{obj}, @var{methodname}) +## @deftypefnx {Built-in Function} {@var{ret} =} java_invoke (@var{obj}, @var{methodname}, @var{arg1}, @dots{}) +## Invoke the method @var{methodname} on the Java object @var{obj} with the +## arguments @var{arg1}, @dots{} For static methods, @var{obj} can be a +## string representing the fully qualified name of the corresponding class. +## The function returns the result of the method invocation. +## +## When @var{obj} is a regular Java object, structure-like indexing can be +## used as a shortcut syntax. For instance, the two following statements are +## equivalent +## +## @example +## @group +## ret = java_invoke (x, "method1", 1.0, "a string") +## ret = x.method1 (1.0, "a string") +## @end group +## @end example +## +## @seealso{javaMethod, javaObject} +## @end deftypefn + +function retval = java_invoke (obj, methodname, varargin) + + persistent warned = false; + if (! warned) + warned = true; + warning ("Octave:deprecated-function", + "java_invoke is obsolete and will be removed from a future version of Octave, please use javaMethod instead"); + endif + + if (nargin < 2) + print_usage (); + endif + + retval = javaMethod (methodname, obj, varargin{:}); + +endfunction +
new file mode 100644 --- /dev/null +++ b/scripts/deprecated/java_new.m @@ -0,0 +1,51 @@ +## Copyright (C) 2012-2013 Rik Wehbring +## +## 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 {Loadable Function} {@var{obj} =} java_new (@var{name}) +## @deftypefnx {Loadable Function} {@var{obj} =} java_new (@var{name}, @var{arg1}, @dots{}) +## Create a Java object of class @var{name}, by calling the class constructor +## with the arguments @var{arg1}, @dots{} +## +## @example +## @group +## x = java_new ("java.lang.StringBuffer") +## x = java_new ("java.lang.StringBuffer", "Initial string") +## @end group +## @end example +## +## @seealso{javaObject, javaMethod} +## @end deftypefn + +function retval = java_new (varargin) + + persistent warned = false; + if (! warned) + warned = true; + warning ("Octave:deprecated-function", + "java_new is obsolete and will be removed from a future version of Octave; please use javaObject instead"); + endif + + if (nargin < 1) + print_usage (); + endif + + retval = javaObject (varargin{:}); + +endfunction +
new file mode 100644 --- /dev/null +++ b/scripts/deprecated/java_unsigned_conversion.m @@ -0,0 +1,50 @@ +## Copyright (C) 2012-2013 Rik Wehbring +## +## 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 {Built-in Function} {@var{val} =} java_unsigned_conversion () +## @deftypefnx {Built-in Function} {@var{old_val} =} java_unsigned_conversion (@var{new_val}) +## @deftypefnx {Built-in Function} {} java_unsigned_conversion (@var{new_val}, "local") +## Query or set the internal variable that controls how integer classes are +## converted when Java matrix autoconversion is enabled. When enabled, Java +## arrays of class Byte or Integer are converted to matrices of class uint8 or +## uint32 respectively. +## +## When called from inside a function with the @qcode{"local"} option, the +## variable is changed locally for the function and any subroutines it calls. +## The original variable value is restored when exiting the function. +## @seealso{java_unsigned_autoconversion, java_convert_matrix, debug_java} +## @end deftypefn + +function old_val = java_unsigned_conversion (varargin) + + persistent warned = false; + if (! warned) + warned = true; + warning ("Octave:deprecated-function", + "java_unsigned_conversion is obsolete and will be removed from a future version of Octave; use java_unsigned_autoconversion instead"); + endif + + if (nargin > 2) + print_usage (); + endif + + old_val = java_unsigned_autoconversion (varargin{:}); + +endfunction +
new file mode 100644 --- /dev/null +++ b/scripts/deprecated/javafields.m @@ -0,0 +1,54 @@ +## Copyright (C) 2007, 2013 Michael Goffioul +## +## 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} {} javafields (@var{javaobj}) +## @deftypefnx {Function File} {} javafields ("@var{classname}") +## @deftypefnx {Function File} {@var{fld_names} =} javafields (@dots{}) +## Return the fields of a Java object or Java class in the form of a cell +## array of strings. If no output is requested, print the result +## to the standard output. +## @seealso{fieldnames, methods, javaObject} +## @end deftypefn + +function fld_names = javafields (javaobj) + + persistent warned = false; + if (! warned) + warned = true; + warning ("Octave:deprecated-function", + "javafields is obsolete and will be removed from a future version of Octave, please use fieldnames instead"); + endif + + if (nargin != 1) + print_usage (); + endif + + c_methods = javaMethod ("getFields", "org.octave.ClassHelper", javaobj); + method_list = ostrsplit (c_methods, ';'); + + if (nargout == 0) + if (! isempty (method_list)) + disp (method_list); + endif + else + fld_names = cellstr (method_list); + endif + +endfunction +
new file mode 100644 --- /dev/null +++ b/scripts/deprecated/javamethods.m @@ -0,0 +1,54 @@ +## Copyright (C) 2007, 2013 Michael Goffioul +## +## 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} {} javamethods (@var{javaobj}) +## @deftypefnx {Function File} {} javamethods ("@var{classname}") +## @deftypefnx {Function File} {@var{mtd_names} =} javamethods (@dots{}) +## Return the methods of a Java object or Java class in the form of a cell +## array of strings. If no output is requested, print the result to the +## standard output. +## @seealso{methods, fieldnames, javaMethod, javaObject} +## @end deftypefn + +function mtd_names = javamethods (classname) + + persistent warned = false; + if (! warned) + warned = true; + warning ("Octave:deprecated-function", + "javamethods is obsolete and will be removed from a future version of Octave, please use methods instead"); + endif + + if (nargin != 1) + print_usage (); + endif + + cls_methods = javaMethod ("getMethods", "org.octave.ClassHelper", classname); + method_list = ostrsplit (cls_methods, ';'); + + if (nargout == 0) + if (! isempty (method_list)) + disp (method_list); + endif + else + mtd_names = cellstr (method_list); + endif + +endfunction +
--- a/scripts/deprecated/luinc.m +++ b/scripts/deprecated/luinc.m @@ -20,7 +20,7 @@ ## @deftypefnx {Built-in Function} {[@var{L}, @var{U}, @var{P}, @var{Q}] =} luinc (@var{A}, @var{droptol}) ## @deftypefnx {Built-in Function} {[@var{L}, @var{U}, @var{P}, @var{Q}] =} luinc (@var{A}, @var{opts}) ## -## @code{luinc} is deprecated and will be removed in Octave version 4.6. +## @code{luinc} is deprecated and will be removed in Octave version 4.4. ## Please use @code{ilu} or @code{ichol} in all new code. ## ## Produce the incomplete LU@tie{}factorization of the sparse matrix @var{A}. @@ -76,7 +76,7 @@ ## @seealso{ilu, ichol, lu, sparse} ## @end deftypefn -## Deprecated in version 4.2 +## Deprecated in version 4.0 function [L, U, P, Q] = luinc (varargin)
--- a/scripts/deprecated/module.mk +++ b/scripts/deprecated/module.mk @@ -2,16 +2,30 @@ deprecated_FCN_FILES = \ deprecated/bicubic.m \ + deprecated/default_save_options.m \ deprecated/delaunay3.m \ deprecated/dump_prefs.m \ deprecated/find_dir_in_path.m \ deprecated/finite.m \ deprecated/fmod.m \ deprecated/fnmatch.m \ + deprecated/gen_doc_cache.m \ + deprecated/interp1q.m \ + deprecated/isequalwithequalnans.m \ deprecated/isstr.m \ + deprecated/java_convert_matrix.m \ + deprecated/java_debug.m \ + deprecated/java_invoke.m \ + deprecated/java_new.m \ + deprecated/java_unsigned_conversion.m \ + deprecated/javafields.m \ + deprecated/javamethods.m \ deprecated/luinc.m \ + deprecated/nfields.m \ deprecated/octave_tmp_file_name.m \ - deprecated/nfields.m \ + deprecated/re_read_readline_init_file.m \ + deprecated/read_readline_init_file.m \ + deprecated/saving_history.m \ deprecated/strmatch.m \ deprecated/syl.m \ deprecated/usage.m
--- a/scripts/deprecated/nfields.m +++ b/scripts/deprecated/nfields.m @@ -20,11 +20,13 @@ ## @deftypefn {Function File} {} nfields (@var{s}) ## Return the number of fields of the structure @var{s}. ## -## @strong{Warning:} @code{nfields} is scheduled for removal in version 4.6. +## @strong{Warning:} @code{nfields} is scheduled for removal in version 4.4. ## Use @code{numfields} instead. ## @seealso{numfields, fieldnames} ## @end deftypefn +## Deprecated in 4.0 + function retval = nfields (varargin) persistent warned = false;
--- a/scripts/deprecated/octave_tmp_file_name.m +++ b/scripts/deprecated/octave_tmp_file_name.m @@ -22,7 +22,7 @@ ## @deftypefnx {Built-in Function} {@var{fname} =} octave_tmp_file_name (@var{dir}, @var{prefix}) ## ## @code{octave_tmp_file_name} is deprecated and will be removed in Octave -## version 4.6. Use @code{tempname} for equivalent functionality. +## version 4.4. Use @code{tempname} for equivalent functionality. ## ## Return a unique temporary file name as a string. ## @@ -33,8 +33,7 @@ ## @seealso{tempname, tmpnam, mkstemp, tempdir, P_tmpdir, tmpfile} ## @end deftypefn -## Deprecated in version 4.2 - +## Deprecated in version 4.0 function filename = octave_tmp_file_name (varargin)
new file mode 100644 --- /dev/null +++ b/scripts/deprecated/re_read_readline_init_file.m @@ -0,0 +1,40 @@ +## Copyright (C) 2013 Rik Wehbring +## +## 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 {Built-in Function} {} re_read_readline_init_file (@var{file}) +## This function has been deprecated. Use +## @code{@file{readline_re_read_init_file}} instead. +## @seealso{readline_read_init_file} +## @end deftypefn + +## Deprecated in 3.8 + +function re_read_readline_init_file (varargin) + + persistent warned = false; + if (! warned) + warned = true; + warning ("Octave:deprecated-function", + "re_read_readline_init_file is obsolete and will be removed from a future version of Octave, please use readline_re_read_init_file instead"); + endif + + readline_re_read_init_file (varargin{:}); + +endfunction +
new file mode 100644 --- /dev/null +++ b/scripts/deprecated/read_readline_init_file.m @@ -0,0 +1,40 @@ +## Copyright (C) 2013 Rik Wehbring +## +## 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 {Built-in Function} {} read_readline_init_file (@var{file}) +## This function has been deprecated. Use +## @code{@file{readline_read_init_file}} instead. +## @seealso{readline_read_init_file} +## @end deftypefn + +## Deprecated in 3.8 + +function read_readline_init_file (varargin) + + persistent warned = false; + if (! warned) + warned = true; + warning ("Octave:deprecated-function", + "read_readline_init_file is obsolete and will be removed from a future version of Octave, please use readline_read_init_file instead"); + endif + + readline_read_init_file (varargin{:}); + +endfunction +
new file mode 100644 --- /dev/null +++ b/scripts/deprecated/saving_history.m @@ -0,0 +1,41 @@ +## Copyright (C) 2013 Rik Wehbring +## +## 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 {Built-in Function} {@var{val} =} saving_history () +## @deftypefnx {Built-in Function} {@var{old_val} =} saving_history (@var{new_val}) +## @deftypefnx {Built-in Function} {} saving_history (@var{new_val}, "local") +## This function has been deprecated. Use @code{@file{history_save}} instead. +## @seealso{history_save} +## @end deftypefn + +## Deprecated in 3.8 + +function retval = saving_history (varargin) + + persistent warned = false; + if (! warned) + warned = true; + warning ("Octave:deprecated-function", + "saving_history is obsolete and will be removed from a future version of Octave, please use history_save instead"); + endif + + retval = save_default_options (varargin{:}); + +endfunction +
--- a/scripts/deprecated/strmatch.m +++ b/scripts/deprecated/strmatch.m @@ -22,7 +22,7 @@ ## @deftypefn {Function File} {} strmatch (@var{s}, @var{A}) ## @deftypefnx {Function File} {} strmatch (@var{s}, @var{A}, "exact") ## -## @code{strmatch} is deprecated and will be removed in Octave version 4.6. +## @code{strmatch} is deprecated and will be removed in Octave version 4.4. ## Use @code{strncmp} (normal case), or @code{strcmp} (@qcode{"exact"} case), ## or @code{regexp} in all new code. ## @@ -53,7 +53,7 @@ ## Author: Paul Kienzle, Alois Schloegl ## Adapted-by: jwe -## Deprecated in version 4.2 +## Deprecated in version 4.0 function idx = strmatch (s, A, exact)
--- a/scripts/deprecated/syl.m +++ b/scripts/deprecated/syl.m @@ -19,7 +19,7 @@ ## -*- texinfo -*- ## @deftypefn {Built-in Function} {@var{x} =} syl (@var{A}, @var{B}, @var{C}) ## -## @code{syl} is deprecated and will be removed in Octave version 4.6. +## @code{syl} is deprecated and will be removed in Octave version 4.4. ## Use @code{sylvester} for the equivalent functionality. ## ## Solve the Sylvester equation @@ -45,7 +45,7 @@ ## @end example ## @end deftypefn -## Deprecated in version 4.2 +## Deprecated in version 4.0 function x = syl (A, B, C)
--- a/scripts/deprecated/usage.m +++ b/scripts/deprecated/usage.m @@ -19,7 +19,7 @@ ## -*- texinfo -*- ## @deftypefn {Built-in Function} {} usage (@var{msg}) ## -## @code{usage} is deprecated and will be removed in Octave version 4.6. +## @code{usage} is deprecated and will be removed in Octave version 4.4. ## Please use @code{print_usage} in all new code. ## ## Print the message @var{msg}, prefixed by the string @samp{usage: }, and @@ -49,7 +49,7 @@ ## @seealso{print_usage} ## @end deftypefn -## Deprecated in version 4.2 +## Deprecated in version 4.0 function retval = usage (varargin)