view etc/NEWS.9.md @ 32047:e3de59065cf1

inputParser.m: Re-architect internal data structures for 60% speed improvement. Key idea is to replace Parameter and Switch structs with name field containing a nested struct (def, val fields) with a struct array that has fields "name", "def", and "val". This makes it possible to eliminate for loops. * NEWS.9.md: Announce performance improvement. * inputParser.m: Declare "Parameter" and "Switch" properties as struct arrays. Add new private property "last_idx" which caches the last Parameter or Switch lookup. * inputParser.m (addRequired): Adjust input validation to use numel() now rather than numfields(). * inputParser.m (addOptional): Adjust input validation to use numel() now rather than numfields(). * inputParser.m (addParameter): Change code to add new Parameter to a struct array. * inputParser.m (addSwitch): Change code to add new Switch to a struct array. * inputParser.m (parse): Adjust initialization of internal variables ParameterNames and SwitchNames to match new data structure. Use last_idx to simplify call to validate_arg() for Parameters. * inputParser.m (validate_arg): Move creation of error message to code path when error has been found---No need to do it for every function call. Don't capture "exception" variable in try/catch as it is no longer used. * inputParser.m (is_argname): Cache "last_idx" if match was found. * inputParser.m (add_missing): Replace call to setdiff() with in-place code which can take advantage of implicit knowledge to eliminate calls to unique and input validation. Replace for loop with cell2struct/struct2cell combination.
author Rik <rik@octave.org>
date Fri, 21 Apr 2023 11:01:40 -0700
parents 29671873411a
children ada96a467a28
line wrap: on
line source

Summary of important user-visible changes for version 9 (yyyy-mm-dd):
---------------------------------------------------------------------

### General improvements

- `oruntests`: The current directory now changes to the directory
containing the files with the tests for the duration of the test.  This
aligns the behavior of this function with Octave's test suite.  This also
means that the file encoding specified in the `.oct-config` file for the
respective directory is taken into account for the tests.

- `dec2base`, `dec2bin`, and `dec2hex` have all been overhauled.  All three
functions now accommodate negative inputs and fractional inputs, and repeated
code between the functions has been reduced or eliminated.  Previously only
`dec2bin` and `dec2hex` accepted negative inputs but `dec2base` did not, and
none of the three accepted fractional inputs.  But now,
`dec2base (100*pi, 16, 4, 6)` for exampele returns a base-16 string with four
places for the integer part and six places for the fractional part.  Omitting
the number of decimal places (the fourth input) retains old behavior for
backward compatibility, except that non-integer inputs will no longer error.

- `quiver` now honors the scaling factor input when there is only a single
arrow, whereas the factor was previously ignored in that case.

- The `inputParser` function has been re-architected for a 60% performance
improvement.

### Graphical User Interface

### Graphics backend

* The `set` function now accepts any combination of name/value pairs,
cell array of names / cell array of values, or property structures.
This change is Matlab-compatible.

* When the `hold` function is used without arguments to toggle the current
state the resulting value is now displayed in the Command Window for
informational purposes.

### Matlab compatibility

- The `inputParser` function now implements the `PartialMatching` property
for `Parameter` and `Switch` names.  For Matlab compatibility,
`PartialMatching` is now set to true by default which may change the behavior
of existing code.

