view scripts/deprecated/disable_permutation_matrix.m @ 29982:605275522c37

Deprecate disable_range, disable_diagonal_matrix, disable_permutation_matrix. Replace configuration options with inverted sense (true means functionality is disabled) with ordinary sense options: optimize_range, optimize_diagonal_matrix, optimize_permutation_matrix. * NEWS: Announce deprecation and replacement functions. * basics.txi, diagperm.txi, numbers.txi: Replace instances of functions in Octave manual with their replacements. * interpreter.cc (maximum_braindamage): Change options for --traditional to disable Octave optimizations. * ov-typeinfo.cc (Ftypeinfo): Replace old functions in BIST tests. * ov.cc: Rename variables Vdisable_diagonal_matrix, Vdisable_permutation_matrix, Vdisable_range. Update code for inverted sense of new optimize_XXX variables. * ov.cc (Foptimize_range, Foptimize_diagonal_matrix, Foptimize_permutation_matrix): New replacement functions. * diag-perm.tst, mk-conv-tst.sh: Replace instances of disable_range with optimize_range in BIST tests. * scripts/deprecated/module.mk: Add disable_diagonal_matrix.m, disable_permutation_matrix.m, disable_range.m to build system. * scripts/deprecated/disable_diagonal_matrix.m, scripts/deprecated/disable_permutation_matrix.m, scripts/deprecated/disable_range.m: New m-functions to issue a warning before calling replacement optimize_XXX function.
author Rik <rik@octave.org>
date Tue, 17 Aug 2021 14:34:42 -0700
parents
children 01de0045b2e3
line wrap: on
line source

########################################################################
##
## Copyright (C) 2021 The Octave Project Developers
##
## See the file COPYRIGHT.md in the top-level directory of this
## distribution or <https://octave.org/copyright/>.
##
## 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
## <https://www.gnu.org/licenses/>.
##
########################################################################

## -*- texinfo -*-
## @deftypefn  {} {@var{val} =} disable_permutation_matrix ()
## @deftypefnx {} {@var{old_val} =} disable_permutation_matrix (@var{new_val})
## @deftypefnx {} {} disable_permutation_matrix (@var{new_val}, "local")
## Query or set whether storing permutation matrices in a special
## space-efficient format is disabled.
## 
## The default value is false.  If this option is set to true, Octave will store
## ranges as full matrices.
## 
## When called from inside a function with the @qcode{"local"} option, the setting
## is changed locally for the function and any subroutines it calls.  The original
## setting is restored when exiting the function.
## @seealso{disable_diagonal_matrix, disable_permutation_matrix}
## @end deftypefn

## FIXME: DEPRECATED: Remove in version 9.

function retval = disable_permutation_matrix (varargin)

  persistent warned = false;
  if (! warned)
    warned = true;
    warning ("Octave:deprecated-function",
             "disable_permutation_matrix is obsolete and will be removed from a future version of Octave, please use optimize_permutation_matrix instead\n");
  endif

  if (nargin == 0)
    retval = ! optimize_permutation_matrix ();
  elseif (nargout == 0)
    optimize_permutation_matrix (! varargin{1}, varargin{2:end});
  else
    retval = ! optimize_permutation_matrix (! varargin{1}, varargin{2:end});
  endif

endfunction