# HG changeset patch # User John W. Eaton # Date 1714153159 14400 # Node ID b295be7a77ca4e4c7c58aca8e3ab78c176874626 # Parent 583637c89c117eec2e108735b1c70044e3a2ce41# Parent c51b07a7142129e7b8155af81adcb553cbf0c15b maint: merge default to bytecode-interpreter diff -r 583637c89c11 -r b295be7a77ca autogen.sh --- a/autogen.sh Thu Apr 25 11:55:05 2024 -0400 +++ b/autogen.sh Fri Apr 26 13:39:19 2024 -0400 @@ -4,7 +4,7 @@ # also regenerates all aclocal.m4, config.h.in, Makefile.in, configure files # with new versions of autoconf or automake. -# Copyright (C) 2003-2023 Free Software Foundation, Inc. +# Copyright (C) 2003-2024 Free Software Foundation, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -r 583637c89c11 -r b295be7a77ca autopull.sh --- a/autopull.sh Thu Apr 25 11:55:05 2024 -0400 +++ b/autopull.sh Fri Apr 26 13:39:19 2024 -0400 @@ -2,7 +2,7 @@ # Convenience script for fetching auxiliary files that are omitted from # the version control repository of this package. -# Copyright (C) 2003-2023 Free Software Foundation, Inc. +# Copyright (C) 2003-2024 Free Software Foundation, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -r 583637c89c11 -r b295be7a77ca bootstrap --- a/bootstrap Thu Apr 25 11:55:05 2024 -0400 +++ b/bootstrap Fri Apr 26 13:39:19 2024 -0400 @@ -1,9 +1,9 @@ #! /bin/sh # Bootstrap this package from checked-out sources. -scriptversion=2023-08-29.21; # UTC +scriptversion=2024-04-13.15; # UTC -# Copyright (C) 2003-2023 Free Software Foundation, Inc. +# Copyright (C) 2003-2024 Free Software Foundation, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -43,44 +43,55 @@ GNULIB_SRCDIR Specifies the local directory where gnulib sources reside. Use this if you already have gnulib sources on your machine, and - do not want to waste your bandwidth downloading - them again. - GNULIB_URL URL of the gnulib repository. The default is - $default_gnulib_url, - which is Gnulib's upstream repository. - -Options: - - --pull Do phase 1: pull files from network - --gen Do phase 2: generate from local files. - (The default is to do both phases.) - - --gnulib-srcdir=DIRNAME specify the local directory where gnulib - sources reside. Use this if you already - have gnulib sources on your machine, and - you want to use these sources. Defaults - to \$GNULIB_SRCDIR - --gnulib-refdir=DIRNAME specify the local directory where a gnulib + you want to use these sources. + GNULIB_REFDIR Specifies the local directory where a gnulib repository (with a .git subdirectory) resides. Use this if you already have gnulib sources and history on your machine, and do not want to waste your bandwidth downloading them again. - Defaults to \$GNULIB_REFDIR + Only used for phase 1 (--pull). + GNULIB_URL URL of the gnulib repository. The default is + $default_gnulib_url, + which is Gnulib's upstream repository. + Only used for phase 1 (--pull). + +Options: + + --pull Do phase 1: Pull files from the network. + --gen Do phase 2: Generate files from local files + (no network access). + (The default is to do both phases.) - --bootstrap-sync if this bootstrap script is not identical to + --gnulib-srcdir=DIRNAME Specifies the local directory where gnulib + sources reside. Use this if you already + have gnulib sources on your machine, and + you want to use these sources. Defaults + to \$GNULIB_SRCDIR. + --gnulib-refdir=DIRNAME Specifies the local directory where a gnulib + repository (with a .git subdirectory) resides. + Use this if you already have gnulib sources + and history on your machine, and do not want + to waste your bandwidth downloading them again. + Defaults to \$GNULIB_REFDIR. + Only used for phase 1 (--pull). + + --bootstrap-sync If this bootstrap script is not identical to the version in the local gnulib sources, update this script, and then restart it with - /bin/sh or the shell \$CONFIG_SHELL - --no-bootstrap-sync do not check whether bootstrap is out of sync + /bin/sh or the shell \$CONFIG_SHELL. + --no-bootstrap-sync Do not check whether bootstrap is out of sync. - --copy copy files instead of creating symbolic links - --force attempt to bootstrap even if the sources seem - not to have been checked out - --no-git do not use git to update gnulib. Requires that + --copy Copy files instead of creating symbolic links. + Only used for phase 2 (--gen). + --force Attempt to bootstrap even if the sources seem + not to have been checked out. + --no-git Do not use git to update gnulib. Requires that \$GNULIB_SRCDIR or the --gnulib-srcdir option points to a gnulib repository with the correct - revision - --skip-po do not download po files + revision. + Only used for phase 1 (--pull). + --skip-po Do not download *.po files. + Only used for phase 1 (--pull). EOF bootstrap_print_option_usage_hook cat < /dev/null; then + : + else + die "git version is too old, git >= 1.6.4 is required" + fi gnulib_path=$(git_modules_config submodule.gnulib.path) - test -z "$gnulib_path" && gnulib_path=gnulib - - # Get gnulib files. Populate $gnulib_path, possibly updating a - # submodule, for use in the rest of the script. - - if test -n "$GNULIB_REFDIR" && test -d "$GNULIB_REFDIR"/.git \ - && git_modules_config submodule.gnulib.url >/dev/null; then - # Use GNULIB_REFDIR as a reference. - echo "$0: getting gnulib files..." - if git submodule -h|grep -- --reference > /dev/null; then - # Prefer the one-liner available in git 1.6.4 or newer. - git submodule update --init --reference "$GNULIB_REFDIR" \ - "$gnulib_path" || exit $? + if test -n "$gnulib_path"; then + # A submodule 'gnulib' is configured. + # Get gnulib files. Populate $gnulib_path, updating the submodule. + if test -n "$GNULIB_REFDIR" && test -d "$GNULIB_REFDIR"/.git; then + # Use GNULIB_REFDIR as a reference. + echo "$0: getting gnulib files..." + git submodule update --init --reference "$GNULIB_REFDIR" "$gnulib_path" \ + || exit $? else - # This fallback allows at least git 1.5.5. - if test -f "$gnulib_path"/gnulib-tool; then - # Since file already exists, assume submodule init already complete. + # GNULIB_REFDIR is not set or not usable. Ignore it. + if git_modules_config submodule.gnulib.url >/dev/null; then + echo "$0: getting gnulib files..." + git submodule init -- "$gnulib_path" || exit $? git submodule update -- "$gnulib_path" || exit $? else - # Older git can't clone into an empty directory. - rmdir "$gnulib_path" 2>/dev/null - git clone --reference "$GNULIB_REFDIR" \ - "$(git_modules_config submodule.gnulib.url)" "$gnulib_path" \ - && git submodule init -- "$gnulib_path" \ - && git submodule update -- "$gnulib_path" \ - || exit $? + die "Error: submodule 'gnulib' has no configured url" fi fi else - # GNULIB_REFDIR is not set or not usable. Ignore it. - if git_modules_config submodule.gnulib.url >/dev/null; then + gnulib_path='gnulib' + if test ! -d "$gnulib_path"; then + # The subdirectory 'gnulib' does not yet exist. Clone into it. echo "$0: getting gnulib files..." - git submodule init -- "$gnulib_path" || exit $? - git submodule update -- "$gnulib_path" || exit $? - - elif [ ! -d "$gnulib_path" ]; then - echo "$0: getting gnulib files..." - trap cleanup_gnulib HUP INT PIPE TERM - shallow= if test -z "$GNULIB_REVISION"; then if git clone -h 2>&1 | grep -- --depth > /dev/null; then @@ -525,39 +520,32 @@ # is without fetching all commits. So fall back to fetching all # commits. git -C "$gnulib_path" init - git -C "$gnulib_path" remote add origin \ - ${GNULIB_URL:-$default_gnulib_url} + git -C "$gnulib_path" remote add origin ${GNULIB_URL:-$default_gnulib_url} git -C "$gnulib_path" fetch $shallow origin "$GNULIB_REVISION" \ || git -C "$gnulib_path" fetch origin \ || cleanup_gnulib git -C "$gnulib_path" reset --hard FETCH_HEAD + (cd "$gnulib_path" && git checkout "$GNULIB_REVISION") || cleanup_gnulib fi - trap - HUP INT PIPE TERM - - elif test -n "$GNULIB_REVISION" \ - && ! git --git-dir="$gnulib_path"/.git cat-file \ - commit "$GNULIB_REVISION"; then - git --git-dir="$gnulib_path"/.git fetch + else + # The subdirectory 'gnulib' already exists. + if test -n "$GNULIB_REVISION"; then + if test -d "$gnulib_path/.git"; then + (cd "$gnulib_path" && git checkout "$GNULIB_REVISION") || exit 1 + else + die "Error: GNULIB_REVISION is specified in bootstrap.conf," \ + "but '$gnulib_path' contains no git history" + fi + fi fi fi - GNULIB_SRCDIR=$gnulib_path - # Verify that the submodule contains a gnulib checkout. + # Verify that $gnulib_path contains a gnulib checkout. test -f "$gnulib_path/gnulib-tool" \ - || die "Error: $gnulib_path is supposed to contain a gnulib checkout," \ + || die "Error: '$gnulib_path' is supposed to contain a gnulib checkout," \ "but does not contain gnulib-tool" + GNULIB_SRCDIR=$gnulib_path fi - - # XXX Should this be done if $use_git is false? - if test -d "$GNULIB_SRCDIR"/.git && test -n "$GNULIB_REVISION" \ - && ! git_modules_config submodule.gnulib.url >/dev/null; then - if ! git --git-dir="$GNULIB_SRCDIR"/.git cat-file \ - commit "$GNULIB_REVISION"; then - git --git-dir="$GNULIB_SRCDIR"/.git fetch - fi - (cd "$GNULIB_SRCDIR" && git checkout "$GNULIB_REVISION") || cleanup_gnulib - fi - # $GNULIB_SRCDIR now points to the version of gnulib to use, and # we no longer need to use git or $gnulib_path below here. } @@ -619,7 +607,8 @@ autopull_usage() { cat </dev/null; then -+ if ! git --git-dir="$GNULIB_SRCDIR"/.git cat-file \ -+ commit "$GNULIB_REVISION"; then -+ git --git-dir="$GNULIB_SRCDIR"/.git fetch -+ fi - (cd "$GNULIB_SRCDIR" && git checkout "$GNULIB_REVISION") || cleanup_gnulib - fi - diff -r 583637c89c11 -r b295be7a77ca etc/NEWS.10.md --- a/etc/NEWS.10.md Thu Apr 25 11:55:05 2024 -0400 +++ b/etc/NEWS.10.md Fri Apr 26 13:39:19 2024 -0400 @@ -23,29 +23,28 @@ inputs. - `jsonencode` now outputs integers and floating point integers without ".0" - suffix. - +suffix. + - `hist` now accepts N-dimensional array inputs for input `Y` which is - processed in columns as if the array was flattened to a 2-dimensional - array. +processed in columns as if the array was flattened to a 2-dimensional array. ### Graphical User Interface ### Graphics backend - `polar` plots now include the center tick mark value, typically 0, in -the 'rtick' parameter when the plot is created. Subsequent modifications -to 'rtick' by the function `rticks` will only include the center tick mark +the `'rtick'` parameter when the plot is created. Subsequent modifications +to `'rtick'` by the function `rticks` will only include the center tick mark value if it is specified. -- `view` correctly interprets cartesion viewpoints on main axes. (bug #65641) +- `view` correctly interprets cartesian viewpoints on main axes (bug #65641). ### Matlab compatibility - `height` and `width` are now aliases for the `rows` and `columns` functions. - All colormaps now default to a size of 256 colors. (The previous default -size was 64. +size was 64.) - `griddata` output size more consistently matches the input interpolation points when they are input as vectors. When they are same-orientation vectors, @@ -58,7 +57,7 @@ - `iqr` now provides compatible output for empty inputs. - `cross` now produces row vector outputs when the inputs are a mix of row -and column vectors. (bug #61295) +and column vectors (bug #61295). - `rat` now accepts complex inputs. @@ -116,17 +115,16 @@ sparse_auto_mutate | none (see below) - `fminsearch` parameter passing: A legacy, undocumented, and only partially - supported syntax for passing parameters to the minimized function `fcn` - called by `fminsearch` by appending them to the input argument list has - functioned intermittently since Octave 4.4.0. Due to conflicts with other - compatibility-required input methods the documentation of this syntax was - removed in Octave 5.1.0, and the remaining functionality has been completely - removed in Octave 10, and attempts to call `fminsearch` with that syntax - will result in an error. The preferred, cross-platform compatible method of - passing parameters to any of the minimization functions (including - `fminsearch`, `fminbnd`, and `fminunc`) is through the use of Anonymous - Functions. Specific examples of this can be found in the @ref{Minimizers} - section of the GNU Octave manual. +supported syntax for passing parameters to the minimized function `fcn` called +by `fminsearch` by appending them to the input argument list was partly +implemented since Octave 4.4.0. Due to conflicts with other input methods, +the documentation of this syntax was removed in Octave 5.1.0. The remaining +functionality has been completely removed in Octave 10. Attempts to call +`fminsearch` with that syntax will result in an error. The preferred method of +passing parameters to any of the minimization functions (including +`fminsearch`, `fminbnd`, and `fminunc`) is through the use of anonymous +functions. Specific examples of this can be found in the "Minimizers" section +of the Octave manual. ### Build system diff -r 583637c89c11 -r b295be7a77ca libgui/graphics/GLCanvas.cc --- a/libgui/graphics/GLCanvas.cc Thu Apr 25 11:55:05 2024 -0400 +++ b/libgui/graphics/GLCanvas.cc Fri Apr 26 13:39:19 2024 -0400 @@ -43,6 +43,7 @@ { setFocusPolicy (Qt::ClickFocus); setFocus (); + setUpdateBehavior (QOpenGLWidget::PartialUpdate); } GLWidget::~GLWidget () { } diff -r 583637c89c11 -r b295be7a77ca libinterp/corefcn/perms.cc --- a/libinterp/corefcn/perms.cc Thu Apr 25 11:55:05 2024 -0400 +++ b/libinterp/corefcn/perms.cc Fri Apr 26 13:39:19 2024 -0400 @@ -50,30 +50,6 @@ // Use C++ template to cater for the different octave array classes. // -// FIXME: To allow comparison between all supported template types, we need -// to use either "if constexpr" (supported in C++17) or template specialisation -// (supported in C++11). Currently (2024), Octave stipulates the usage of -// C++11, so the (slightly more complex) template specialization is used. -// Once Octave moves to C++17 or beyond, the following code snippet is -// preferrable and the comparison templates can be removed: -// bool isequal; -// if constexpr (std::is_same::value) -// isequal = Ar[i].is_equal (Ar[j]); -// else -// isequal = (Ar[i] == Ar[j]); - -template -bool is_equal_T (T a, T b) -{ - return a == b; -} - -template <> -bool is_equal_T (octave_value a, octave_value b) -{ - return a.is_equal (b); -} - template static inline Array GetPerms (const Array& ar_in, bool uniq_v = false) @@ -105,7 +81,13 @@ { for (octave_idx_type j = i + 1; j < m; j++) { - bool isequal = is_equal_T (Ar[i], Ar[j]); + bool isequal; + if constexpr (std::is_same::value) + // operator '==' is not supported for octave_value objects + isequal = Ar[i].is_equal (Ar[j]); + else + isequal = (Ar[i] == Ar[j]); + if (myvidx[j] > myvidx[i] && isequal) { myvidx[j] = myvidx[i]; // not yet processed...