- Overhauled `mean`, `median`, `var`, and `std` functions have been imported
from statistics package v1.5.4 to compatibly implement 'nanflag' (bug #50571),
'all' (bug #58116), and 'vecdim' (bug #58089) options, preserve output class,
and match expected output behavior for empty (bug #50583) and sparse inputs
(bug #63291).  Both `median` and `mean` can handle large int values without
overflow or precision concerns (bug #54567), and `mean` avoids errors due to
limits of single precision by processing as doubles (bug #63848).  `median`
has also adopted the 'outtype' option from `mean`.

- `mad` function now produces Matlab compatible output using improved `mean`
and `median` functions.  'vecdim' and 'all' options are now supported.  `mad`
ignores all NaN values (using 'omitnan' mean/median option) and produces
expected output behavior for empty inputs.

- `mode` now produces Matlab compatible output for empty inputs (bug #50583).

- `normalize` now produces Matlab compatible output for inputs containing NaN
values (bug #50571).

- `cov` now processes the input form cov(x,y) with two separate data arrays
x and y, as cov(x(:),y(:)) to maintain Matlab compatibility.  It also accepts
a NANFLAG option to allow ignoring NaN entries in input data (bug #50571)
and produces Matlab compatible outputs for empty inputs (bug #50583).  `corr`
and `corrcoef` internal code has been adapted to the new `cov` behavior with
no change to user interface.  Packages using the octave core's `cov` that rely
on the previous calling form may need to make similar adaptations.  Calls for
cov(x) with a vector x expecting a scalar return can get the previous results
from `cov(x)(2)`, and calls to cov(x,y) with x and y matrices expecting
columnwise covariance calculation can obtain the previous results using
`cov([x,y])(1:nx, nx+1:end)`, where nx = columns(x).

- `qz` now handles input and output arguments in a Matlab compatible
way. It always computes the complex QZ decomposition if there are only
two input arguments, and it accepts an optional third input argument
'real' or 'complex' to select the type of decomposition. The output
arguments are always in the same order independently of the input
arguments, and the generalized eigenvalues are no longer returned (one
can use the `ordeig` function for that purpose). The optional reordering
of the generalized eigenvalues has been removed (one can use the `ordqz`
function for that purpose).

### Alphabetical list of new functions added in Octave 9

* `isuniform`
* `tensorprod`

### Deprecated functions, properties, and operators

The following functions and properties have been deprecated in Octave 9
and will be removed from Octave 11 (or whatever version is the second
major release after 9):

- Functions

        Function               | Replacement
        -----------------------|------------------

- Properties

  The following property names are discouraged, but there is no fixed
  date for their removal.

        Object           | Property    | Replacement
        -----------------|-------------|------------

- Core

    * The `idx_vector::bool()` function is obsolete and always returns true.
Any uses can simply be removed from existing code with no loss of function.

    * The `all_ok(const Array<octave::idx_vector>&)` function in `Array-util.h`
is obsolete and always returns true.  Any uses can simply be removed from
existing code with no loss of function.

    * The member variable `octave_base_value::count` is deprecated and will be removed from Octave 11.  Replace all instances with the new name `m_count`.

The following features were deprecated in Octave 7 and have been removed
from Octave 9.

- Functions

        Function                   | Replacement
        ---------------------------|------------------
        disable_diagonal_matrix    | optimize_diagonal_matrix
        disable_permutation_matrix | optimize_permutation_matrix
        disable_range              | optimize_range

- Operators

        Operator | Replacement
        ---------|------------
        .+       | +
        .+=      | +=
        .-       | -
        .-=      | -=
        **       | ^
        **=      | ^=
        .**      | .^
        .**=     | .^=

- Interpreter

    * The use of `'...'` for line continuations *inside* double-quoted
    strings has been removed.  Use `'\'` for line continuations inside strings
    instead.

    * The use of `'\'` as a line continuation *outside* of double-quoted
    strings has been removed.  Use `'...'` for line continuations instead.

    * Support for trailing whitespace after a `'\'` line continuation has been
    removed.  Delete unnecessary trailing whitespace.

- For plot functions, the use of numbers to select line colors in
  shorthand formats was an undocumented feature that was removed in Octave 9.

- The environment variable used by `mkoctfile` for linker flags is now
  `LDFLAGS` rather than `LFLAGS`.  `LFLAGS` was deprecated in Octave 6
  and has been removed.

Summary of bugs fixed for version 9.1.0 (yyyy-mm-dd):
----------------------------------------------------

- Bugfixes to `whos -file`, `urlread`, `mat2cell`, `set`.

- Memory usage reduced for `movfun` by eliminating temporary copies.

- Memory usage reduced when saving to file, preventing OOM and data loss.

- Several race conditions removed in signal handler.

- Performance improvements: avoid unnecessary string construction, use
  static casts instead of dynamic casts where possible.

### Old release news

- [Octave 8.x](etc/NEWS.8)
- [Octave 7.x](etc/NEWS.7)
- [Octave 6.x](etc/NEWS.6)
- [Octave 5.x](etc/NEWS.5)
- [Octave 4.x](etc/NEWS.4)
- [Octave 3.x](etc/NEWS.3)
- [Octave 2.x](etc/NEWS.2)
- [Octave 1.x](etc/NEWS.1)