# HG changeset patch # User Rik # Date 1476204561 25200 # Node ID edd04ce998912946514f716a4fdcf410ca31c59e # Parent c05377052b501ff9fd3a121f21b5422ccc722c05 Remove functions deprecated in version 4.0. * NEWS: Announce functions that were removed. * ov-range.cc (allow_noninteger_range_as_index): Remove DEFUN. Remove static variable Vallow_noninteger_range_as_index. * ov-range.cc (octave_range::index_vector): Remove reference to Vallow_noninteger_range_as_index. * pt-binop.cc (do_braindead_shortcircuit_evaluation): Remove DEFUN. Remove static variable Vdo_braindead_shortcircuit_evaluation. * pt-binop.cc (tree_binary_expression::rvalue1): Remove reference to Vdo_braindead_shortcircuit_evaluation. * scripts/deprecated/bicubic.m: Delete file. * scripts/deprecated/delaunay3.m: Delete file. * scripts/deprecated/dump_prefs.m: Delete file. * scripts/deprecated/find_dir_in_path.m: Delete file. * scripts/deprecated/finite.m: Delete file. * scripts/deprecated/fmod.m: Delete file. * scripts/deprecated/fnmatch.m: Delete file. * scripts/deprecated/gmap40.m: Delete file. * scripts/deprecated/loadaudio.m: Delete file. * scripts/deprecated/luinc.m: Delete file. * scripts/deprecated/mouse_wheel_zoom.m: Delete file. * scripts/deprecated/nfields.m: Delete file. * scripts/deprecated/octave_tmp_file_name.m: Delete file. * scripts/deprecated/playaudio.m: Delete file. * scripts/deprecated/saveaudio.m: Delete file. * scripts/deprecated/setaudio.m: Delete file. * scripts/deprecated/syl.m: Delete file. * scripts/deprecated/usage.m: Delete file. * scripts/deprecated/module.mk: Remove deleted scripts from build system. * error.tst: Remove tests for usage. diff -r c05377052b50 -r edd04ce99891 NEWS --- a/NEWS Tue Oct 11 08:56:03 2016 -0700 +++ b/NEWS Tue Oct 11 09:49:21 2016 -0700 @@ -5,6 +5,40 @@ gsvd + ** Deprecated functions. + + The following functions have been deprecated in Octave 4.4 and will + be removed from Octave 4.8 (or whatever version is the second major + release after 4.4): + + Function | Replacement + ---------------------|------------------ + + + ** The following functions were deprecated in Octave 4.0 and have been + removed from Octave 4.4. + + allow_noninteger_range_as_index + bicubic + delaunay3 + do_braindead_shortcircuit_evaluation + dump_prefs + find_dir_in_path + finite + fmod + fnmatch + gmap40 + loadaudio + luinc + mouse_wheel_zoom + nfields + octave_tmp_file_name + playaudio + saveaudio + setaudio + syl + usage + Summary of important user-visible changes for version 4.2: --------------------------------------------------------- diff -r c05377052b50 -r edd04ce99891 libinterp/octave-value/ov-range.cc --- a/libinterp/octave-value/ov-range.cc Tue Oct 11 08:56:03 2016 -0700 +++ b/libinterp/octave-value/ov-range.cc Tue Oct 11 09:49:21 2016 -0700 @@ -57,8 +57,6 @@ #include "ls-hdf5.h" #include "ls-utils.h" -// If TRUE, allow ranges with non-integer elements as array indices. -static bool Vallow_noninteger_range_as_index = true; DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_range, "range", "double"); @@ -173,9 +171,7 @@ return *idx_cache; else { - if (require_integers - || ! Vallow_noninteger_range_as_index - || range.all_elements_are_ints ()) + if (require_integers || range.all_elements_are_ints ()) return set_idx_cache (idx_vector (range)); else { @@ -780,52 +776,3 @@ : octave_value (); } -DEFUN (allow_noninteger_range_as_index, args, nargout, - doc: /* -*- texinfo -*- -@deftypefn {} {@var{val} =} allow_noninteger_range_as_index () -@deftypefnx {} {@var{old_val} =} allow_noninteger_range_as_index (@var{new_val}) -@deftypefnx {} {} allow_noninteger_range_as_index (@var{new_val}, "local") -Query or set the internal variable that controls whether non-integer -ranges are allowed as indices. - -This might be useful for @sc{matlab} compatibility; however, it is still not -entirely compatible because @sc{matlab} treats the range expression -differently in different contexts. - -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. -@end deftypefn */) -{ - static bool warned = false; - if (! warned) - { - warned = true; - warning_with_id ("Octave:deprecated-function", - "allow_noninteger_range_as_index is obsolete and will be removed from a future version of Octave"); - } - - return SET_INTERNAL_VARIABLE (allow_noninteger_range_as_index); -} - -/* -%!test -%! x = 0:10; -%! warning ("off", "Octave:deprecated-function", "local"); -%! save = allow_noninteger_range_as_index (); -%! warn_state = warning ("query", "Octave:noninteger-range-as-index"); -%! unwind_protect -%! allow_noninteger_range_as_index (false); -%! fail ("x(2.1:5)"); -%! assert (x(2:5), 1:4); -%! allow_noninteger_range_as_index (true); -%! warning ("off", "Octave:noninteger-range-as-index"); -%! assert (x(2.49:5), 1:3); -%! assert (x(2.5:5), 2:4); -%! assert (x(2.51:5), 2:4); -%! unwind_protect_cleanup -%! allow_noninteger_range_as_index (save); -%! warning (warn_state.state, warn_state.identifier); -%! end_unwind_protect -*/ - diff -r c05377052b50 -r edd04ce99891 libinterp/parse-tree/pt-binop.cc --- a/libinterp/parse-tree/pt-binop.cc Tue Oct 11 08:56:03 2016 -0700 +++ b/libinterp/parse-tree/pt-binop.cc Tue Oct 11 09:49:21 2016 -0700 @@ -34,9 +34,6 @@ #include "pt-walk.h" #include "variables.h" -// TRUE means we mark | and & expressions for braindead short-circuit -// behavior. -static bool Vdo_braindead_shortcircuit_evaluation = true; // Binary expressions. @@ -69,8 +66,7 @@ { octave_value retval; - if (Vdo_braindead_shortcircuit_evaluation - && eligible_for_braindead_shortcircuit) + if (eligible_for_braindead_shortcircuit) { if (op_lhs) { @@ -259,47 +255,3 @@ return new_be; } -DEFUN (do_braindead_shortcircuit_evaluation, args, nargout, - doc: /* -*- texinfo -*- -@deftypefn {} {@var{val} =} do_braindead_shortcircuit_evaluation () -@deftypefnx {} {@var{old_val} =} do_braindead_shortcircuit_evaluation (@var{new_val}) -@deftypefnx {} {} do_braindead_shortcircuit_evaluation (@var{new_val}, "local") -Query or set the internal variable that controls whether Octave will -do short-circuit evaluation of @samp{|} and @samp{&} operators inside the -conditions of if or while statements. - -This feature is only provided for compatibility with @sc{matlab} and should -not be used unless you are porting old code that relies on this feature. - -To obtain short-circuit behavior for logical expressions in new programs, -you should always use the @samp{&&} and @samp{||} operators. - -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. -@end deftypefn */) -{ - static bool warned = false; - if (! warned) - { - warned = true; - warning_with_id ("Octave:deprecated-function", - "do_braindead_shortcircuit_evaluation is obsolete and will be removed from a future version of Octave"); - } - - return SET_INTERNAL_VARIABLE (do_braindead_shortcircuit_evaluation); -} - -/* -%!test -%! x = 0; -%! do_braindead_shortcircuit_evaluation (0); -%! if (1 | (x = 1)) -%! endif -%! assert (x, 1); -%! do_braindead_shortcircuit_evaluation (1); -%! if (1 | (x = 0)) -%! endif -%! assert (x, 1); -*/ - diff -r c05377052b50 -r edd04ce99891 scripts/deprecated/bicubic.m --- a/scripts/deprecated/bicubic.m Tue Oct 11 08:56:03 2016 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,260 +0,0 @@ -## Copyright (C) 2005-2016 Hoxide Ma -## -## 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 {} {@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.4. -## Use @code{interp2 (@dots{}, "spline")} for the equivalent functionality. -## -## Return a matrix @var{zi} corresponding to the bicubic -## interpolations at @var{xi} and @var{yi} of the data supplied -## as @var{x}, @var{y} and @var{z}. Points outside the grid are set -## to @var{extrapval}. -## -## See @url{http://wiki.woodpecker.org.cn/moin/Octave/Bicubic} -## for further information. -## @seealso{interp2} -## @end deftypefn - -## Bicubic interpolation method. -## Author: Hoxide Ma - -## Deprecated in version 4.0 - -function zi = bicubic (x, y, z, xi, yi, extrapval, spline_alpha) - - persistent warned = false; - if (! warned) - warned = true; - warning ("Octave:deprecated-function", - "bicubic is obsolete and will be removed from a future version of Octave, please use interp2 instead"); - endif - - if (nargin < 1 || nargin > 7) - print_usage (); - endif - - if (nargin == 7 && isscalar (spline_alpha)) - a = spline_alpha; - else - a = 0.5; - endif - - if (nargin < 6) - extrapval = NaN; - endif - - if (isa (x, "single") || isa (y, "single") || isa (z, "single") - || isa (xi, "single") || isa (yi, "single")) - myeps = eps ("single"); - else - myeps = eps (); - endif - - if (nargin <= 2) - ## bicubic (z) or bicubic (z, 2) - if (nargin == 1) - n = 1; - else - n = y; - endif - z = x; - x = []; - [rz, cz] = size (z); - s = linspace (1, cz, (cz-1) * pow2 (n) + 1); - t = linspace (1, rz, (rz-1) * pow2 (n) + 1); - elseif (nargin == 3) - if (! isvector (x) || ! isvector (y)) - error ("bicubic: XI and YI must be vector"); - endif - s = y; - t = z; - z = x; - [rz, cz] = size (z); - elseif (nargin == 5 || nargin == 6) - [rz, cz] = size (z); - if (isvector (x) && isvector (y)) - if (rz != length (y) || cz != length (x)) - error ("bicubic: length of X and Y must match the size of Z"); - endif - elseif (size_equal (x, y) && size_equal (x, z)) - x = x(1,:); - y = y(:,1); - else - error ("bicubic: X, Y and Z must be equal size matrices of same size"); - endif - - if (all (diff (x) < 0)) - flipx = true; - x = fliplr (x); - elseif (all (diff (x) > 0)) - flipx = false; - else - error ("bicubic:nonmonotonic", "bicubic: X values must be monotonic"); - endif - if (all (diff (y) < 0)) - flipy = true; - y = flipud (y); - elseif (all (diff (y) > 0)) - flipy = false; - else - error ("bicubic:nonmonotonic", "bicubic: Y values must be monotonic"); - endif - - ## Mark values outside the lookup table. - xfirst_ind = find (xi < x(1)); - xlast_ind = find (xi > x(cz)); - yfirst_ind = find (yi < y(1)); - ylast_ind = find (yi > y(rz)); - ## Set value outside the table preliminary to min max index. - xi(xfirst_ind) = x(1); - xi(xlast_ind) = x(cz); - yi(yfirst_ind) = y(1); - yi(ylast_ind) = y(rz); - - x = reshape (x, 1, cz); - x(cz) *= 1 + sign (x(cz)) * myeps; - if (x(cz) == 0) - x(cz) = myeps; - endif; - xi = reshape (xi, 1, length (xi)); - [m, i] = sort ([x, xi]); - o = cumsum (i <= cz); - xidx = o(find (i > cz)); - - y = reshape (y, rz, 1); - y(rz) *= 1 + sign (y(rz)) * myeps; - if (y(rz) == 0) - y(rz) = myeps; - endif; - yi = reshape (yi, length (yi), 1); - [m, i] = sort ([y; yi]); - o = cumsum (i <= rz); - yidx = o([find(i > rz)]); - - ## Set s and t used follow codes. - s = xidx + ((xi .- x(xidx)) ./ (x(xidx+1) .- x(xidx))); - t = yidx + ((yi - y(yidx)) ./ (y(yidx+1) - y(yidx))); - - if (flipx) - s = fliplr (s); - endif - if (flipy) - t = flipud (t); - endif - else - print_usage (); - endif - - if (rz < 3 || cz < 3) - error ("bicubic: Z at least a 3 by 3 matrices"); - endif - - inds = floor (s); - d = find (s == cz); - s = s - floor (s); - inds(d) = cz-1; - s(d) = 1.0; - - d = []; - indt = floor (t); - d = find (t == rz); - t = t - floor (t); - indt(d) = rz-1; - t(d) = 1.0; - d = []; - - p = zeros (size (z) + 2); - p(2:rz+1,2:cz+1) = z; - p(1,:) = (6*(1-a))*p(2,:) - 3*p(3,:) + (6*a-2)*p(4,:); - p(rz+2,:) = (6*(1-a))*p(rz+1,:) - 3*p(rz,:) + (6*a-2)*p(rz-1,:); - p(:,1) = (6*(1-a))*p(:,2) - 3*p(:,3) + (6*a-2)*p(:,4); - p(:,cz+2) = (6*(1-a))*p(:,cz+1) - 3*p(:,cz) + (6*a-2)*p(:,cz-1); - - ## Calculate the C1(t) C2(t) C3(t) C4(t) and C1(s) C2(s) C3(s) C4(s). - t2 = t.*t; - t3 = t2.*t; - - ct0 = -a .* t3 + (2 * a) .* t2 - a .* t ; # -a G0 - ct1 = (2-a) .* t3 + (-3+a) .* t2 + 1 ; # F0 - a G1 - ct2 = (a-2) .* t3 + (-2 *a + 3) .* t2 + a .* t ; # F1 + a G0 - ct3 = a .* t3 - a .* t2; # a G1 - t = []; t2 = []; t3 = []; - - s2 = s.*s; - s3 = s2.*s; - - cs0 = -a .* s3 + (2 * a) .* s2 - a .*s ; # -a G0 - cs1 = (2-a) .* s3 + (-3 + a) .* s2 + 1 ; # F0 - a G1 - cs2 = (a-2) .* s3 + (-2 *a + 3) .* s2 + a .*s ; # F1 + a G0 - cs3 = a .* s3 - a .* s2; # a G1 - s = []; s2 = []; s3 = []; - - cs0 = cs0([1,1,1,1],:); - cs1 = cs1([1,1,1,1],:); - cs2 = cs2([1,1,1,1],:); - cs3 = cs3([1,1,1,1],:); - - lent = length (ct0); - lens = columns (cs0); - zi = zeros (lent, lens); - - for i = 1:lent - it = indt(i); - int = [it, it+1, it+2, it+3]; - zi(i,:) = ([ct0(i),ct1(i),ct2(i),ct3(i)] - * (p(int,inds) .* cs0 + p(int,inds+1) .* cs1 - + p(int,inds+2) .* cs2 + p(int,inds+3) .* cs3)); - endfor - - ## Set points outside the table to extrapval. - if (! (isempty (xfirst_ind) && isempty (xlast_ind))) - zi(:, [xfirst_ind, xlast_ind]) = extrapval; - endif - if (! (isempty (yfirst_ind) && isempty (ylast_ind))) - zi([yfirst_ind; ylast_ind], :) = extrapval; - endif - -endfunction - - -%!demo -%! clf; -%! colormap ("default"); -%! A = [13,-1,12;5,4,3;1,6,2]; -%! x = [0,1,4]+10; -%! y = [-10,-9,-8]; -%! xi = linspace (min (x), max (x), 17); -%! yi = linspace (min (y), max (y), 26)'; -%! mesh (xi, yi, bicubic (x,y,A,xi,yi)); -%! [x,y] = meshgrid (x,y); -%! hold on; plot3 (x(:),y(:),A(:),"b*"); hold off; - -%!test -%! x = linspace (1, -1, 10); -%! [xx, yy] = meshgrid (x); -%! z = cos (6 * xx) + sin (6 * yy); -%! x = linspace (1, -1, 30); -%! [xx2, yy2] = meshgrid (x); -%! z1 = interp2 (xx, yy, z, xx2, yy2, "spline"); -%! z2 = interp2 (fliplr (xx), flipud (yy), fliplr (flipud(z)), -%! fliplr (xx2), flipud (yy2), "spline"); -%! z2 = fliplr (flipud (z2)); -%! assert (z1, z2, 100 * eps ()); - diff -r c05377052b50 -r edd04ce99891 scripts/deprecated/delaunay3.m --- a/scripts/deprecated/delaunay3.m Tue Oct 11 08:56:03 2016 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,90 +0,0 @@ -## Copyright (C) 1999-2016 Kai Habel -## -## 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 {} {@var{tetr} =} delaunay3 (@var{x}, @var{y}, @var{z}) -## @deftypefnx {} {@var{tetr} =} delaunay3 (@var{x}, @var{y}, @var{z}, @var{options}) -## -## @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. -## The return value @var{tetr} is a set of tetrahedrons which satisfies the -## Delaunay circum-circle criterion, i.e., only a single data point from -## [@var{x}, @var{y}, @var{z}] is within the circum-circle of the defining -## tetrahedron. -## -## The set of tetrahedrons @var{tetr} is a matrix of size [n, 4]. Each -## row defines a tetrahedron and the four columns are the four vertices -## of the tetrahedron. The value of @code{@var{tetr}(i,j)} is an index into -## @var{x}, @var{y}, @var{z} for the location of the j-th vertex of the i-th -## tetrahedron. -## -## An optional fourth argument, which must be a string or cell array of -## strings, contains options passed to the underlying qhull command. See the -## documentation for the Qhull library for details -## @url{http://www.qhull.org/html/qh-quick.htm#options}. -## The default options are @code{@{"Qt", "Qbb", "Qc", "Qz"@}}. -## -## If @var{options} is not present or @code{[]} then the default arguments are -## used. Otherwise, @var{options} replaces the default argument list. -## To append user options to the defaults it is necessary to repeat the -## default arguments in @var{options}. Use a null string to pass no arguments. -## -## @seealso{delaunay, delaunayn, convhull, voronoi, tetramesh} -## @end deftypefn - -## Author: Kai Habel - -## Deprecated in 4.0 - -function tetr = delaunay3 (x, y, z, options) - - persistent warned = false; - if (! warned) - warned = true; - warning ("Octave:deprecated-function", - "delaunay3 is obsolete and will be removed from a future version of Octave, please use delaunay instead"); - endif - - if (nargin < 3 || nargin > 4) - print_usage (); - endif - - if (! (isvector (x) && isvector (y) && isvector (z) - && length (x) == length (y) && length (x) == length (z))) - error ("delaunay: X, Y, and Z must be the same size"); - elseif (nargin == 4 && ! (ischar (options) || iscellstr (options))) - error ("delaunay3: OPTIONS must be a string or cell array of strings"); - endif - - if (nargin == 3) - tetr = delaunayn ([x(:), y(:), z(:)]); - else - tetr = delaunayn ([x(:), y(:), z(:)], options); - endif - -endfunction - - -%!testif HAVE_QHULL -%! x = [-1, -1, 1, 0, -1]; y = [-1, 1, 1, 0, -1]; z = [0, 0, 0, 1, 1]; -%! assert (sortrows (sort (delaunay3 (x, y, z), 2)), [1,2,3,4;1,2,4,5]); - -## FIXME: Need input validation tests - diff -r c05377052b50 -r edd04ce99891 scripts/deprecated/dump_prefs.m --- a/scripts/deprecated/dump_prefs.m Tue Oct 11 08:56:03 2016 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,137 +0,0 @@ -## Copyright (C) 1994-2016 John W. Eaton -## -## 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 {} {} dump_prefs () -## @deftypefnx {} {} dump_prefs (@var{fid}) -## -## @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 -## can be parsed by Octave later. -## -## If the optional argument @var{fid} is given then the results are written to -## the file specified by file descriptor @var{fid}. -## @end deftypefn - -## Author: jwe - -## Deprecated in 4.0 - -function dump_prefs (fid) - - persistent warned = false; - if (! warned) - warned = true; - warning ("Octave:deprecated-function", - "dump_prefs is obsolete and will be removed from a future version of Octave, recode using individual preference get/set routines"); - endif - - if (nargin > 1) - print_usage (); - endif - - if (nargin == 0) - fid = stdout; - endif - - ## FIXME: It would be nice to be able to get the list of built-in variables - ## directly from Octave so that we wouldn't have to remember to update it - ## each time the list of preference variables changes - - pref_list = {"EDITOR" - "EXEC_PATH" - "IMAGE_PATH" - "PAGER" - "PAGER_FLAGS" - "PS1" - "PS2" - "PS4" - "allow_noninteger_range_as_index" - "beep_on_error" - "built_in_docstrings_file" - "completion_append_char" - "confirm_recursive_rmdir" - "crash_dumps_octave_core" - "debug_java" - "debug_on_error" - "debug_on_interrupt" - "debug_on_warning" - "disable_diagonal_matrix" - "disable_permutation_matrix" - "disable_range" - "do_braindead_shortcircuit_evaluation" - "doc_cache_file" - "echo_executing_commands" - "fixed_point_format" - "gnuplot_binary" - "history_file" - "history_save" - "history_size" - "history_timestamp_format_string" - "ignore_function_time_stamp" - "info_file" - "info_program" - "java_matrix_autoconversion" - "java_unsigned_autoconversion" - "makeinfo_program" - "max_recursion_depth" - "missing_component_hook" - "missing_function_hook" - "octave_core_file_limit" - "octave_core_file_name" - "octave_core_file_options" - "optimize_subsasgn_calls" - "output_max_field_width" - "output_precision" - "page_output_immediately" - "page_screen_output" - "print_empty_dimensions" - "print_struct_array_contents" - "save_default_options" - "save_header_format_string" - "save_precision" - "sighup_dumps_octave_core" - "sigterm_dumps_octave_core" - "silent_functions" - "sparse_auto_mutate" - "split_long_rows" - "string_fill_char" - "struct_levels_to_print" - "suppress_verbose_help_message" - "texi_macros_file"}; - - for i = 1:rows (pref_list) - pref = pref_list{i}; - try - val = feval (pref); - if (isnumeric (val)) - val = sprintf ("%g", val); - endif - fprintf (fid, " %s = %s\n", pref, val); - catch - fprintf (fid, "# %s = \n", pref); - end_try_catch - endfor - -endfunction - - -%!error dump_prefs (1,2) - diff -r c05377052b50 -r edd04ce99891 scripts/deprecated/find_dir_in_path.m --- a/scripts/deprecated/find_dir_in_path.m Tue Oct 11 08:56:03 2016 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -## Copyright (C) 2013-2016 John W. Eaton -## -## 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 {} {} find_dir_in_path (@var{dir}) -## @deftypefnx {} {} find_dir_in_path (@var{dir}, "all") -## This function has been deprecated. Use @code{dir_in_loadpath} instead. -## @seealso{dir_in_loadpath} -## @end deftypefn - -## Deprecated in version 4.0 - -function retval = find_dir_in_path (varargin) - - persistent warned = false; - if (! warned) - warned = true; - warning ("Octave:deprecated-function", - "find_dir_in_path is obsolete and will be removed from a future version of Octave, please use dir_in_loadpath instead"); - endif - - retval = dir_in_loadpath (varargin{:}); - -endfunction - diff -r c05377052b50 -r edd04ce99891 scripts/deprecated/finite.m --- a/scripts/deprecated/finite.m Tue Oct 11 08:56:03 2016 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -## Copyright (C) 2014-2016 John W. Eaton -## -## 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 {} {} finite (@var{x}) -## -## @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 -## finite values and false where they are not. -## For example: -## -## @example -## @group -## finite ([13, Inf, NA, NaN]) -## @result{} [ 1, 0, 0, 0 ] -## @end group -## @end example -## @seealso{isfinite, isinf, isnan, isna} -## @end deftypefn - -## Deprecated in version 4.0 - -function retval = finite (varargin) - - persistent warned = false; - if (! warned) - warned = true; - warning ("Octave:deprecated-function", - "finite is obsolete and will be removed from a future version of Octave, please use isfinite instead"); - endif - - retval = isfinite (varargin{:}); - -endfunction - diff -r c05377052b50 -r edd04ce99891 scripts/deprecated/fmod.m --- a/scripts/deprecated/fmod.m Tue Oct 11 08:56:03 2016 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -## Copyright (C) 2014-2016 John W. Eaton -## -## 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 {} {} fmod (@var{x}, @var{y}) -## -## @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 -## using the expression -## -## @example -## x - y .* fix (x ./ y) -## @end example -## -## An error message is printed if the dimensions of the arguments do not -## agree, or if either of the arguments is complex. -## @seealso{rem, mod} -## @end deftypefn - -## Deprecated in version 4.0 - -function retval = fmod (varargin) - - persistent warned = false; - if (! warned) - warned = true; - warning ("Octave:deprecated-function", - "fmod is obsolete and will be removed from a future version of Octave, please use rem instead"); - endif - - retval = rem (varargin{:}); - -endfunction - diff -r c05377052b50 -r edd04ce99891 scripts/deprecated/fnmatch.m --- a/scripts/deprecated/fnmatch.m Tue Oct 11 08:56:03 2016 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -## Copyright (C) 2014-2016 John W. Eaton -## -## 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 {} {} fnmatch (@var{pattern}, @var{string}) -## -## @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 -## the elements of the string array @var{pattern}, using the rules of -## filename pattern matching. For example: -## -## @example -## @group -## fnmatch (\"a*b\", @{\"ab\"; \"axyzb\"; \"xyzab\"@}) -## @result{} [ 1; 1; 0 ] -## @end group -## @end example -## @seealso{glob, regexp} -## @end deftypefn - -## Deprecated in version 4.0 - -function retval = fnmatch (varargin) - - persistent warned = false; - if (! warned) - warned = true; - warning ("Octave:deprecated-function", - "fnmatch is obsolete and will be removed from a future version of Octave, please use glob or regexp instead"); - endif - - retval = __fnmatch__ (varargin{:}); - -endfunction - diff -r c05377052b50 -r edd04ce99891 scripts/deprecated/gmap40.m --- a/scripts/deprecated/gmap40.m Tue Oct 11 08:56:03 2016 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ -## Copyright (C) 2007-2016 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 -## . - -## -*- texinfo -*- -## @deftypefn {} {@var{map} =} gmap40 () -## @deftypefnx {} {@var{map} =} gmap40 (@var{n}) -## -## @code{gmap40} is deprecated and will be removed in Octave version 4.4. -## -## Create color colormap. The colormap consists of red, green, blue, yellow, -## magenta and cyan. -## -## This colormap is specifically designed for users of gnuplot 4.0 where these -## 6 colors are the allowable ones for patch objects. -## -## The argument @var{n} must be a scalar. -## If unspecified, a length of 6 is assumed. Larger values of @var{n} result -## in a repetition of the above colors. -## @seealso{colormap} -## @end deftypefn - -## Deprecated in 4.0 - -function map = gmap40 (n = rows (colormap ())) - - persistent warned = false; - if (! warned) - warned = true; - warning ("Octave:deprecated-function", - "gmap40 is obsolete and will be removed from a future version of Octave"); - endif - - if (nargin > 1) - print_usage (); - elseif (! isscalar (n)) - error ("gmap40: N must be a scalar"); - endif - - if (n > 0) - C = [1, 0, 0; 0, 1, 0; 0, 0, 1; 1, 1, 0; 1, 0, 1; 0, 1, 1]; - map = C(rem (0:(n-1), 6) + 1, :); - else - map = zeros (0, 3); - endif - -endfunction - - -%!demo -%! ## Show the 'gmap40' colormap as an image -%! image (1:6, linspace (0, 1, 6), repmat ((1:6)', 1, 6)); -%! axis ([1, 6, 0, 1], "ticy", "xy"); -%! colormap (gmap40 (6)); - diff -r c05377052b50 -r edd04ce99891 scripts/deprecated/loadaudio.m --- a/scripts/deprecated/loadaudio.m Tue Oct 11 08:56:03 2016 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,93 +0,0 @@ -## Copyright (C) 1995-2016 John W. Eaton -## -## 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 {} {} loadaudio (@var{name}, @var{ext}, @var{bps}) -## -## @code{loadaudio} is deprecated and will be removed in Octave version 4.4. -## Please use @code{audioread} in all new code. -## -## Load audio data from the file @file{@var{name}.@var{ext}} into the -## vector @var{x}. -## -## The extension @var{ext} determines how the data in the audio file is -## interpreted; the extensions @file{lin} (default) and @file{raw} -## correspond to linear, the extensions @file{au}, @file{mu}, or @file{snd} -## to mu-law encoding. -## -## The argument @var{bps} can be either 8 (default) or 16, and specifies -## the number of bits per sample used in the audio file. -## @seealso{lin2mu, mu2lin, saveaudio, playaudio, setaudio, record} -## @end deftypefn - - -## Author: AW -## Created: 10 April 1994 -## Adapted-By: jwe - -function X = loadaudio (name, ext, bps) - - persistent warned = false; - if (! warned) - warned = true; - warning ("Octave:deprecated-function", - "loadaudio is obsolete and will be removed from a future version of Octave, please use audioread instead"); - endif - - if (nargin == 0 || nargin > 3) - print_usage (); - endif - - if (nargin == 1) - ext = "lin"; - endif - - if (nargin < 3) - bps = 8; - elseif (bps != 8 && bps != 16) - error ("loadaudio: BPS must be either 8 or 16"); - endif - - name = [name, ".", ext]; - num = fopen (name, "rb"); - - if (strcmp (ext, "lin") || strcmp (ext, "raw") || strcmp (ext, "pcm")) - if (bps == 8) - [Y, c] = fread (num, inf, "uchar"); - X = Y - 127; - else - [X, c] = fread (num, inf, "short"); - endif - elseif (strcmp (ext, "mu") || strcmp (ext, "au") - || strcmp (ext, "snd") || strcmp (ext, "ul")) - [Y, c] = fread (num, inf, "uchar"); - ## remove file header - m = find (Y(1:64) == 0, 1, "last"); - if (! isempty (m)) - Y(1:m) = []; - endif - X = mu2lin (Y, bps); - else - fclose (num); - error ("loadaudio: unsupported extension"); - endif - - fclose (num); - -endfunction - diff -r c05377052b50 -r edd04ce99891 scripts/deprecated/luinc.m --- a/scripts/deprecated/luinc.m Tue Oct 11 08:56:03 2016 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,111 +0,0 @@ -## Copyright (C) 2014-2016 John W. Eaton -## -## 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 {} {[@var{L}, @var{U}, @var{P}, @var{Q}] =} luinc (@var{A}, '0') -## @deftypefnx {} {[@var{L}, @var{U}, @var{P}, @var{Q}] =} luinc (@var{A}, @var{droptol}) -## @deftypefnx {} {[@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.4. -## Please use @code{ilu} or @code{ichol} in all new code. -## -## Produce the incomplete LU@tie{}factorization of the sparse matrix @var{A}. -## Two types of incomplete factorization are possible, and the type -## is determined by the second argument to @code{luinc}. -## -## Called with a second argument of @qcode{'0'}, the zero-level incomplete -## LU@tie{}factorization is produced. This creates a factorization of @var{A} -## where the position of the nonzero arguments correspond to the same -## positions as in the matrix @var{A}. -## -## Alternatively, the fill-in of the incomplete LU@tie{}factorization can -## be controlled through the variable @var{droptol} or the structure -## @var{opts}. The @sc{umfpack} multifrontal factorization code by Tim A. -## Davis is used for the incomplete LU@tie{}factorization, (availability -## @url{http://www.cise.ufl.edu/research/sparse/umfpack/}) -## -## @var{droptol} determines the values below which the values in the -## LU@tie{} factorization are dropped and replaced by zero. It must be a -## positive scalar, and any values in the factorization whose absolute value -## are less than this value are dropped, expect if leaving them increase the -## sparsity of the matrix. Setting @var{droptol} to zero results in a complete -## LU@tie{}factorization which is the default. -## -## @var{opts} is a structure containing one or more of the fields -## -## @table @code -## @item droptol -## The drop tolerance as above. If @var{opts} only contains @code{droptol} -## then this is equivalent to using the variable @var{droptol}. -## -## @item milu -## A logical variable flagging whether to use the modified incomplete -## LU@tie{} factorization. In the case that @code{milu} is true, the dropped -## values are subtracted from the diagonal of the matrix @var{U} of the -## factorization. The default is @code{false}. -## -## @item udiag -## A logical variable that flags whether zero elements on the diagonal of -## @var{U} should be replaced with @var{droptol} to attempt to avoid singular -## factors. The default is @code{false}. -## -## @item thresh -## Defines the pivot threshold in the interval [0,1]. Values outside that -## range are ignored. -## @end table -## -## All other fields in @var{opts} are ignored. The outputs from @code{luinc} -## are the same as for @code{lu}. -## -## Given the string argument @qcode{"vector"}, @code{luinc} returns the -## values of @var{p} @var{q} as vector values. -## @seealso{ilu, ichol, lu, sparse} -## @end deftypefn - -## Deprecated in version 4.0 - -function [L, U, P, Q] = luinc (varargin) - - persistent warned = false; - if (! warned) - warned = true; - warning ("Octave:deprecated-function", - "luinc is obsolete and will be removed from a future version of Octave, please use ilu or ichol instead"); - endif - - [L, U, P, Q] = __luinc__ (varargin{:}); - -endfunction - - -%!testif HAVE_UMFPACK -%! a = sparse ([1,2,0,0;0,1,2,0;1e-14,0,3,0;0,0,0,1]); -%! [l,u] = luinc (a, 1e-10); -%! assert (l*u, sparse ([1,2,0,0;0,1,2,0;0,0,3,0;0,0,0,1]), 1e-10); -%! opts.droptol = 1e-10; -%! [l,u] = luinc (a, opts); -%! assert (l*u, sparse ([1,2,0,0;0,1,2,0;0,0,3,0;0,0,0,1]), 1e-10); - -%!testif HAVE_UMFPACK -%! a = sparse ([1i,2,0,0;0,1,2,0;1e-14,0,3,0;0,0,0,1]); -%! [l,u] = luinc (a, 1e-10); -%! assert (l*u, sparse ([1i,2,0,0;0,1,2,0;0,0,3,0;0,0,0,1]), 1e-10); -%! opts.droptol = 1e-10; -%! [l,u] = luinc (a, opts); -%! assert (l*u, sparse ([1i,2,0,0;0,1,2,0;0,0,3,0;0,0,0,1]), 1e-10); - diff -r c05377052b50 -r edd04ce99891 scripts/deprecated/module.mk --- a/scripts/deprecated/module.mk Tue Oct 11 08:56:03 2016 -0700 +++ b/scripts/deprecated/module.mk Tue Oct 11 09:49:21 2016 -0700 @@ -1,34 +1,16 @@ FCN_FILE_DIRS += scripts/deprecated scripts_deprecated_FCN_FILES = \ - scripts/deprecated/bicubic.m \ scripts/deprecated/bitmax.m \ scripts/deprecated/comma.m \ - scripts/deprecated/delaunay3.m \ - scripts/deprecated/dump_prefs.m \ - scripts/deprecated/find_dir_in_path.m \ - scripts/deprecated/finite.m \ - scripts/deprecated/fmod.m \ - scripts/deprecated/fnmatch.m \ - scripts/deprecated/gmap40.m \ scripts/deprecated/isstr.m \ - scripts/deprecated/loadaudio.m \ - scripts/deprecated/luinc.m \ scripts/deprecated/mahalanobis.m \ scripts/deprecated/md5sum.m \ - scripts/deprecated/mouse_wheel_zoom.m \ - scripts/deprecated/nfields.m \ scripts/deprecated/octave_config_info.m \ - scripts/deprecated/octave_tmp_file_name.m \ scripts/deprecated/onenormest.m \ scripts/deprecated/paren.m \ - scripts/deprecated/playaudio.m \ - scripts/deprecated/saveaudio.m \ scripts/deprecated/semicolon.m \ - scripts/deprecated/setaudio.m \ scripts/deprecated/sleep.m \ - scripts/deprecated/syl.m \ - scripts/deprecated/usage.m \ scripts/deprecated/usleep.m \ scripts/deprecated/wavread.m \ scripts/deprecated/wavwrite.m diff -r c05377052b50 -r edd04ce99891 scripts/deprecated/mouse_wheel_zoom.m --- a/scripts/deprecated/mouse_wheel_zoom.m Tue Oct 11 08:56:03 2016 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ -## Copyright (C) 2007-2016 Shai Ayal -## -## 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 {} {@var{old_val} =} mouse_wheel_zoom (@var{new_val}) -## Query or set the mouse wheel zoom factor. -## -## The zoom factor is a number in the range (0,1) which is the -## percentage of the current axis limits that will be used when zooming. -## For example, if the current x-axis limits are [0, 50] and -## @code{mouse_wheel_zoom} is 0.4 (40%), then a zoom operation will -## change the limits by 20. -#### @end deftypefn - -## Deprecated in 4.0 - -function retval = mouse_wheel_zoom (val) - - persistent warned = false; - if (! warned) - warned = true; - warning ("Octave:deprecated-function", - "mouse_wheel_zoom is obsolete and will be removed from a future version of Octave, please use the mousehweelzoom axes property instead"); - endif - - if (nargin != 1) - print_usage (); - endif - - fig = get (0, "currentfigure"); - if (isempty (fig)) - retval = get (0, "defaultaxesmousewheelzoom"); - set (0, "defaultaxesmousewheelzoom", val); - else - retval = get (gca, "mousewheelzoom"); - set (gca, "mousewheelzoom", val); - endif - -endfunction - diff -r c05377052b50 -r edd04ce99891 scripts/deprecated/nfields.m --- a/scripts/deprecated/nfields.m Tue Oct 11 08:56:03 2016 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -## Copyright (C) 2014-2016 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 -## . - -## -*- texinfo -*- -## @deftypefn {} {} nfields (@var{s}) -## Return the number of fields of the structure @var{s}. -## -## @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; - if (! warned) - warned = true; - warning ("Octave:deprecated-function", - "nfields is obsolete and will be removed from a future version of Octave; please use numfields instead"); - endif - - if (nargin < 1) - print_usage (); - endif - - retval = numfields (varargin{:}); - -endfunction - diff -r c05377052b50 -r edd04ce99891 scripts/deprecated/octave_tmp_file_name.m --- a/scripts/deprecated/octave_tmp_file_name.m Tue Oct 11 08:56:03 2016 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -## Copyright (C) 2014-2016 John W. Eaton -## -## 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 {} {@var{fname} =} octave_tmp_file_name () -## @deftypefnx {} {@var{fname} =} octave_tmp_file_name (@var{dir}) -## @deftypefnx {} {@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.4. Use @code{tempname} for equivalent functionality. -## -## Return a unique temporary filename as a string. -## -## If @var{prefix} is omitted, a value of @qcode{"oct-"} is used. -## If @var{dir} is also omitted, the default directory for temporary files -## (@code{P_tmpdir} is used. If @var{dir} is provided, it must exist, -## otherwise the default directory for temporary files is used. -## @seealso{tempname, tmpnam, mkstemp, tempdir, P_tmpdir, tmpfile} -## @end deftypefn - -## Deprecated in version 4.0 - -function filename = octave_tmp_file_name (varargin) - - persistent warned = false; - if (! warned) - warned = true; - warning ("Octave:deprecated-function", - "octave_tmp_file_name is obsolete and will be removed from a future version of Octave, please use tempname instead"); - endif - - filename = tmpnam (varargin{:}); - -endfunction - - -%!assert (1) - diff -r c05377052b50 -r edd04ce99891 scripts/deprecated/playaudio.m --- a/scripts/deprecated/playaudio.m Tue Oct 11 08:56:03 2016 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,99 +0,0 @@ -## Copyright (C) 1995-2016 John W. Eaton -## -## 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 {} {} playaudio (@var{name}, @var{ext}) -## @deftypefnx {} {} playaudio (@var{x}) -## -## @code{playaudio} is deprecated and will be removed in Octave version 4.4. -## Please use @code{audioplayer} in all new code. -## -## Play the audio file @file{@var{name}.@var{ext}} or the audio data -## stored in the vector @var{x}. -## @seealso{lin2mu, mu2lin, loadaudio, saveaudio, setaudio, record} -## @end deftypefn - -## Author: AW -## Created: 11 April 1994 -## Adapted-By: jwe - -function playaudio (name, ext) - - persistent warned = false; - if (! warned) - warned = true; - warning ("Octave:deprecated-function", - "playaudio is obsolete and will be removed from a future version of Octave, please use audioplayer instead"); - endif - - if (nargin < 1 || nargin > 2) - print_usage (); - endif - - if (nargin == 1 && isnumeric (name)) - ## play a vector - if (! isvector (name)) - error ("playaudio: X must be a vector"); - endif - X = name(:) + 127; - unwind_protect - file = tempname (); - fid = fopen (file, "wb"); - fwrite (fid, X, "uchar"); - fclose (fid); - [status, out] = system (sprintf ('cat "%s" > /dev/dsp', file)); - if (status != 0) - system (sprintf ("paplay --raw \"%s\"", file)); - endif - unwind_protect_cleanup - unlink (file); - end_unwind_protect - elseif (nargin >= 1 && ischar (name)) - ## play a file - if (nargin == 1) - name = [name ".lin"]; - elseif (nargin == 2) - name = [name "." ext]; - endif - if (any (strcmp (ext, {"lin", "raw"}))) - [status, out] = system (sprintf ('cat "%s" > /dev/dsp', name)); - if (status != 0) - system (sprintf ('paplay --raw "%s"', name)); - endif - elseif (any (strcmp (ext, {"mu", "au" "snd", "ul"}))) - [status, out] = system (sprintf ('cat "%s" > /dev/audio', name)); - if (status != 0) - system (sprintf ('paplay "%s"', name)); - endif - else - error ("playaudio: unsupported extension '%s'", ext); - endif - else - print_usage (); - endif - -endfunction - - -## Test input validation -%!error playaudio () -%!error playaudio (1,2,3) -%!error playaudio (magic (3)) -%!error playaudio ("file", "abc") -%!error playaudio ({"abc"}) - diff -r c05377052b50 -r edd04ce99891 scripts/deprecated/saveaudio.m --- a/scripts/deprecated/saveaudio.m Tue Oct 11 08:56:03 2016 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,100 +0,0 @@ -## Copyright (C) 1995-2016 John W. Eaton -## -## 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 {} {} saveaudio (@var{name}, @var{x}, @var{ext}, @var{bps}) -## -## @code{saveaudio} is deprecated and will be removed in Octave version 4.4. -## Please use @code{audiowrite} in all new code. -## -## Save a vector @var{x} of audio data to the file -## @file{@var{name}.@var{ext}}. The optional parameters @var{ext} and -## @var{bps} determine the encoding and the number of bits per sample used -## in the audio file (see @code{loadaudio}); defaults are @file{lin} and -## 8, respectively. -## @seealso{lin2mu, mu2lin, loadaudio, playaudio, setaudio, record} -## @end deftypefn - -## Author: AW -## Created: 5 September 1994 -## Adapted-By: jwe - -function saveaudio (name, x, ext, bps) - - persistent warned = false; - if (! warned) - warned = true; - warning ("Octave:deprecated-function", - "saveaudio is obsolete and will be removed from a future version of Octave, please use audiowrite instead"); - endif - - if (nargin < 2 || nargin > 4) - print_usage (); - endif - - if (nargin == 2) - ext = "lin"; - endif - - if (nargin < 4) - bps = 8; - elseif (bps != 8 && bps != 16) - error ("saveaudio: BPS must be either 8 or 16"); - endif - - [nr, nc] = size (x); - if (nc != 1) - if (nr == 1) - x = x'; - nr = nc; - else - error ("saveaudio: X must be a vector"); - endif - endif - - num = fopen ([name, ".", ext], "wb"); - - if (strcmp (ext, "lin") || strcmp (ext, "raw")) - if (bps == 8) - ld = max (abs (x)); - if (ld > 127) # convert 16 to 8 bit - if (ld < 16384) - sc = 64 / ld; - else - sc = 1 / 256; - endif - x = fix (x * sc); - endif - x = x + 127; - c = fwrite (num, x, "uchar"); - else - c = fwrite (num, x, "short"); - endif - elseif (strcmp (ext, "mu") || strcmp (ext, "au") - || strcmp (ext, "snd") || strcmp (ext, "ul")) - y = lin2mu (x); - c = fwrite (num, y, "uchar"); - else - fclose (num); - error ("saveaudio: unsupported extension"); - endif - - fclose (num); - -endfunction - diff -r c05377052b50 -r edd04ce99891 scripts/deprecated/setaudio.m --- a/scripts/deprecated/setaudio.m Tue Oct 11 08:56:03 2016 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ -## Copyright (C) 1995-2016 John W. Eaton -## -## 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 {} {} setaudio () -## @deftypefnx {} {} setaudio (@var{w_type}) -## @deftypefnx {} {} setaudio (@var{w_type}, @var{value}) -## -## @code{setaudio} is deprecated and will be removed in Octave version 4.4. -## Please scale the audio signal in all new code or use the operating system's -## native tools to adjust audio input and output levels. -## -## Execute the shell command @samp{mixer}, possibly with optional -## arguments @var{w_type} and @var{value}. -## @end deftypefn - -## Author: AW -## Created: 5 October 1994 -## Adapted-By: jwe - -function setaudio (w_type, value) - - persistent warned = false; - if (! warned) - warned = true; - warning ("Octave:deprecated-function", - "setaudio is obsolete and will be removed from a future version of Octave, please scale the audio signal instead"); - endif - - if (nargin == 0) - system ("mixer"); - elseif (nargin == 1) - system (sprintf ("mixer %s", w_type)); - elseif (nargin == 2) - system (sprintf ("mixer %s %d", w_type, value)); - else - print_usage (); - endif - -endfunction - diff -r c05377052b50 -r edd04ce99891 scripts/deprecated/syl.m --- a/scripts/deprecated/syl.m Tue Oct 11 08:56:03 2016 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,66 +0,0 @@ -## Copyright (C) 2014-2016 John W. Eaton -## -## 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 {} {@var{x} =} syl (@var{A}, @var{B}, @var{C}) -## -## @code{syl} is deprecated and will be removed in Octave version 4.4. -## Use @code{sylvester} for the equivalent functionality. -## -## Solve the Sylvester equation -## @tex -## $$ -## A X + X B + C = 0 -## $$ -## @end tex -## @ifnottex -## -## @example -## A X + X B + C = 0 -## @end example -## -## @end ifnottex -## using standard @sc{lapack} subroutines. For example: -## -## @example -## @group -## syl ([1, 2; 3, 4], [5, 6; 7, 8], [9, 10; 11, 12]) -## @result{} [ -0.50000, -0.66667; -0.66667, -0.50000 ] -## @end group -## @end example -## @end deftypefn - -## Deprecated in version 4.0 - -function x = syl (A, B, C) - - persistent warned = false; - if (! warned) - warned = true; - warning ("Octave:deprecated-function", - "syl is obsolete and will be removed from a future version of Octave, please use sylvester instead"); - endif - - if (nargin != 3 || nargout > 1) - print_usage (); - endif - - x = -sylvester (A, B, C); - -endfunction - diff -r c05377052b50 -r edd04ce99891 scripts/deprecated/usage.m --- a/scripts/deprecated/usage.m Tue Oct 11 08:56:03 2016 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,66 +0,0 @@ -## Copyright (C) 2014-2016 John W. Eaton -## -## 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 {} {} usage (@var{msg}) -## -## @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 -## set Octave's internal error state such that control will return to the -## top level without evaluating any more commands. This is useful for -## aborting from functions. -## -## After @code{usage} is evaluated, Octave will print a traceback of all -## the function calls leading to the usage message. -## -## You should use this function for reporting problems errors that result -## from an improper call to a function, such as calling a function with an -## incorrect number of arguments, or with arguments of the wrong type. For -## example, most functions distributed with Octave begin with code like -## this -## -## @example -## @group -## if (nargin != 2) -## usage (\"foo (a, b)\"); -## endif -## @end group -## @end example -## -## @noindent -## to check for the proper number of arguments. -## @seealso{print_usage} -## @end deftypefn - -## Deprecated in version 4.0 - -function retval = usage (varargin) - - persistent warned = false; - if (! warned) - warned = true; - warning ("Octave:deprecated-function", - "usage is obsolete and will be removed from a future version of Octave, please use print_usage instead"); - endif - - retval = __usage__ (varargin{:}); - -endfunction - diff -r c05377052b50 -r edd04ce99891 test/error.tst --- a/test/error.tst Tue Oct 11 08:56:03 2016 -0700 +++ b/test/error.tst Tue Oct 11 09:49:21 2016 -0700 @@ -89,25 +89,3 @@ %! w = warning; %! assert (w, w0); -## Test usage() function - -%!function g () -%! usage ("foo"); -%!endfunction -%!function f () -%! g (); -%!endfunction -%!error f () - -%!function g () -%! usage ("foo"); -%!endfunction -%!function f () -%! g -%!endfunction -%!error f () - -%!error usage () - -%!error usage ("foo\n") -