# HG changeset patch # User John W. Eaton # Date 1646332630 18000 # Node ID 4392386b5ecba62b34054838c8b6e86f3c9ddb7c # Parent 131c5045fbd3fa42a011de37eace95e890f7815a# Parent 103efb7e16004273b642939c4f923f1223dcecdc maint: Merge stable to default. diff -r 103efb7e1600 -r 4392386b5ecb .github/workflows/make.yaml --- a/.github/workflows/make.yaml Thu Mar 03 13:31:24 2022 -0500 +++ b/.github/workflows/make.yaml Thu Mar 03 13:37:10 2022 -0500 @@ -76,7 +76,7 @@ key: ccache:${{ matrix.os }}:${{ matrix.compiler }}:${{ github.ref }}:${{ steps.ccache_cache_timestamp.outputs.timestamp }}:${{ github.sha }} restore-keys: | ccache:${{ matrix.os }}:${{ matrix.compiler }}:${{ github.ref }} - ccache:${{ matrix.os }}:${{ matrix.compiler }}:refs/heads/stable + ccache:${{ matrix.os }}:${{ matrix.compiler }}:refs/heads/default - name: configure ccache env: @@ -215,7 +215,7 @@ key: ccache:${{ matrix.os }}:${{ matrix.compiler }}:${{ github.ref }}:${{ steps.ccache_cache_timestamp.outputs.timestamp }}:${{ github.sha }} restore-keys: | ccache:${{ matrix.os }}:${{ matrix.compiler }}:${{ github.ref }} - ccache:${{ matrix.os }}:${{ matrix.compiler }}:refs/heads/stable + ccache:${{ matrix.os }}:${{ matrix.compiler }}:refs/heads/default - name: configure ccache # The cache doesn't seem to compress well on macOS. Is it already compressed? @@ -439,7 +439,7 @@ key: ccache:${{ matrix.os }}:${{ matrix.compiler }}:${{ matrix.target }}:${{ github.ref }}:${{ steps.ccache_cache_timestamp.outputs.timestamp }}:${{ github.sha }} restore-keys: | ccache:${{ matrix.os }}:${{ matrix.compiler }}:${{ matrix.target }}:${{ github.ref }} - ccache:${{ matrix.os }}:${{ matrix.compiler }}:${{ matrix.target }}:refs/heads/stable + ccache:${{ matrix.os }}:${{ matrix.compiler }}:${{ matrix.target }}:refs/heads/default - name: configure ccache # Limit the maximum size and switch on compression to avoid exceeding the total disk or cache quota. diff -r 103efb7e1600 -r 4392386b5ecb Makefile.am --- a/Makefile.am Thu Mar 03 13:31:24 2022 -0500 +++ b/Makefile.am Thu Mar 03 13:37:10 2022 -0500 @@ -233,7 +233,7 @@ # See bug #45578. BUILT_SOURCES += libgnu/libgnu.la -libgnu/libgnu.la: oct-conf-post.h +libgnu/libgnu.la: oct-conf-post-private.h oct-conf-post-public.h cd libgnu && $(MAKE) $(AM_MAKEFLAGS) all include liboctave/module.mk @@ -298,7 +298,8 @@ endif BUILT_SOURCES += \ - oct-conf-post.h \ + oct-conf-post-private.h \ + oct-conf-post-public.h \ octave-config.h \ run-octave \ $(DIRSTAMP_FILES) @@ -330,6 +331,7 @@ CONFIG_FILES = @ac_config_headers@ @ac_config_files@ nodist_octinclude_HEADERS += \ + oct-conf-post-public.h \ octave-config.h OCTAVE_INTERPRETER_TARGETS += \ diff -r 103efb7e1600 -r 4392386b5ecb bootstrap.conf --- a/bootstrap.conf Thu Mar 03 13:31:24 2022 -0500 +++ b/bootstrap.conf Thu Mar 03 13:37:10 2022 -0500 @@ -90,6 +90,7 @@ stat stddef stdio + strcase strdup-posix strerror strptime diff -r 103efb7e1600 -r 4392386b5ecb build-aux/mk-octave-config-h.sh --- a/build-aux/mk-octave-config-h.sh Thu Mar 03 13:31:24 2022 -0500 +++ b/build-aux/mk-octave-config-h.sh Thu Mar 03 13:37:10 2022 -0500 @@ -100,208 +100,22 @@ #define octave_octave_config_h 1 #if ! defined (OCTAVE_AUTOCONFIG_H_INCLUDED) - -# if defined (__cplusplus) -# include -# else -# include -# endif - -# define OCTAVE_NAMESPACE_BEGIN namespace octave { -# define OCTAVE_NAMESPACE_END } - -# if defined (__GNUC__) -# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) -# define OCTAVE_DEPRECATED(ver, msg) __attribute__ ((__deprecated__ ("[" #ver "]: " msg))) -# else -# define OCTAVE_DEPRECATED(ver, msg) __attribute__ ((__deprecated__)) -# endif -# define OCTAVE_NORETURN __attribute__ ((__noreturn__)) -# define OCTAVE_UNUSED __attribute__ ((__unused__)) - -# define HAVE_OCTAVE_DEPRECATED_ATTR 1 -# define HAVE_OCTAVE_NORETURN_ATTR 1 -# define HAVE_OCTAVE_UNUSED_ATTR 1 -# else -# define OCTAVE_DEPRECATED(ver, msg) -# define OCTAVE_NORETURN -# define OCTAVE_UNUSED - -/* # undef HAVE_OCTAVE_DEPRECATED_ATTR */ -/* # undef HAVE_OCTAVE_NORETURN_ATTR */ -/* # undef HAVE_OCTAVE_UNUSED_ATTR */ -# endif - -# if defined (__MINGW32__) - /* MinGW requires special handling due to different format specifiers - * on different platforms. The macro __MINGW_PRINTF_FORMAT maps to - * either gnu_printf or ms_printf depending on where we are compiling - * to avoid warnings on format specifiers that are legal. - * See: https://bugzilla.mozilla.org/show_bug.cgi?id=1331349 */ -# if defined (__cplusplus) -# include -# else -# include -# endif - -# define OCTAVE_FORMAT_PRINTF(stringIndex, firstToCheck) \ - __attribute__ ((format (__MINGW_PRINTF_FORMAT, stringIndex, firstToCheck))) - -# define HAVE_OCTAVE_FORMAT_PRINTF_ATTR 1 -# elif defined (__GNUC__) - /* The following attributes are used with gcc and clang compilers. */ -# define OCTAVE_FORMAT_PRINTF(index, first) \ - __attribute__ ((__format__(printf, index, first))) - -# define HAVE_OCTAVE_FORMAT_PRINTF_ATTR 1 -# else -# define OCTAVE_FORMAT_PRINTF(index, first) - -/* # undef HAVE_OCTAVE_FORMAT_PRINTF_ATTR */ -# endif - -# if ! defined (OCTAVE_FALLTHROUGH) -# if defined (__cplusplus) && __cplusplus > 201402L -# define OCTAVE_FALLTHROUGH [[fallthrough]] -# elif defined (__GNUC__) && __GNUC__ < 7 -# define OCTAVE_FALLTHROUGH ((void) 0) -# else -# define OCTAVE_FALLTHROUGH __attribute__ ((__fallthrough__)) -# endif -# endif - -# define OCTAVE_PROVIDE_DEPRECATED_SYMBOLS 1 - -# if defined (__cplusplus) -template -static inline void -octave_unused_parameter (const T&) -{ } -# else -# define octave_unused_parameter(param) (void) param; -# endif - -/* Defined to 1 if Octave libraries were built with visibility flags */ EOF -$SED -n 's/#\(\(undef\|define\) OCTAVE_ENABLE_LIB_VISIBILITY_FLAGS.*$\)/# \1/p' $config_h_file - -cat << EOF - -# if defined (OCTAVE_ENABLE_LIB_VISIBILITY_FLAGS) -# if defined (_WIN32) || defined (__CYGWIN__) -# if defined (__GNUC__) - /* GCC */ -# define OCTAVE_EXPORT __attribute__ ((dllexport)) -# define OCTAVE_IMPORT __attribute__ ((dllimport)) -# else - /* MSVC */ -# define OCTAVE_EXPORT __declspec(dllexport) -# define OCTAVE_IMPORT __declspec(dllimport) -# endif -# else - /* All other platforms. */ -# define OCTAVE_EXPORT __attribute__ ((visibility ("default"))) -# define OCTAVE_IMPORT -# endif -# else -# define OCTAVE_EXPORT -# define OCTAVE_IMPORT -# endif - -/* API macro for liboctave */ -#if defined (OCTAVE_DLL) -# define OCTAVE_API OCTAVE_EXPORT -#else -# define OCTAVE_API OCTAVE_IMPORT -#endif - -/* API macro for libinterp */ -#if defined (OCTINTERP_DLL) -# define OCTINTERP_API OCTAVE_EXPORT -#else -# define OCTINTERP_API OCTAVE_IMPORT -#endif - -/* API macro for the Array class in liboctave and liboctinterp */ -#if (defined (OCTAVE_DLL) || defined (OCTINTERP_DLL)) -# define OCTARRAY_API OCTAVE_EXPORT -#else -# define OCTARRAY_API OCTAVE_IMPORT -#endif - -/* API macro for libinterp/graphics */ -#if defined (OCTGRAPHICS_DLL) -# define OCTGRAPHICS_API OCTAVE_EXPORT -#else -# define OCTGRAPHICS_API OCTAVE_IMPORT -#endif - -/* API macro for libgui */ -#if defined (OCTGUI_DLL) -# define OCTGUI_API OCTAVE_EXPORT -#else -# define OCTGUI_API OCTAVE_IMPORT -#endif -EOF - -octave_idx_type="`$SED -n 's/#define OCTAVE_IDX_TYPE \([_a-zA-Z][_a-zA-Z0-9]*\)/\1/p' $config_h_file`" - -if test -z "$octave_idx_type"; then - echo "mk-octave-config-h.sh: failed to find OCTAVE_IDX_TYPE in $config_h_file" 1>&2 - exit 1 -fi - -octave_f77_int_type="`$SED -n 's/#define OCTAVE_F77_INT_TYPE \([_a-zA-Z][_a-zA-Z0-9]*\)/\1/p' $config_h_file`" - -if test -z "$octave_f77_int_type"; then - echo "mk-octave-config-h.sh: failed to find OCTAVE_F77_INT_TYPE in $config_h_file" 1>&2 - exit 1 -fi - -cat << EOF - -typedef $octave_idx_type octave_idx_type; -typedef $octave_f77_int_type octave_f77_int_type; - -# define OCTAVE_HAVE_F77_INT_TYPE 1 - - -# if defined (__cplusplus) && ! defined (OCTAVE_THREAD_LOCAL) -# define OCTAVE_THREAD_LOCAL -# endif - -EOF - -if grep "#define OCTAVE_ENABLE_FLOAT_TRUNCATE 1" $config_h_file > /dev/null; then - echo "# define OCTAVE_FLOAT_TRUNCATE volatile" -else - echo "# define OCTAVE_FLOAT_TRUNCATE" -fi - -echo "" - $SED -n 's/#\(\(undef\|define\) OCTAVE_ENABLE_64.*$\)/# \1/p' $config_h_file $SED -n 's/#\(\(undef\|define\) OCTAVE_ENABLE_BOUNDS_CHECK.*$\)/# \1/p' $config_h_file +$SED -n 's/#\(\(undef\|define\) OCTAVE_ENABLE_FLOAT_TRUNCATE.*$\)/# \1/p' $config_h_file +$SED -n 's/#\(\(undef\|define\) OCTAVE_ENABLE_LIB_VISIBILITY_FLAGS.*$\)/# \1/p' $config_h_file $SED -n 's/#\(\(undef\|define\) OCTAVE_ENABLE_OPENMP.*$\)/# \1/p' $config_h_file +$SED -n 's/#\(\(undef\|define\) OCTAVE_F77_INT_TYPE.*$\)/# \1/p' $config_h_file $SED -n 's/#\(\(undef\|define\) OCTAVE_HAVE_LONG_LONG_INT.*$\)/# \1/p' $config_h_file +$SED -n 's/#\(\(undef\|define\) OCTAVE_HAVE_OVERLOAD_CHAR_INT8_TYPES.*$\)/# \1/p' $config_h_file +$SED -n 's/#\(\(undef\|define\) OCTAVE_HAVE_STD_PMR_POLYMORPHIC_ALLOCATOR.*$\)/# \1/p' $config_h_file $SED -n 's/#\(\(undef\|define\) OCTAVE_HAVE_UNSIGNED_LONG_LONG_INT.*$\)/# \1/p' $config_h_file -$SED -n 's/#\(\(undef\|define\) OCTAVE_HAVE_STD_PMR_POLYMORPHIC_ALLOCATOR.*$\)/# \1/p' $config_h_file -$SED -n 's/#\(\(undef\|define\) OCTAVE_HAVE_OVERLOAD_CHAR_INT8_TYPES.*$\)/# \1/p' $config_h_file +$SED -n 's/#\(\(undef\|define\) OCTAVE_IDX_TYPE.*$\)/# \1/p' $config_h_file $SED -n 's/#\(\(undef\|define\) OCTAVE_SIZEOF_F77_INT_TYPE.*$\)/# \1/p' $config_h_file $SED -n 's/#\(\(undef\|define\) OCTAVE_SIZEOF_IDX_TYPE.*$\)/# \1/p' $config_h_file $SED -n 's/#\(\(undef\|define\) OCTAVE_SIZEOF_INT.*$\)/# \1/p' $config_h_file - -cat << EOF - -# if defined (OCTAVE_ENABLE_64) -# define OCTAVE_IDX_TYPE_FORMAT PRId64 -# else -# define OCTAVE_IDX_TYPE_FORMAT PRId32 -# endif - -EOF - $SED -n 's/#\(\(undef\|define\) gid_t.*$\)/# \1/p' $config_h_file $SED -n 's/#\(\(undef\|define\) uid_t.*$\)/# \1/p' $config_h_file $SED -n 's/#\(\(undef\|define\) nlink_t.*$\)/# \1/p' $config_h_file @@ -370,6 +184,14 @@ cat << EOF +/* Enable inline functions or typedefs that provide access to + symbols that have been moved to the octave namespace so that + users of Octave may continue to access symbols using the + deprecated names. */ +# define OCTAVE_PROVIDE_DEPRECATED_SYMBOLS 1 + +# include "oct-conf-post-public.h" + #endif #endif diff -r 103efb7e1600 -r 4392386b5ecb build-aux/module.mk --- a/build-aux/module.mk Thu Mar 03 13:31:24 2022 -0500 +++ b/build-aux/module.mk Thu Mar 03 13:37:10 2022 -0500 @@ -27,7 +27,8 @@ $(AM_V_GEN)$(SHELL) config.status $@-tmp $@ GEN_CONFIG_INC = \ - oct-conf-post.h + oct-conf-post-private.h \ + oct-conf-post-public.h $(GEN_CONFIG_INC) : %.h : %.in.h config.status $(AM_V_GEN)$(SHELL) config.status $@-tmp $@ diff -r 103efb7e1600 -r 4392386b5ecb configure.ac --- a/configure.ac Thu Mar 03 13:31:24 2022 -0500 +++ b/configure.ac Thu Mar 03 13:37:10 2022 -0500 @@ -27,7 +27,7 @@ ### Initialize Autoconf AC_PREREQ([2.65]) -AC_INIT([GNU Octave], [7.0.91], [https://octave.org/bugs.html], [octave], +AC_INIT([GNU Octave], [8.0.0], [https://octave.org/bugs.html], [octave], [https://www.gnu.org/software/octave/]) ### Declare version numbers @@ -39,9 +39,9 @@ ## explains how to update these numbers for release and development ## versions. -OCTAVE_MAJOR_VERSION=7 +OCTAVE_MAJOR_VERSION=8 OCTAVE_MINOR_VERSION=0 -OCTAVE_PATCH_VERSION=91 +OCTAVE_PATCH_VERSION=0 dnl PACKAGE_VERSION is set by the AC_INIT VERSION argument. OCTAVE_VERSION="$PACKAGE_VERSION" @@ -63,7 +63,7 @@ dnl FIXME: Since we also set libtool versions for liboctave and libinterp, dnl perhaps we should be computing the "api version" from those versions numbers dnl in some way instead of setting it independently here. -OCTAVE_API_VERSION="api-v57" +OCTAVE_API_VERSION="api-v57+" AC_SUBST(OCTAVE_MAJOR_VERSION) AC_SUBST(OCTAVE_MINOR_VERSION) @@ -2281,7 +2281,7 @@ LIBS="$save_LIBS" fi -dnl Define this way instead of with an #if in oct-conf-post.h so that +dnl Define this way instead of with an #if in oct-conf-post-private.h so that dnl the build features script will get the correct value. dnl dnl The test on the sunlinsol_klu.h header is a bit of a kluge. @@ -2670,10 +2670,10 @@ ### Determine whether libraries should be linked with visibility attributes -ENABLE_LIB_VISIBILITY_FLAGS=no +ENABLE_LIB_VISIBILITY_FLAGS=yes AC_ARG_ENABLE(lib-visibility-flags, - [AS_HELP_STRING([--enable-lib-visibility-flags], - [Build libraries with visibility flags (don't export all symbols). This feature is experimental and should only be used for testing.])], + [AS_HELP_STRING([--disable-lib-visibility-flags], + [don't build libraries with visibility flags (export all symbols)])], [case $enableval in yes) ENABLE_LIB_VISIBILITY_FLAGS=yes ;; no) ENABLE_LIB_VISIBILITY_FLAGS=no ;; @@ -3006,7 +3006,8 @@ ### Add footer to config.h -AH_BOTTOM([#include "oct-conf-post.h"]) +AH_BOTTOM([#include "oct-conf-post-private.h"]) +AH_BOTTOM([#include "oct-conf-post-public.h"]) ### Make all AC_DEFINES available to testif feature of test.m function. dnl This must reside at the bottom of configure.ac after all AC_DEFINES @@ -3104,12 +3105,19 @@ liboctave/octave.pc:liboctave/octave.in.pc libinterp/octinterp.pc:libinterp/octinterp.in.pc]) -dnl We use a .in.h file for oct-conf-post.h simply to copy it to the build tree +dnl We use a .in.h file for oct-conf-post-private.h and +dnl oct-conf-post-public.h simply to copy it to the build tree dnl so that we don't have to add the -I${top_srcdir} to any CPPFLAGS variables. -AC_CONFIG_FILES([oct-conf-post.h-tmp:oct-conf-post.in.h]) -AC_CONFIG_COMMANDS([oct-conf-post.h], - [$SHELL $srcdir/build-aux/move-if-change oct-conf-post.h-tmp oct-conf-post.h]) +AC_CONFIG_FILES([ + oct-conf-post-private.h-tmp:oct-conf-post-private.in.h + oct-conf-post-public.h-tmp:oct-conf-post-public.in.h]) + +AC_CONFIG_COMMANDS([oct-conf-post-private.h], + [$SHELL $srcdir/build-aux/move-if-change oct-conf-post-private.h-tmp oct-conf-post-private.h]) + +AC_CONFIG_COMMANDS([oct-conf-post-public.h], + [$SHELL $srcdir/build-aux/move-if-change oct-conf-post-public.h-tmp oct-conf-post-public.h]) OCTAVE_CONFIG_MOVE_IF_CHANGE_FILES([ liboctave/external/mk-f77-def.sh diff -r 103efb7e1600 -r 4392386b5ecb doc/interpreter/contributors.in --- a/doc/interpreter/contributors.in Thu Mar 03 13:31:24 2022 -0500 +++ b/doc/interpreter/contributors.in Thu Mar 03 13:37:10 2022 -0500 @@ -34,6 +34,7 @@ David Billinghurst Don Bindner Jakub Bogusz +Gaël Bonithon Moritz Borgmann Paul Boven Richard Bovey @@ -404,7 +405,8 @@ Ariel Tankus Falk Tannhäuser Duncan Temple Lang -Matthew Tenny +Matthew Tennyhg +Remi Thebault Kris Thielemans Georg Thimm Paul Thomas diff -r 103efb7e1600 -r 4392386b5ecb doc/interpreter/genpropdoc.m --- a/doc/interpreter/genpropdoc.m Thu Mar 03 13:31:24 2022 -0500 +++ b/doc/interpreter/genpropdoc.m Thu Mar 03 13:37:10 2022 -0500 @@ -930,6 +930,15 @@ for the x-axis. __modemsg__. @xref{XREFxlim, , @w{xlim function}}."; s.valid = valid_2elvec; + case "xlimitmethod" + s.doc = "Method used to determine the x axis limits when the \ +@code{xlimmode} property is @qcode{\"auto\"}. The default value, \ +@qcode{\"tickaligned\"} makes limits align with the closest ticks. With \ +value @qcode{\"tight\"} the limits are adjusted to enclose all the graphics \ +objects in the axes, while with value @qcode{\"padded\"}, an additionnal \ +margin of about 7%% of the data extent is added around the objects. \ +@xref{XREFaxis, , @w{axis function}}."; + case "xlimmode" case "xminorgrid" s.doc = "Control whether minor x grid lines are displayed."; @@ -975,6 +984,15 @@ for the y-axis. __modemsg__. @xref{XREFylim, , @w{ylim function}}."; s.valid = valid_2elvec; + case "ylimitmethod" + s.doc = "Method used to determine the y axis limits when the \ +@code{xlimmode} property is @qcode{\"auto\"}. The default value, \ +@qcode{\"tickaligned\"} makes limits align with the closest ticks. With \ +value @qcode{\"tight\"} the limits are adjusted to enclose all the graphics \ +objects in the axes, while with value @qcode{\"padded\"}, an additionnal \ +margin of about 7%% of the data extent is added around the objects. \ +@xref{XREFaxis, , @w{axis function}}."; + case "ylimmode" case "yminorgrid" s.doc = "Control whether minor y grid lines are displayed."; @@ -1013,6 +1031,15 @@ for the z-axis. __modemsg__. @xref{XREFzlim, , @w{zlim function}}."; s.valid = valid_2elvec; + case "zlimitmethod" + s.doc = "Method used to determine the z axis limits when the \ +@code{xlimmode} property is @qcode{\"auto\"}. The default value, \ +@qcode{\"tickaligned\"} makes limits align with the closest ticks. With \ +value @qcode{\"tight\"} the limits are adjusted to enclose all the graphics \ +objects in the axes, while with value @qcode{\"padded\"}, an additionnal \ +margin of about 7%% of the data extent is added around the objects. \ +@xref{XREFaxis, , @w{axis function}}."; + case "zlimmode" case "zminorgrid" s.doc = "Control whether minor z grid lines are displayed."; @@ -1064,6 +1091,29 @@ before rendering.\n\ @xref{XREFinterpreterusage, , @w{Use of the interpreter property}}."; + case "itemhitfcn" + s.doc = "Callback function which is executed when a legend item \ +is clicked. @xref{Callbacks, , @w{Callbacks section}}.\n\ +\n\ +The callback function must have the following prototype \ +@code{fcn (hlegend, evnt)}, where @code{hlegend} is the legend object handle \ +and @code{evnt} is a structure with the following fields:\n\ +@table @code\n\ +@item Peer\n\ +Handle of the plot object to which the clicked item is associated.\n\ +@item Region\n\ +May be @qcode{\"icon\"} or @qcode{\"label\"} depending on which part of \ +the item is clicked.\n\ +@item SelectionType\n\ +One of @qcode{\"normal\"}, @qcode{\"extend\"}, @qcode{\"open\"}, or \ +@qcode{\"alt\"}. \ +@xref{XREFfigureselectiontype, , @w{Figure @qcode{\"selectiontype\"}}}.\n\ +@item Source\n\ +Handle of the legend object.\n\ +@item EventName\n\ +Name is @qcode{\"ItemHit\"}.\n\ +@end table"; + case "location" s.doc = "Control the location of the legend."; @@ -2077,8 +2127,8 @@ if (isempty (props)) props = {"autoupdate", "box", "color", "edgecolor", "fontangle", ... "fontname", "fontsize", "fontunits", "fontweight", ... - "location", "numcolumns", "orientation", "position", ... - "string", "textcolor", "title", "units"}; + "itemhitfcn", "location", "numcolumns", "orientation", ... + "position", "string", "textcolor", "title", "units"}; endif elseif (strcmp (objname, "scatter")) ## Make sure to get a scatter object independent of graphics toolkit diff -r 103efb7e1600 -r 4392386b5ecb doc/interpreter/matrix.txi --- a/doc/interpreter/matrix.txi Thu Mar 03 13:31:24 2022 -0500 +++ b/doc/interpreter/matrix.txi Thu Mar 03 13:37:10 2022 -0500 @@ -112,8 +112,6 @@ @DOCSTRING(circshift) -@DOCSTRING(shift) - @DOCSTRING(shiftdim) @DOCSTRING(sort) diff -r 103efb7e1600 -r 4392386b5ecb doc/interpreter/mk-doc-cache.pl --- a/doc/interpreter/mk-doc-cache.pl Thu Mar 03 13:31:24 2022 -0500 +++ b/doc/interpreter/mk-doc-cache.pl Thu Mar 03 13:37:10 2022 -0500 @@ -34,25 +34,22 @@ use File::Temp; my $doc_delim = "\x{1d}"; -my $tex_delim_pat = qr/\Q-*- texinfo -*-\E/; +my $tex_delim_ptn = qr/\Q-*- texinfo -*-\E/; -## Returns a File::Temp object with texinfo code. +## Returns a File::Temp object with Texinfo code. sub make_texinfo_file { my $srcdir = shift; my $macro_fpath = shift; my @docstrings = @_; - my $t_file = File::Temp->new (UNLINK => 1); + my $tmpfile = File::Temp->new (UNLINK => 1); ## Only the first file is the macro file. Copy its contents verbatim. - open (my $macro_fh, "<", $macro_fpath) + open (my $FH_macro, "<", $macro_fpath) or die "Unable to open $macro_fpath for reading: $!\n"; - while (<$macro_fh>) - { - print {$t_file} $_; - } - close ($macro_fh); + while (<$FH_macro>) { print {$tmpfile} $_; } + close ($FH_macro); foreach my $filepath (@docstrings) { @@ -64,35 +61,44 @@ ## tree, from released sources. $filepath = File::Spec->catfile ($srcdir, $filepath); } - open (my $fh, "<", $filepath) + open (my $FH, "<", $filepath) or die "Unable to open $filepath for reading: $!\n"; my $in_header = 1; - while (my $line = <$fh>) + while (my $line = <$FH>) { ## DOCSTRINGS header ends once we find the first function. if ($in_header && $line =~ m/^$doc_delim/) { $in_header = 0; } - next if $in_header; - next if $line =~ /$tex_delim_pat/; + next if ($in_header); + next if ($line =~ /$tex_delim_ptn/); - $line =~ s/\@seealso/\@xseealso/g; + ## Change @seealso to private @xseealso macro + if ($line =~ m'@seealso') + { + ## Combine @seealso macro spread over multiple lines + while ($line !~ m/}$/) { $line .= <$FH>; } - ## escape {}@ characters for texinfo - $line =~ s/([{}\@])/\@$1/g - if $line =~ m/^$doc_delim/; + ## escape @ characters in old-style class names like @ftp + $line =~ s/\@(\w)/\@\@$1/g; + $line =~ s'@@seealso'@xseealso'; + } - print {$t_file} $line; + ## escape {}@ characters in Texinfo anchor name (e.g., @ftp/dir.m) + $line =~ s/([{}@])/\@$1/g if ($line =~ m/^$doc_delim/); + + print {$tmpfile} $line; } - close ($fh); + close ($FH); } - print {$t_file} $doc_delim; + print {$tmpfile} $doc_delim; - $t_file->flush (); - return $t_file; + $tmpfile->flush (); + + return $tmpfile; } sub get_info_text @@ -106,7 +112,7 @@ if (! defined $info_text); die "makeinfo produced no output!" - if ! $info_text; + if (! $info_text); return $info_text; } @@ -117,7 +123,7 @@ ## Constant patterns. We only check for two underscores at the end, ## and not at the start, to also skip @class/__method__ - my $private_name_pat = qr/__$/; + my $private_name_ptn = qr/__$/; my @formatted = (); @@ -135,7 +141,7 @@ my ($symbol, $doc) = split (/[\r\n]/, $block, 2); - next if (length ($symbol) > 2 && $symbol =~ m/$private_name_pat/); + next if (length ($symbol) > 2 && $symbol =~ m/$private_name_ptn/); if (! defined ($doc)) { @@ -156,6 +162,7 @@ push (@formatted, [($symbol, $doc, $first_sentence)]); } + return @formatted; } @@ -164,22 +171,26 @@ my ($str) = @_; my $len = length ($str); - print "# name: \n"; - print "# type: sq_string\n"; - print "# elements: 1\n"; - print "# length: $len\n"; - print "$str\n\n\n"; + print <<__END_OF_ELEMENT__; +# name: +# type: sq_string +# elements: 1 +# length: $len +$str\n\n +__END_OF_ELEMENT__ } sub print_cache { my $num = @_; - print "# created by mk-doc-cache.pl\n"; - print "# name: cache\n"; - print "# type: cell\n"; - print "# rows: 3\n"; - print "# columns: $num\n"; + print <<__END_OF_CACHE_HDR__; +# created by mk-doc-cache.pl +# name: cache +# type: cell +# rows: 3 +# columns: $num +__END_OF_CACHE_HDR__ foreach my $elt (@_) { @@ -194,6 +205,8 @@ } } +## FIXME: This is a very C/C++ way of coding things. +## Perl convention would just be to have the executable code at end of file. sub main { my $srcdir = shift; diff -r 103efb7e1600 -r 4392386b5ecb doc/interpreter/sparse.txi --- a/doc/interpreter/sparse.txi Thu Mar 03 13:31:24 2022 -0500 +++ b/doc/interpreter/sparse.txi Thu Mar 03 13:37:10 2022 -0500 @@ -530,13 +530,6 @@ @noindent returns a full matrix as can be seen. - -Additionally, if @code{sparse_auto_mutate} is true, all sparse functions -test the amount of memory occupied by the sparse matrix to see if the -amount of storage used is larger than the amount used by the full -equivalent. Therefore @code{speye (2) * 1} will return a full matrix as -the memory used is smaller for the full version than the sparse version. - As all of the mixed operators and functions between full and sparse matrices exist, in general this does not cause any problems. However, one area where it does cause a problem is where a sparse matrix is @@ -561,11 +554,6 @@ always returns a sparse matrix, even if the memory used will be larger than its full representation. -@DOCSTRING(sparse_auto_mutate) - -Note that the @code{sparse_auto_mutate} option is incompatible with -@sc{matlab}, and so it is off by default. - @node Mathematical Considerations @subsubsection Mathematical Considerations diff -r 103efb7e1600 -r 4392386b5ecb etc/HACKING.md --- a/etc/HACKING.md Thu Mar 03 13:31:24 2022 -0500 +++ b/etc/HACKING.md Thu Mar 03 13:37:10 2022 -0500 @@ -399,6 +399,80 @@ These guidelines also appear in the GNU libtool manual, see https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html. +Merging the default branch to stable before a release +----------------------------------------------------- + +To merge default to stable for a release with version == MAJOR: + +NOTE, I use two separate repos, one in `/path/to/octave-stable` that is +updated to the stable branch and one in `/path/to/octave-default` that +is updated to the default branch. + +1. Update the repo in `/path/to/octave-stable` to the most recent change + on the stable branch. Ensure that there are no pending changes (be + careful to avoid wiping out any changes you are currently working + on!): + + cd /path/to/octave-stable + hg update -C stable + +2. Merge default to stable (there should never be any conflicts here; + you are just making the stable branch be whatever is on the current + default branch): + + hg merge default + +3. Commit the change (replace VERSION with the correct version; it + should be of the form MAJOR.1.0): + + hg commit -m "maint: Merge default to stable to begin VERSION release process." + +4. Bump version numbers and release date in `configure.ac` for pre-release: + + * Set version in AC_INIT to MAJOR.0.1 + * OCTAVE_MAJOR_VERSION should already be correct. + * Set OCTAVE_MINOR_VERSION to 0. + * Set OCTAVE_PATCH_VERSION to 1. + * Set OCTAVE_RELEASE_DATE to the current date. + * Set the year in OCTAVE_COPYRIGHT to the current year. The + copyright dates in the source files should have already been + updated during the development cycle. If not, that should be done + in a separate change before the merge. + * OCTAVE_API_VERSION and shared library version numbers may be + updated in a separate changeset just prior to creating the first + test release. + + hg commit ## Use commit message similar to the one in 8f8fab4c93ae + +5. Update the repo in `/path/to/octave-default` to the most recent change + on the default branch. Ensure that there are no pending changes (be + careful to avoid wiping out any changes you are currently working + on!): + + cd /path/to/octave-default + hg update -C default + +6. Merge stable back to default (there should not be conflicts in this + merge): + + hg merge stable + hg commit -m "maint: Merge stable to default." + +7. Bump versions in `configure.ac` to begin active development of MAJOR+1: + + * Set version in AC_INIT to MAJOR+1.0.0 + * Set OCTAVE_MAJOR_VERSION to MAJOR+1 + * Set OCTAVE_MINOR_VERSION to 0 + * Set OCTAVE_PATCH_VERSION to 0 + + hg commit ## Use commit message similar to the one in 1455418a5c4c + +8. Remove functions and properties deprecated in MAJOR-1 (see ecf207896f76, + for example) + +9. Update NEWS file for next development cycle (see 0ec5eaabaf2c, for + example). + ################################################################################ diff -r 103efb7e1600 -r 4392386b5ecb etc/NEWS.7.md diff -r 103efb7e1600 -r 4392386b5ecb etc/NEWS.8.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/etc/NEWS.8.md Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,58 @@ +Summary of important user-visible changes for version 8 (yyyy-mm-dd): +--------------------------------------------------------------------- + +### General improvements + +- Octave's libraries are now built using symbol visibility by default. +That means that less symbols are exported from these libraries. +Configure with `--disable-lib-visibility-flags` to export all symbols +(as in previous versions). + + +### Graphical User Interface + + +### Graphics backend + + +### Matlab compatibility + + +### Alphabetical list of new functions added in Octave 8 + + +### Deprecated functions, properties, and operators + +The following functions and properties have been deprecated in Octave 8 +and will be removed from Octave 10 (or whatever version is the second +major release after 8): + +- Functions + + Function | Replacement + -----------------------|------------------ + `shift` | `circshift` + + +The following functions were deprecated in Octave 6 and have been removed +from Octave 8. + +- Functions + + Function | Replacement + -----------------------|------------------ + `runtests` | `oruntests` + +- The environment variable used by `mkoctfile` for linker flags is now + `LDFLAGS` rather than `LFLAGS`. `LFLAGS` was deprecated in Octave 6, + and will be removed in a future version of Octave. + +### Old release news + +- [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) diff -r 103efb7e1600 -r 4392386b5ecb etc/module.mk --- a/etc/module.mk Thu Mar 03 13:31:24 2022 -0500 +++ b/etc/module.mk Thu Mar 03 13:37:10 2022 -0500 @@ -12,6 +12,7 @@ %reldir%/NEWS.5.md \ %reldir%/NEWS.6.md \ %reldir%/NEWS.7.md \ + %reldir%/NEWS.8.md \ %reldir%/gdbinit %canon_reldir%_EXTRA_DIST += \ diff -r 103efb7e1600 -r 4392386b5ecb libgui/graphics/FigureWindow.cc --- a/libgui/graphics/FigureWindow.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libgui/graphics/FigureWindow.cc Thu Mar 03 13:37:10 2022 -0500 @@ -30,6 +30,7 @@ #include #include "FigureWindow.h" +#include "gui-preferences-global.h" namespace octave { @@ -38,7 +39,7 @@ : FigureWindowBase (xparent) { // set icon from application resources - setWindowIcon (QIcon (":/actions/icons/graphic_logo_Figure.png")); + setWindowIcon (QIcon (global_icon_paths.at (ICON_THEME_OCTAVE))); } FigureWindow::~FigureWindow (void) diff -r 103efb7e1600 -r 4392386b5ecb libgui/graphics/ToolBarButton.cc --- a/libgui/graphics/ToolBarButton.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libgui/graphics/ToolBarButton.cc Thu Mar 03 13:37:10 2022 -0500 @@ -29,11 +29,13 @@ #include #include +#include #include #include "ToolBarButton.h" #include "QtHandlesUtils.h" #include "octave-qobject.h" +#include "gui-preferences-global.h" namespace octave { @@ -155,9 +157,7 @@ template QIcon ToolBarButton::get_icon (const std::string& name) { - octave::resource_manager& rmgr = m_octave_qobj.get_resource_manager (); - - return rmgr.icon (QString::fromStdString (name)); + return QIcon (global_icon_paths.at (ICON_THEME_OCTAVE) + QString::fromStdString (name) + ".png"); } } diff -r 103efb7e1600 -r 4392386b5ecb libgui/qterminal/libqterminal/unix/kpty.cpp --- a/libgui/qterminal/libqterminal/unix/kpty.cpp Thu Mar 03 13:31:24 2022 -0500 +++ b/libgui/qterminal/libqterminal/unix/kpty.cpp Thu Mar 03 13:37:10 2022 -0500 @@ -294,8 +294,8 @@ { for (const char* s4 = "0123456789abcdef"; *s4; s4++) { - ptyName = QString().sprintf("/dev/pty%c%c", *s3, *s4).toAscii(); - d->ttyName = QString().sprintf("/dev/tty%c%c", *s3, *s4).toAscii(); + ptyName = QString().sprintf("/dev/pty%c%c", *s3, *s4).toLatin1(); + d->ttyName = QString().sprintf("/dev/tty%c%c", *s3, *s4).toLatin1(); d->masterFd = ::open(ptyName.data(), O_RDWR); if (d->masterFd >= 0) diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/community-news.cc --- a/libgui/src/community-news.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libgui/src/community-news.cc Thu Mar 03 13:37:10 2022 -0500 @@ -27,12 +27,12 @@ # include "config.h" #endif -#include #include #include #include #include "community-news.h" +#include "gui-utils.h" #include "gui-preferences-nr.h" #include "news-reader.h" #include "octave-qobject.h" @@ -130,14 +130,4 @@ activateWindow (); } - // FIXME: This function is duplicated in main_window.cc. Maybe it - // should be a utility function? - - void community_news::get_screen_geometry (int& width, int& height) - { - QRect screen_geometry = QApplication::desktop ()->availableGeometry (this); - - width = screen_geometry.width (); - height = screen_geometry.height (); - } } diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/community-news.h --- a/libgui/src/community-news.h Thu Mar 03 13:31:24 2022 -0500 +++ b/libgui/src/community-news.h Thu Mar 03 13:37:10 2022 -0500 @@ -61,8 +61,6 @@ void construct (base_qobject& oct_qobj, const QString& base_url, const QString& page, int serial); - void get_screen_geometry (int& width, int& height); - QTextBrowser *m_browser; }; } diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/documentation.cc --- a/libgui/src/documentation.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libgui/src/documentation.cc Thu Mar 03 13:37:10 2022 -0500 @@ -417,13 +417,13 @@ // Zoom m_tool_bar->addSeparator (); m_action_zoom_in - = add_action (rmgr.icon ("zoom-in"), tr ("Zoom in"), + = add_action (rmgr.icon ("view-zoom-in"), tr ("Zoom in"), SLOT (zoom_in (void)), m_doc_browser, m_tool_bar); m_action_zoom_out - = add_action (rmgr.icon ("zoom-out"), tr ("Zoom out"), + = add_action (rmgr.icon ("view-zoom-out"), tr ("Zoom out"), SLOT (zoom_out (void)), m_doc_browser, m_tool_bar); m_action_zoom_original - = add_action (rmgr.icon ("zoom-original"), tr ("Zoom original"), + = add_action (rmgr.icon ("view-zoom-original"), tr ("Zoom original"), SLOT (zoom_original (void)), m_doc_browser, m_tool_bar); // Bookmarks (connect slots later) diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/files-dock-widget.cc --- a/libgui/src/files-dock-widget.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libgui/src/files-dock-widget.cc Thu Mar 03 13:37:10 2022 -0500 @@ -41,6 +41,8 @@ #include #include #include +#include +#include #include #include @@ -70,6 +72,113 @@ } }; + // to have file renamed in the file tree, it has to be renamed in + // QFileSystemModel::setData. + // For the editor to behave correctly, some signals must be sent before + // and after the rename + class file_system_model : public QFileSystemModel + { + public: + file_system_model (files_dock_widget *p) : QFileSystemModel (p) {} + + ~file_system_model () = default; + + bool setData (const QModelIndex &idx, const QVariant &value, + int role) override + { + if (!idx.isValid () || idx.column () != 0 || role != Qt::EditRole + || (flags (idx) & Qt::ItemIsEditable) == 0) + { + return false; + } + + QString new_name = value.toString (); + QString old_name = idx.data ().toString (); + if (new_name == old_name) + return true; + if (new_name.isEmpty () + || QDir::toNativeSeparators (new_name).contains (QDir::separator ())) + { + display_rename_failed_message (old_name, new_name); + return false; + } + + auto parent_dir = QDir(filePath (parent (idx))); + + files_dock_widget *fdw = static_cast(parent()); + + + fdw->file_remove_signal(parent_dir.filePath(old_name), parent_dir.filePath(new_name)); + + if (!parent_dir.rename (old_name, new_name)) + { + display_rename_failed_message (old_name, new_name); + fdw->file_renamed_signal(false); + return false; + } + + fdw->file_renamed_signal(true); + + emit fileRenamed(parent_dir.absolutePath(), old_name, new_name); + revert(); + + return true; + } + + private: + void display_rename_failed_message (const QString &old_name, + const QString &new_name) + { + const QString message = + + files_dock_widget::tr ("Could not rename file \"%1\" to \"%2\".") + .arg (old_name) + .arg (new_name); + QMessageBox::information (static_cast (parent ()), + QFileSystemModel::tr ("Invalid filename"), + message, QMessageBox::Ok); + } + }; + + // Delegate to improve ergonomy of file renaming by pre-selecting the text + // before the extension. + class RenameItemDelegate : public QStyledItemDelegate + { + public: + RenameItemDelegate (QObject *parent = nullptr) + : QStyledItemDelegate{ parent } + { + } + + void setEditorData (QWidget *editor, + const QModelIndex &index) const override + { + QLineEdit *line_edit = qobject_cast (editor); + + if (!line_edit) + { + QStyledItemDelegate::setEditorData (editor, index); + return; + } + + QString filename = index.data (Qt::EditRole).toString (); + + int select_len = filename.indexOf (QChar ('.')); + if (select_len == -1) + select_len = filename.size (); + + line_edit->setText (filename); + + // Qt calls QLineEdit::selectAll after this function is called, so to + // actually restrict the selection, we have to post the modification at + // the end of the event loop. + // QTimer allows this easily with 0 as timeout. + QTimer::singleShot (0, [=] () { + line_edit->setSelection (0, select_len); + }); + } + }; + files_dock_widget::files_dock_widget (QWidget *p, base_qobject& oct_qobj) : octave_dock_widget ("FilesDockWidget", p, oct_qobj) { @@ -121,7 +230,7 @@ resource_manager& rmgr = m_octave_qobj.get_resource_manager (); QAction *directory_up_action - = new QAction (rmgr.icon ("go-up"), "", m_navigation_tool_bar); + = new QAction (rmgr.icon ("folder-up"), "", m_navigation_tool_bar); directory_up_action->setToolTip (tr ("One directory up")); m_sync_browser_directory_action @@ -202,7 +311,7 @@ startup_dir = QDir (); } - m_file_system_model = new QFileSystemModel (this); + m_file_system_model = new file_system_model (this); m_file_system_model->setResolveSymlinks (false); m_file_system_model->setFilter ( QDir::System | QDir::NoDotAndDotDot | QDir::AllEntries); @@ -219,6 +328,24 @@ m_file_tree_view->setAnimated (true); m_file_tree_view->setToolTip (tr ("Double-click to open file/folder, right click for alternatives")); + // allow renaming directly in the tree view with + // m_file_tree_view->edit(index) + m_file_system_model->setReadOnly (false); + // delegate to improve rename ergonomy by pre-selecting text up to the + // extension + auto *rename_delegate = new RenameItemDelegate (this); + m_file_tree_view->setItemDelegateForColumn (0, rename_delegate); + // prevent the tree view to override Octave's double-click behavior + m_file_tree_view->setEditTriggers (QAbstractItemView::NoEditTriggers); + // create the rename action (that will be added to context menu) + // and associate to F2 key shortcut + m_rename_action = new QAction (tr ("Rename..."), this); + m_rename_action->setShortcut (Qt::Key_F2); + m_rename_action->setShortcutContext(Qt::WidgetWithChildrenShortcut); + connect (m_rename_action, &QAction::triggered, this, + &files_dock_widget::contextmenu_rename); + addAction(m_rename_action); + // get sort column and order as well as column state (order and width) m_file_tree_view->sortByColumn @@ -582,8 +709,7 @@ } menu.addSeparator (); - menu.addAction (tr ("Rename..."), - this, &files_dock_widget::contextmenu_rename); + menu.addAction (m_rename_action); menu.addAction (rmgr.icon ("edit-delete"), tr ("Delete..."), this, &files_dock_widget::contextmenu_delete); @@ -694,37 +820,8 @@ if (rows.size () > 0) { QModelIndex index = rows[0]; - - QFileInfo info = m_file_system_model->fileInfo (index); - QDir path = info.absoluteDir (); - QString old_name = info.fileName (); - bool ok; - - QString new_name - = QInputDialog::getText (this, tr ("Rename file/directory"), - tr ("Rename file/directory:\n") - + old_name + tr ("\n to: "), - QLineEdit::Normal, old_name, &ok); - if (ok && new_name.length () > 0) - { - new_name = path.absolutePath () + '/' + new_name; - old_name = path.absolutePath () + '/' + old_name; - // editor: close old - emit file_remove_signal (old_name, new_name); - // Do the renaming - QFile f (old_name); // Must use QFile, not QDir (bug #56298) - bool st = f.rename (new_name); - if (! st) - QMessageBox::warning (this, tr ("Rename error"), - tr ("Could not rename file \"%1\" to \"%2\"."). - arg (old_name).arg (new_name)); - // editor: load new/old file depending on success - emit file_renamed_signal (st); - // Clear cache of file browser - m_file_system_model->revert (); - } + m_file_tree_view->edit(index); } - } void files_dock_widget::contextmenu_delete (bool) @@ -791,8 +888,8 @@ tr ("Could not delete file \"%1\"."). arg (info.filePath ())); // Reload the old file - emit file_renamed_signal (false); } + emit file_renamed_signal (st); } m_file_system_model->revert (); diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/files-dock-widget.h --- a/libgui/src/files-dock-widget.h Thu Mar 03 13:31:24 2022 -0500 +++ b/libgui/src/files-dock-widget.h Thu Mar 03 13:37:10 2022 -0500 @@ -207,6 +207,7 @@ QToolBar *m_navigation_tool_bar; QAction *m_sync_octave_directory_action; QAction *m_sync_browser_directory_action; + QAction *m_rename_action; //! The file system model. diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/gui-preferences-global.h --- a/libgui/src/gui-preferences-global.h Thu Mar 03 13:31:24 2022 -0500 +++ b/libgui/src/gui-preferences-global.h Thu Mar 03 13:37:10 2022 -0500 @@ -84,7 +84,35 @@ const gui_pref global_icon_theme ("use_system_icon_theme", QVariant (true)); -// Other +enum +{ + ICON_THEME_SYSTEM = 0, + ICON_THEME_OCTAVE, + ICON_THEME_TANGO, + ICON_THEME_CURSORS +} ; + +const QStringList +global_icon_paths (QStringList () + << "" + << ":/icons/octave/128x128/" + << ":/icons/tango/128x128/" + << ":/icons/cursors/" + ); + +const gui_pref +global_icon_theme_index ("icon_theme", QVariant (ICON_THEME_SYSTEM)); +const QStringList +global_all_icon_themes (QStringList () + << "" + << "octave" + << "tango" + << "cursors"); +const QStringList +global_all_icon_theme_names (QStringList () + << "System" + << "Octave" + << "Tango"); const gui_pref global_status_bar ("show_status_bar", QVariant (true)); diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/gui-utils.cc --- a/libgui/src/gui-utils.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libgui/src/gui-utils.cc Thu Mar 03 13:37:10 2022 -0500 @@ -27,6 +27,10 @@ # include "config.h" #endif +#include +#include +#include + #include "gui-utils.h" namespace octave @@ -42,4 +46,80 @@ return QColor::fromHsvF (h1, s1*fs, v1 + fv*(v2 - v1)); } + + OCTGUI_API void + get_screen_geometry (int& width, int& height) + { + QRect geom = QGuiApplication::primaryScreen ()->availableGeometry (); + + width = geom.width (); + height = geom.height (); + } + + + OCTGUI_API void + adjust_to_screen (QRect& actual_geometry, const QRect& default_geometry) + { + + // Get the screen that holds the largest part of the given actual geometry + + const QScreen *actual_screen = nullptr; // no screen found yet + QRect actual_screen_geom = QRect (); // geometry of found screen + int intersected_area_max = 0; // max. intersected area + + const int area_actual_geometry + = actual_geometry.width () * actual_geometry.height (); + QRect intersection; + + foreach (const QScreen *screen, QGuiApplication::screens()) + { + QRect screen_geom = screen->availableGeometry (); + intersection = screen_geom.intersected (actual_geometry); + if (! intersection.isEmpty ()) + { + int area = intersection.width () * intersection.height (); + if (area > intersected_area_max) + { + actual_screen = screen; + actual_screen_geom = screen->availableGeometry (); + if (area == area_actual_geometry) + return; // Actual geom is completely on a screen: return + intersected_area_max = area; + } + } + } + + // If the actual geometry is on no screen, use deault geometry + + if (actual_screen == nullptr) + { + actual_geometry = default_geometry; + return; + } + + // There is a screen that holds a part of the actual geometry. + // Now adjust actual geometry to this screen + + // Get some properties of the actual and intersected geometry + int agx1, agy1, agx2, agy2; + actual_geometry.getCoords (&agx1, &agy1, &agx2, &agy2); + int isx1, isy1, isx2, isy2; + intersection.getCoords (&isx1, &isy1, &isx2, &isy2); + + // Make the intersection the same size as the actual geometry + if ((agx1 == isx1) && (agx2 != isx2)) + isx1 = isx1 - agx2 + isx2; + if ((agx1 != isx1) && (agx2 == isx2)) + isx2 = isx2 + agx2 - isx2; + if ((agy1 == isy1) && (agy2 != isy2)) + isy1 = isy1 - agy2 + isy2; + if ((agy1 != isy1) && (agy2 == isy2)) + isy2 = isy2 + agy2 - isy2; + + // And compute again the intersection with the screen if this resizing + // led to corners outside the screen + actual_geometry = actual_screen_geom.intersected ( + QRect (QPoint (isx1,isy1), QPoint (isx2,isy2))); + } + } diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/gui-utils.h --- a/libgui/src/gui-utils.h Thu Mar 03 13:31:24 2022 -0500 +++ b/libgui/src/gui-utils.h Thu Mar 03 13:37:10 2022 -0500 @@ -29,6 +29,7 @@ #include "octave-config.h" #include +#include namespace octave { @@ -55,6 +56,28 @@ interpolate_color (const QColor& col1, const QColor& col2, double fs, double fv); + + /*! + Get the screen geometry of the actual screen. + + @param width integer variable for storing the screen width + @param height integer variable for storing the screen height + */ + + extern OCTGUI_API void + get_screen_geometry (int& width, int& height); + + + /*! + Adjust geometry to be completely on a screen + + @param actual_geometry QRect with actual widget geometry; this is + changed to the updated geometry which is on the screen. + @param default_geometry the default geometry that is used in case + the actual geometry os on no available screen. + */ + extern OCTGUI_API void + adjust_to_screen (QRect& actual_geometry, const QRect& default_geometry); } #endif diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/applications-system.png Binary file libgui/src/icons/applications-system.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/applications-system.svg --- a/libgui/src/icons/applications-system.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,247 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - System Applications - - - Jakub Steiner - - - http://jimmac.musichall.cz/ - - - system - applications - group - category - admin - root - - - - - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/bookmark-new.png Binary file libgui/src/icons/bookmark-new.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/bookmark-new.svg --- a/libgui/src/icons/bookmark-new.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,672 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - New Bookmark - - - bookmark - remember - favorite - - - - - - Andreas Nilsson - - - - - - Jakub Steiner - - - create bookmark action - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/bottom_left_corner.png Binary file libgui/src/icons/bottom_left_corner.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/bottom_right_corner.png Binary file libgui/src/icons/bottom_right_corner.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/bottom_side.png Binary file libgui/src/icons/bottom_side.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/bp-next.png Binary file libgui/src/icons/bp-next.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/bp-next.svg --- a/libgui/src/icons/bp-next.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1072 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - Lapo Calamandrei - - - - - - media - player - record - music - sound - video - - - - - - - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/bp-prev.png Binary file libgui/src/icons/bp-prev.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/bp-prev.svg --- a/libgui/src/icons/bp-prev.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1147 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - Lapo Calamandrei - - - - - - media - player - record - music - sound - video - - - - - - - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/bp-rm-all.png Binary file libgui/src/icons/bp-rm-all.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/bp-rm-all.svg --- a/libgui/src/icons/bp-rm-all.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1243 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - Lapo Calamandrei - - - - - - media - player - record - music - sound - video - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/bp-toggle.png Binary file libgui/src/icons/bp-toggle.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/bp-toggle.svg --- a/libgui/src/icons/bp-toggle.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,948 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - Lapo Calamandrei - - - - - - media - player - record - music - sound - video - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/circle.png Binary file libgui/src/icons/circle.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/circle.svg --- a/libgui/src/icons/circle.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/cross.png Binary file libgui/src/icons/cross.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/cursors/bottom_left_corner.png Binary file libgui/src/icons/cursors/bottom_left_corner.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/cursors/bottom_right_corner.png Binary file libgui/src/icons/cursors/bottom_right_corner.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/cursors/bottom_side.png Binary file libgui/src/icons/cursors/bottom_side.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/cursors/circle.png Binary file libgui/src/icons/cursors/circle.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/cursors/circle.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/cursors/circle.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/cursors/cross.png Binary file libgui/src/icons/cursors/cross.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/cursors/fleur.png Binary file libgui/src/icons/cursors/fleur.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/cursors/hand2.png Binary file libgui/src/icons/cursors/hand2.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/cursors/left_side.png Binary file libgui/src/icons/cursors/left_side.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/cursors/right_side.png Binary file libgui/src/icons/cursors/right_side.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/cursors/top_left_corner.png Binary file libgui/src/icons/cursors/top_left_corner.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/cursors/top_right_corner.png Binary file libgui/src/icons/cursors/top_right_corner.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/cursors/top_side.png Binary file libgui/src/icons/cursors/top_side.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/db-cont.png Binary file libgui/src/icons/db-cont.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/db-cont.svg --- a/libgui/src/icons/db-cont.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1162 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - Jakub Steiner - - - http://jimmac.musichall.cz/ - - - system - applications - group - category - admin - root - - - - - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/db-step-in.png Binary file libgui/src/icons/db-step-in.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/db-step-in.svg --- a/libgui/src/icons/db-step-in.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1185 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - Lapo Calamandrei - - - - - - media - stop - playback - video - music - - - - - Jakub Steiner - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/db-step-out.png Binary file libgui/src/icons/db-step-out.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/db-step-out.svg --- a/libgui/src/icons/db-step-out.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1190 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - Lapo Calamandrei - - - - - - media - stop - playback - video - music - - - - - Jakub Steiner - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/db-step.png Binary file libgui/src/icons/db-step.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/db-step.svg --- a/libgui/src/icons/db-step.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1197 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - Lapo Calamandrei - - - - - - media - stop - playback - video - music - - - - - Jakub Steiner - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/db-stop.png Binary file libgui/src/icons/db-stop.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/db-stop.svg --- a/libgui/src/icons/db-stop.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,677 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - Lapo Calamandrei - - - - - - media - stop - playback - video - music - - - - - Jakub Steiner - - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/dialog-error.png Binary file libgui/src/icons/dialog-error.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/dialog-error.svg --- a/libgui/src/icons/dialog-error.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,330 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - Rodney Dawes - - - - - Jakub Steiner, Garrett LeSage - - - - Dialog Error - - - - - - - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/dialog-information.png Binary file libgui/src/icons/dialog-information.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/dialog-information.svg --- a/libgui/src/icons/dialog-information.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1159 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - Info - - - Jakub Steiner - - - - - dialog - info - - - http://jimmac.musichall.cz - - - - Garrett LeSage - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/dialog-warning.png Binary file libgui/src/icons/dialog-warning.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/dialog-warning.svg --- a/libgui/src/icons/dialog-warning.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,373 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - Dialog Warning - 2005-10-14 - - - Andreas Nilsson - - - - - Jakub Steiner, Garrett LeSage - - - - - dialog - warning - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/document-new.png Binary file libgui/src/icons/document-new.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/document-new.svg --- a/libgui/src/icons/document-new.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,448 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - New Document - - - Jakub Steiner - - - http://jimmac.musichall.cz - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/document-open.png Binary file libgui/src/icons/document-open.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/document-open.svg --- a/libgui/src/icons/document-open.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,535 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - Folder Icon Accept - 2005-01-31 - - - Jakub Steiner - - - - http://jimmac.musichall.cz - Active state - when files are being dragged to. - - - Novell, Inc. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/document-print.png Binary file libgui/src/icons/document-print.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/document-print.svg --- a/libgui/src/icons/document-print.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,532 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - Print Document - - - Jakub Steiner - - - - http://jimmac.musichall.cz - - - document - lpr - print - local - laser - bubblejet - inkjet - print - output - cups - lpd - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/document-save-as.png Binary file libgui/src/icons/document-save-as.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/document-save-as.svg --- a/libgui/src/icons/document-save-as.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,663 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - Save As - - - Jakub Steiner - - - - - hdd - hard drive - save as - io - store - - - - - http://jimmac.musichall.cz - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/document-save.png Binary file libgui/src/icons/document-save.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/document-save.svg --- a/libgui/src/icons/document-save.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,619 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - Save - - - Jakub Steiner - - - - - hdd - hard drive - save - io - store - - - - - http://jimmac.musichall.cz - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/edit-copy.png Binary file libgui/src/icons/edit-copy.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/edit-copy.svg --- a/libgui/src/icons/edit-copy.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,328 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - Edit Copy - 2005-10-15 - - - Andreas Nilsson - - - - - edit - copy - - - - - - Jakub Steiner - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/edit-cut.png Binary file libgui/src/icons/edit-cut.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/edit-cut.svg --- a/libgui/src/icons/edit-cut.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,508 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - Edit Cut - - - Garrett Le Sage - - - - - edit - cut - clipboard - - - - - - Jakub Steiner - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/edit-delete.png Binary file libgui/src/icons/edit-delete.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/edit-delete.svg --- a/libgui/src/icons/edit-delete.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,196 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - Delete - 2005-12-28 - - - Andreas Nilsson - - - http://tango-project.org - - - delete - remove - - - - - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/edit-find-replace.png Binary file libgui/src/icons/edit-find-replace.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/edit-find-replace.svg --- a/libgui/src/icons/edit-find-replace.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,974 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - Edit Find Replace - - - edit - find - locate - search - - - - - - Garrett LeSage - - - - - - Jakub Steiner, Steven Garrity - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/edit-find.png Binary file libgui/src/icons/edit-find.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/edit-find.svg --- a/libgui/src/icons/edit-find.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,750 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - Edit Find - - - edit - find - locate - search - - - - - - Steven Garrity - - - - - - Jakub Steiner - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/edit-paste.png Binary file libgui/src/icons/edit-paste.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/edit-paste.svg --- a/libgui/src/icons/edit-paste.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,531 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - Edit Paste - 2005-10-10 - - - Andreas Nilsson - - - - - edit - paste - - - - - - Jakub Steiner - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/edit-redo.png Binary file libgui/src/icons/edit-redo.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/edit-redo.svg --- a/libgui/src/icons/edit-redo.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,231 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - Jakub Steiner - - - http://jimmac.musichall.cz - - Edit Redo - - - edit - redo - again - reapply - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/edit-undo.png Binary file libgui/src/icons/edit-undo.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/edit-undo.svg --- a/libgui/src/icons/edit-undo.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,230 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - Jakub Steiner - - - http://jimmac.musichall.cz - - Edit Undo - - - edit - undo - revert - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/figure-axes.png Binary file libgui/src/icons/figure-axes.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/figure-axes.svg --- a/libgui/src/icons/figure-axes.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,328 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/figure-grid.png Binary file libgui/src/icons/figure-grid.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/figure-grid.svg --- a/libgui/src/icons/figure-grid.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,357 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/figure-pan.png Binary file libgui/src/icons/figure-pan.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/figure-pan.svg --- a/libgui/src/icons/figure-pan.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,971 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - Jakub Steiner - - - http://jimmac.musichall.cz - - - - - view - refresh - reload - reboot - - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/figure-rotate.png Binary file libgui/src/icons/figure-rotate.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/figure-rotate.svg --- a/libgui/src/icons/figure-rotate.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,441 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - Jakub Steiner - - - http://jimmac.musichall.cz - - View Refresh - - - reload - refresh - view - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/figure-text.png Binary file libgui/src/icons/figure-text.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/figure-text.svg --- a/libgui/src/icons/figure-text.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,639 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - Generic font - - - Andreas Nilsson - - - - - the oxygen guys - - - - http://tango-project.org - - - font - type - letter - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/figure-zoom-in.png Binary file libgui/src/icons/figure-zoom-in.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/figure-zoom-in.svg --- a/libgui/src/icons/figure-zoom-in.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1183 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - Martin Ruskov - - - http://commons.wikimedia.org/wiki/Tango_icon - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/figure-zoom-original.png Binary file libgui/src/icons/figure-zoom-original.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/figure-zoom-original.svg --- a/libgui/src/icons/figure-zoom-original.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,306 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - Jakub Steiner - - - http://jimmac.musichall.cz - - - - - - - - - - - - - - - - - - - - - - - 1 - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/figure-zoom-out.png Binary file libgui/src/icons/figure-zoom-out.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/figure-zoom-out.svg --- a/libgui/src/icons/figure-zoom-out.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1180 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - Martin Ruskov - - - http://commons.wikimedia.org/wiki/Tango_icon - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/fleur.png Binary file libgui/src/icons/fleur.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/folder-new.png Binary file libgui/src/icons/folder-new.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/folder-new.svg --- a/libgui/src/icons/folder-new.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,452 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - New Folder - - - - Jakub Steiner - - - - http://jimmac.musichall.cz - - - folder - directory - create - new - - - - - Tuomas Kuosmanen - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/folder.png Binary file libgui/src/icons/folder.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/folder.svg --- a/libgui/src/icons/folder.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,424 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - Folder Icon - - - - Jakub Steiner - - - - http://jimmac.musichall.cz - - - folder - directory - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/go-down.png Binary file libgui/src/icons/go-down.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/go-down.svg --- a/libgui/src/icons/go-down.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,200 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - Jakub Steiner - - - http://jimmac.musichall.cz - - Go Down - - - go - lower - down - arrow - pointer - > - - - - - Andreas Nilsson - - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/go-first.png Binary file libgui/src/icons/go-first.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/go-first.svg --- a/libgui/src/icons/go-first.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,204 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - Jakub Steiner - - - http://jimmac.musichall.cz - - Go Previous - - - go - previous - left - arrow - pointer - < - - - - - Andreas Nilsson - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/go-home.png Binary file libgui/src/icons/go-home.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/go-home.svg --- a/libgui/src/icons/go-home.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,445 +0,0 @@ - -image/svg+xmlGo HomeJakub Steinerhttp://jimmac.musichall.czhomereturngodefaultuserdirectoryTuomas Kuosmanen - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/go-last.png Binary file libgui/src/icons/go-last.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/go-last.svg --- a/libgui/src/icons/go-last.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,204 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - Jakub Steiner - - - http://jimmac.musichall.cz - - Go Next - - - go - next - right - arrow - pointer - > - - - - - Andreas Nilsson - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/go-next.png Binary file libgui/src/icons/go-next.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/go-next.svg --- a/libgui/src/icons/go-next.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,192 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - Jakub Steiner - - - http://jimmac.musichall.cz - - Go Next - - - go - next - right - arrow - pointer - > - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/go-previous.png Binary file libgui/src/icons/go-previous.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/go-previous.svg --- a/libgui/src/icons/go-previous.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,854 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - Jakub Steiner - - - http://jimmac.musichall.cz - - Go Previous - - - go - previous - left - arrow - pointer - < - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/go-up.png Binary file libgui/src/icons/go-up.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/go-up.svg --- a/libgui/src/icons/go-up.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,196 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - Jakub Steiner - - - http://jimmac.musichall.cz - - Go Up - - - go - higher - up - arrow - pointer - > - - - - - Andreas Nilsson - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/graphic_logo_DocumentationDockWidget.png Binary file libgui/src/icons/graphic_logo_DocumentationDockWidget.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/graphic_logo_DocumentationDockWidget.svg --- a/libgui/src/icons/graphic_logo_DocumentationDockWidget.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,731 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/graphic_logo_Figure.png Binary file libgui/src/icons/graphic_logo_Figure.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/graphic_logo_Figure.svg --- a/libgui/src/icons/graphic_logo_Figure.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1226 +0,0 @@ - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/graphic_logo_FileEditor.png Binary file libgui/src/icons/graphic_logo_FileEditor.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/graphic_logo_FileEditor.svg --- a/libgui/src/icons/graphic_logo_FileEditor.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1060 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/graphic_logo_FilesDockWidget.png Binary file libgui/src/icons/graphic_logo_FilesDockWidget.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/graphic_logo_FilesDockWidget.svg --- a/libgui/src/icons/graphic_logo_FilesDockWidget.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1308 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/graphic_logo_HistoryDockWidget.png Binary file libgui/src/icons/graphic_logo_HistoryDockWidget.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/graphic_logo_HistoryDockWidget.svg --- a/libgui/src/icons/graphic_logo_HistoryDockWidget.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1328 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/graphic_logo_NewsDockWidget.png Binary file libgui/src/icons/graphic_logo_NewsDockWidget.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/graphic_logo_NewsDockWidget.svg --- a/libgui/src/icons/graphic_logo_NewsDockWidget.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1156 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/graphic_logo_ReleaseWidget.png Binary file libgui/src/icons/graphic_logo_ReleaseWidget.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/graphic_logo_ReleaseWidget.svg --- a/libgui/src/icons/graphic_logo_ReleaseWidget.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1156 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/graphic_logo_TerminalDockWidget.png Binary file libgui/src/icons/graphic_logo_TerminalDockWidget.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/graphic_logo_TerminalDockWidget.svg --- a/libgui/src/icons/graphic_logo_TerminalDockWidget.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1744 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/graphic_logo_VariableEditor.png Binary file libgui/src/icons/graphic_logo_VariableEditor.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/graphic_logo_VariableEditor.svg --- a/libgui/src/icons/graphic_logo_VariableEditor.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1240 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/graphic_logo_WorkspaceView.png Binary file libgui/src/icons/graphic_logo_WorkspaceView.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/graphic_logo_WorkspaceView.svg --- a/libgui/src/icons/graphic_logo_WorkspaceView.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1175 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/hand2.png Binary file libgui/src/icons/hand2.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/icons_license --- a/libgui/src/icons/icons_license Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,122 +0,0 @@ -=========================================== -Icons based on the Tango-Desktop-Project -=========================================== - -Tango-Desktop-Project: -http://tango.freedesktop.org/Tango_Desktop_Project - -Archive with base icon set available at: -http://tango.freedesktop.org/releases/tango-icon-theme-0.8.90.tar.gz - -License -=========================================== - -The Tango base icon theme is released to the Public Domain. - -Icons used for Octave -=========================================== - -applications-system.svg -bookmark-new.svg -dialog-error.svg -dialog-information.svg -dialog-warning.svg -document-new.svg -document-open.svg -document-print.svg -document-save.svg -document-save-as.svg -edit-copy.svg -edit-cut.svg -edit-delete.svg -edit-find.svg -edit-find-replace.svg -edit-paste.svg -edit-redo.svg -edit-undo.svg -figure-rotate.svg (original file view-refresh.svg) -figure-text.svg (original file font-x-generic.svg) -figure-zoom-in.svg (original file view-zoom-in.svg) -figure-zoom-original.svg (original file view-zoom-original.svg) -figure-zoom-out.svg (original file view-zoom-out.svg) -folder.svg -folder-new.svg -go-down.svg -go-first.svg -go-home.svg -go-last.svg -go-next.svg -go-previous.svg -go-up.svg -preferences-system.svg -user-home.svg -view-refresh.svg -view-refresh.svg - -=========================================== -Icons created by the Octave developers -=========================================== - -figure-axes.svg -figure-grid.svg -logo.png -widget-close.svg -widget-dock.svg -widget-undock.svg - -Icons with elements from the Tango theme -=========================================== - -figure-pan.svg -graphic_logo_DocumentationDockWidget.svg -graphic_logo_Figure.svg -graphic_logo_FileEditor.svg -graphic_logo_FilesDockWidget.svg -graphic_logo_HistoryDockWidget.svg -graphic_logo_NewsDockWidget.svg -graphic_logo_ReleaseWidget.svg -graphic_logo_TerminalDockWidget.svg -graphic_logo_WorkspaceView.svg -letter_logo_DocumentationDockWidget.svg -letter_logo_FileEditor.svg -letter_logo_FilesDockWidget.svg -letter_logo_HistoryDockWidget.svg -letter_logo_NewsDockWidget.svg -letter_logo_ReleaseWidget.svg -letter_logo_TerminalDockWidget.svg -letter_logo_WorkspaceView.svg - -bp-next.svg -bp-prev.svg -bp-rm_all.svg -bp-toggle.svg -db-cont.svg -db-step-in.svg -db-step-out.svg -db-step.svg -db-stop.svg -plot-xy-curve.svg -system-run.svg - -Cursors from the standard DMZ theme -=================================== - -https://github.com/GalliumOS/dmz-cursor-theme/tree/master/DMZ-White - -bottom_left_corner.png -bottom_right_corner.png -bottom_side.png -cross.png -fleur.png -hand2.png -left_side.png -right_side.png -top_left_corner.png -top_right_corner.png -top_side.png - -Cursor created by the Octave developers -with elements from the DMZ theme: - -circle.png -circle.svg diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/left_side.png Binary file libgui/src/icons/left_side.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/letter_logo_DocumentationDockWidget.png Binary file libgui/src/icons/letter_logo_DocumentationDockWidget.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/letter_logo_DocumentationDockWidget.svg --- a/libgui/src/icons/letter_logo_DocumentationDockWidget.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,363 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - D - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/letter_logo_FileEditor.png Binary file libgui/src/icons/letter_logo_FileEditor.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/letter_logo_FileEditor.svg --- a/libgui/src/icons/letter_logo_FileEditor.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,375 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - E - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/letter_logo_FilesDockWidget.png Binary file libgui/src/icons/letter_logo_FilesDockWidget.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/letter_logo_FilesDockWidget.svg --- a/libgui/src/icons/letter_logo_FilesDockWidget.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,375 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - F - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/letter_logo_HistoryDockWidget.png Binary file libgui/src/icons/letter_logo_HistoryDockWidget.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/letter_logo_HistoryDockWidget.svg --- a/libgui/src/icons/letter_logo_HistoryDockWidget.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,363 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - H - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/letter_logo_NewsDockWidget.png Binary file libgui/src/icons/letter_logo_NewsDockWidget.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/letter_logo_NewsDockWidget.svg --- a/libgui/src/icons/letter_logo_NewsDockWidget.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,363 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - N - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/letter_logo_ReleaseWidget.png Binary file libgui/src/icons/letter_logo_ReleaseWidget.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/letter_logo_ReleaseWidget.svg --- a/libgui/src/icons/letter_logo_ReleaseWidget.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,363 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - R - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/letter_logo_TerminalDockWidget.png Binary file libgui/src/icons/letter_logo_TerminalDockWidget.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/letter_logo_TerminalDockWidget.svg --- a/libgui/src/icons/letter_logo_TerminalDockWidget.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,363 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - C - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/letter_logo_VariableEditor.png Binary file libgui/src/icons/letter_logo_VariableEditor.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/letter_logo_VariableEditor.svg --- a/libgui/src/icons/letter_logo_VariableEditor.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,332 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - V - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/letter_logo_WorkspaceView.png Binary file libgui/src/icons/letter_logo_WorkspaceView.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/letter_logo_WorkspaceView.svg --- a/libgui/src/icons/letter_logo_WorkspaceView.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,375 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - W - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/license.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/license.md Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,94 @@ +# Icons for Octave + +## Icons based on the Tango-Desktop-Project + +The icons in the directory **tango** are taken from the Tango-Desktop-Projekt + +- [Tango-Desktop-Project](http://tango.freedesktop.org/Tango_Desktop_Project) +- [Archive with base icon set}(http://tango.freedesktop.org/releases/tango-icon-theme-0.8.90.tar.gz) + +The Tango base icon theme is released to the Public Domain. + +The following icons are created by the Octave developers using elements +of the tango icon theme: + +- bp-next.svg +- bp-prev.svg +- bp-rm_all.svg +- bp-toggle.svg +- db-cont.svg +- db-step-in.svg +- db-step-out.svg +- db-step.svg +- db-stop.svg + + +## Icons by Octave developers + +The icons in the directory **octave** are created by the Octave developers. + +### Completely new icons + +- figure-axes.svg +- figure-grid.svg +- logo.png +- widget-close.svg +- widget-dock.svg +- widget-undock.svg + +### Icons with elements of the Tango theme + +- figure-pan.svg +- graphic_logo_DocumentationDockWidget.svg +- graphic_logo_Figure.svg +- graphic_logo_FileEditor.svg +- graphic_logo_FilesDockWidget.svg +- graphic_logo_HistoryDockWidget.svg +- graphic_logo_NewsDockWidget.svg +- graphic_logo_ReleaseWidget.svg +- graphic_logo_TerminalDockWidget.svg +- graphic_logo_WorkspaceView.svg +- letter_logo_DocumentationDockWidget.svg +- letter_logo_FileEditor.svg +- letter_logo_FilesDockWidget.svg +- letter_logo_HistoryDockWidget.svg +- letter_logo_NewsDockWidget.svg +- letter_logo_ReleaseWidget.svg +- letter_logo_TerminalDockWidget.svg +- letter_logo_WorkspaceView.svg +- bp-next.svg +- bp-prev.svg +- bp-rm_all.svg +- bp-toggle.svg +- db-cont.svg +- db-step-in.svg +- db-step-out.svg +- db-step.svg +- db-stop.svg +- plot-xy-curve.svg +- system-run.svg + + +## Cursor icons + +The directory **cursors** contains cursor icons required by Octave. +The following cursors are taken from the [standrad DMZ theme](https://github.com/GalliumOS/dmz-cursor-theme/tree/master/DMZ-White): + +- bottom_left_corner.png +- bottom_right_corner.png +- bottom_side.png +- cross.png +- fleur.png +- hand2.png +- left_side.png +- right_side.png +- top_left_corner.png +- top_right_corner.png +- top_side.png + +## Cursor created by the Octave developers + +The following cursors are created by the Octave developers with elements from the DMZ theme: + +- circle.png +- circle.svg diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/logo.png Binary file libgui/src/icons/logo.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/applications-system.png Binary file libgui/src/icons/octave/128x128/applications-system.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/bookmark-new.png Binary file libgui/src/icons/octave/128x128/bookmark-new.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/bp-next.png Binary file libgui/src/icons/octave/128x128/bp-next.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/bp-prev.png Binary file libgui/src/icons/octave/128x128/bp-prev.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/bp-rm-all.png Binary file libgui/src/icons/octave/128x128/bp-rm-all.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/bp-toggle.png Binary file libgui/src/icons/octave/128x128/bp-toggle.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/db-cont.png Binary file libgui/src/icons/octave/128x128/db-cont.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/db-step-in.png Binary file libgui/src/icons/octave/128x128/db-step-in.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/db-step-out.png Binary file libgui/src/icons/octave/128x128/db-step-out.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/db-step.png Binary file libgui/src/icons/octave/128x128/db-step.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/db-stop.png Binary file libgui/src/icons/octave/128x128/db-stop.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/dialog-error.png Binary file libgui/src/icons/octave/128x128/dialog-error.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/document-new.png Binary file libgui/src/icons/octave/128x128/document-new.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/document-open.png Binary file libgui/src/icons/octave/128x128/document-open.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/document-print.png Binary file libgui/src/icons/octave/128x128/document-print.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/document-save-as.png Binary file libgui/src/icons/octave/128x128/document-save-as.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/document-save.png Binary file libgui/src/icons/octave/128x128/document-save.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/edit-copy.png Binary file libgui/src/icons/octave/128x128/edit-copy.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/edit-cut.png Binary file libgui/src/icons/octave/128x128/edit-cut.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/edit-find-replace.png Binary file libgui/src/icons/octave/128x128/edit-find-replace.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/edit-find.png Binary file libgui/src/icons/octave/128x128/edit-find.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/edit-paste.png Binary file libgui/src/icons/octave/128x128/edit-paste.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/edit-redo.png Binary file libgui/src/icons/octave/128x128/edit-redo.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/edit-undo.png Binary file libgui/src/icons/octave/128x128/edit-undo.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/figure-axes.png Binary file libgui/src/icons/octave/128x128/figure-axes.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/figure-grid.png Binary file libgui/src/icons/octave/128x128/figure-grid.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/figure-pan.png Binary file libgui/src/icons/octave/128x128/figure-pan.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/figure-rotate.png Binary file libgui/src/icons/octave/128x128/figure-rotate.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/figure-text.png Binary file libgui/src/icons/octave/128x128/figure-text.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/figure-zoom-in.png Binary file libgui/src/icons/octave/128x128/figure-zoom-in.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/figure-zoom-original.png Binary file libgui/src/icons/octave/128x128/figure-zoom-original.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/figure-zoom-out.png Binary file libgui/src/icons/octave/128x128/figure-zoom-out.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/folder-new.png Binary file libgui/src/icons/octave/128x128/folder-new.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/folder-up.png Binary file libgui/src/icons/octave/128x128/folder-up.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/folder.png Binary file libgui/src/icons/octave/128x128/folder.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/go-down.png Binary file libgui/src/icons/octave/128x128/go-down.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/go-first.png Binary file libgui/src/icons/octave/128x128/go-first.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/go-last.png Binary file libgui/src/icons/octave/128x128/go-last.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/go-next.png Binary file libgui/src/icons/octave/128x128/go-next.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/go-previous.png Binary file libgui/src/icons/octave/128x128/go-previous.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/go-up.png Binary file libgui/src/icons/octave/128x128/go-up.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/graphic_logo_DocumentationDockWidget.png Binary file libgui/src/icons/octave/128x128/graphic_logo_DocumentationDockWidget.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/graphic_logo_Figure.png Binary file libgui/src/icons/octave/128x128/graphic_logo_Figure.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/graphic_logo_FileEditor.png Binary file libgui/src/icons/octave/128x128/graphic_logo_FileEditor.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/graphic_logo_FilesDockWidget.png Binary file libgui/src/icons/octave/128x128/graphic_logo_FilesDockWidget.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/graphic_logo_HistoryDockWidget.png Binary file libgui/src/icons/octave/128x128/graphic_logo_HistoryDockWidget.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/graphic_logo_NewsDockWidget.png Binary file libgui/src/icons/octave/128x128/graphic_logo_NewsDockWidget.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/graphic_logo_ReleaseWidget.png Binary file libgui/src/icons/octave/128x128/graphic_logo_ReleaseWidget.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/graphic_logo_TerminalDockWidget.png Binary file libgui/src/icons/octave/128x128/graphic_logo_TerminalDockWidget.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/graphic_logo_VariableEditor.png Binary file libgui/src/icons/octave/128x128/graphic_logo_VariableEditor.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/graphic_logo_WorkspaceView.png Binary file libgui/src/icons/octave/128x128/graphic_logo_WorkspaceView.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/letter_logo_DocumentationDockWidget.png Binary file libgui/src/icons/octave/128x128/letter_logo_DocumentationDockWidget.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/letter_logo_FileEditor.png Binary file libgui/src/icons/octave/128x128/letter_logo_FileEditor.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/letter_logo_FilesDockWidget.png Binary file libgui/src/icons/octave/128x128/letter_logo_FilesDockWidget.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/letter_logo_HistoryDockWidget.png Binary file libgui/src/icons/octave/128x128/letter_logo_HistoryDockWidget.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/letter_logo_NewsDockWidget.png Binary file libgui/src/icons/octave/128x128/letter_logo_NewsDockWidget.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/letter_logo_ReleaseWidget.png Binary file libgui/src/icons/octave/128x128/letter_logo_ReleaseWidget.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/letter_logo_TerminalDockWidget.png Binary file libgui/src/icons/octave/128x128/letter_logo_TerminalDockWidget.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/letter_logo_VariableEditor.png Binary file libgui/src/icons/octave/128x128/letter_logo_VariableEditor.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/letter_logo_WorkspaceView.png Binary file libgui/src/icons/octave/128x128/letter_logo_WorkspaceView.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/logo.png Binary file libgui/src/icons/octave/128x128/logo.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/plot-xy-curve.png Binary file libgui/src/icons/octave/128x128/plot-xy-curve.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/system-run.png Binary file libgui/src/icons/octave/128x128/system-run.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/user-home.png Binary file libgui/src/icons/octave/128x128/user-home.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/widget-close-light.png Binary file libgui/src/icons/octave/128x128/widget-close-light.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/widget-close.png Binary file libgui/src/icons/octave/128x128/widget-close.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/widget-dock-light.png Binary file libgui/src/icons/octave/128x128/widget-dock-light.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/widget-dock.png Binary file libgui/src/icons/octave/128x128/widget-dock.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/widget-undock-light.png Binary file libgui/src/icons/octave/128x128/widget-undock-light.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/128x128/widget-undock.png Binary file libgui/src/icons/octave/128x128/widget-undock.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/index.theme --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/index.theme Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,18 @@ +[Icon Theme] +Name=Octave-icons +Comment=icon theme for octave + +# Directory list +Directories=scalable,128 + +[scalable] +Size=48 +MinSize=16 +MaxSize=512 +Type=Scalable + +[128x128] +Size=128 +MinSize=16 +MaxSize=512 +Type=Scalable diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/applications-system.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/applications-system.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/bookmark-new.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/bookmark-new.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/bp-next.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/bp-next.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/bp-prev.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/bp-prev.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/bp-rm-all.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/bp-rm-all.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/bp-toggle.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/bp-toggle.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/db-cont.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/db-cont.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/db-step-in.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/db-step-in.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/db-step-out.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/db-step-out.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/db-step.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/db-step.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/db-stop.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/db-stop.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/dialog-error.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/dialog-error.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/document-new.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/document-new.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/document-open.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/document-open.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/document-print.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/document-print.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/document-save-as.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/document-save-as.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/document-save.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/document-save.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/edit-copy.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/edit-copy.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/edit-cut.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/edit-cut.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/edit-find-replace.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/edit-find-replace.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/edit-find.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/edit-find.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/edit-paste.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/edit-paste.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/edit-redo.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/edit-redo.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/edit-undo.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/edit-undo.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/figure-axes.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/figure-axes.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,328 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/figure-grid.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/figure-grid.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,357 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/figure-pan.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/figure-pan.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,971 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + Jakub Steiner + + + http://jimmac.musichall.cz + + + + + view + refresh + reload + reboot + + + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/figure-rotate.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/figure-rotate.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,441 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + Jakub Steiner + + + http://jimmac.musichall.cz + + View Refresh + + + reload + refresh + view + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/figure-text.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/figure-text.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,639 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Generic font + + + Andreas Nilsson + + + + + the oxygen guys + + + + http://tango-project.org + + + font + type + letter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/figure-zoom-in.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/figure-zoom-in.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1183 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + Martin Ruskov + + + http://commons.wikimedia.org/wiki/Tango_icon + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/figure-zoom-original.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/figure-zoom-original.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,306 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + Jakub Steiner + + + http://jimmac.musichall.cz + + + + + + + + + + + + + + + + + + + + + + + 1 + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/figure-zoom-out.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/figure-zoom-out.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1180 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + Martin Ruskov + + + http://commons.wikimedia.org/wiki/Tango_icon + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/folder-new.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/folder-new.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/folder-up.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/folder-up.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/folder.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/folder.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/go-down.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/go-down.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/go-first.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/go-first.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/go-last.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/go-last.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/go-next.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/go-next.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/go-previous.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/go-previous.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/go-up.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/go-up.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/graphic_logo_DocumentationDockWidget.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/graphic_logo_DocumentationDockWidget.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,731 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/graphic_logo_Figure.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/graphic_logo_Figure.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1226 @@ + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/graphic_logo_FileEditor.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/graphic_logo_FileEditor.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1060 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/graphic_logo_FilesDockWidget.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/graphic_logo_FilesDockWidget.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1308 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/graphic_logo_HistoryDockWidget.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/graphic_logo_HistoryDockWidget.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1328 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/graphic_logo_NewsDockWidget.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/graphic_logo_NewsDockWidget.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1156 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/graphic_logo_ReleaseWidget.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/graphic_logo_ReleaseWidget.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1156 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/graphic_logo_TerminalDockWidget.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/graphic_logo_TerminalDockWidget.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1744 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/graphic_logo_VariableEditor.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/graphic_logo_VariableEditor.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1240 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/graphic_logo_WorkspaceView.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/graphic_logo_WorkspaceView.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1175 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/letter_logo_DocumentationDockWidget.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/letter_logo_DocumentationDockWidget.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,363 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + D + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/letter_logo_FileEditor.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/letter_logo_FileEditor.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,375 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + E + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/letter_logo_FilesDockWidget.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/letter_logo_FilesDockWidget.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,375 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + F + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/letter_logo_HistoryDockWidget.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/letter_logo_HistoryDockWidget.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,363 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + H + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/letter_logo_NewsDockWidget.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/letter_logo_NewsDockWidget.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,363 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + N + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/letter_logo_ReleaseWidget.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/letter_logo_ReleaseWidget.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,363 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + R + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/letter_logo_TerminalDockWidget.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/letter_logo_TerminalDockWidget.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,363 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + C + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/letter_logo_VariableEditor.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/letter_logo_VariableEditor.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,332 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + V + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/letter_logo_WorkspaceView.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/letter_logo_WorkspaceView.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,375 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + W + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/plot-xy-curve.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/plot-xy-curve.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1214 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + Lapo Calamandrei + + + + + + media + stop + playback + video + music + + + + + Jakub Steiner + + + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/system-run.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/system-run.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/user-home.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/user-home.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/widget-close-light.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/widget-close-light.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,78 @@ + + + + + + + + + image/svg+xml + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/widget-close.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/widget-close.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,78 @@ + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/widget-dock-light.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/widget-dock-light.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/widget-dock.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/widget-dock.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/widget-undock-light.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/widget-undock-light.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/octave/scalable/widget-undock.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/widget-undock.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/plot-xy-curve.png Binary file libgui/src/icons/plot-xy-curve.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/plot-xy-curve.svg --- a/libgui/src/icons/plot-xy-curve.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1214 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - Lapo Calamandrei - - - - - - media - stop - playback - video - music - - - - - Jakub Steiner - - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/preferences-system.png Binary file libgui/src/icons/preferences-system.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/preferences-system.svg --- a/libgui/src/icons/preferences-system.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,398 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - Jakub Steiner - - - http://jimmac.musichall.cz - - Preferences System - - - preferences - settings - control panel - tweaks - system - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/right_side.png Binary file libgui/src/icons/right_side.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/system-run.png Binary file libgui/src/icons/system-run.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/system-run.svg --- a/libgui/src/icons/system-run.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1334 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - Jakub Steiner - - - http://jimmac.musichall.cz/ - - - system - applications - group - category - admin - root - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/128x128/applications-system.png Binary file libgui/src/icons/tango/128x128/applications-system.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/128x128/bookmark-new.png Binary file libgui/src/icons/tango/128x128/bookmark-new.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/128x128/bp-next.png Binary file libgui/src/icons/tango/128x128/bp-next.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/128x128/bp-prev.png Binary file libgui/src/icons/tango/128x128/bp-prev.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/128x128/bp-rm-all.png Binary file libgui/src/icons/tango/128x128/bp-rm-all.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/128x128/bp-toggle.png Binary file libgui/src/icons/tango/128x128/bp-toggle.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/128x128/db-cont.png Binary file libgui/src/icons/tango/128x128/db-cont.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/128x128/db-step-in.png Binary file libgui/src/icons/tango/128x128/db-step-in.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/128x128/db-step-out.png Binary file libgui/src/icons/tango/128x128/db-step-out.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/128x128/db-step.png Binary file libgui/src/icons/tango/128x128/db-step.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/128x128/db-stop.png Binary file libgui/src/icons/tango/128x128/db-stop.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/128x128/dialog-error.png Binary file libgui/src/icons/tango/128x128/dialog-error.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/128x128/dialog-information.png Binary file libgui/src/icons/tango/128x128/dialog-information.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/128x128/dialog-warning.png Binary file libgui/src/icons/tango/128x128/dialog-warning.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/128x128/document-new.png Binary file libgui/src/icons/tango/128x128/document-new.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/128x128/document-open.png Binary file libgui/src/icons/tango/128x128/document-open.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/128x128/document-print.png Binary file libgui/src/icons/tango/128x128/document-print.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/128x128/document-save-as.png Binary file libgui/src/icons/tango/128x128/document-save-as.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/128x128/document-save.png Binary file libgui/src/icons/tango/128x128/document-save.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/128x128/edit-copy.png Binary file libgui/src/icons/tango/128x128/edit-copy.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/128x128/edit-cut.png Binary file libgui/src/icons/tango/128x128/edit-cut.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/128x128/edit-delete.png Binary file libgui/src/icons/tango/128x128/edit-delete.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/128x128/edit-find-replace.png Binary file libgui/src/icons/tango/128x128/edit-find-replace.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/128x128/edit-find.png Binary file libgui/src/icons/tango/128x128/edit-find.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/128x128/edit-paste.png Binary file libgui/src/icons/tango/128x128/edit-paste.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/128x128/edit-redo.png Binary file libgui/src/icons/tango/128x128/edit-redo.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/128x128/edit-undo.png Binary file libgui/src/icons/tango/128x128/edit-undo.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/128x128/folder-new.png Binary file libgui/src/icons/tango/128x128/folder-new.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/128x128/folder-up.png Binary file libgui/src/icons/tango/128x128/folder-up.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/128x128/folder.png Binary file libgui/src/icons/tango/128x128/folder.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/128x128/go-down.png Binary file libgui/src/icons/tango/128x128/go-down.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/128x128/go-first.png Binary file libgui/src/icons/tango/128x128/go-first.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/128x128/go-home.png Binary file libgui/src/icons/tango/128x128/go-home.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/128x128/go-last.png Binary file libgui/src/icons/tango/128x128/go-last.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/128x128/go-next.png Binary file libgui/src/icons/tango/128x128/go-next.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/128x128/go-previous.png Binary file libgui/src/icons/tango/128x128/go-previous.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/128x128/go-up.png Binary file libgui/src/icons/tango/128x128/go-up.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/128x128/preferences-system.png Binary file libgui/src/icons/tango/128x128/preferences-system.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/128x128/user-home.png Binary file libgui/src/icons/tango/128x128/user-home.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/128x128/view-refresh.png Binary file libgui/src/icons/tango/128x128/view-refresh.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/128x128/view-zoom-in.png Binary file libgui/src/icons/tango/128x128/view-zoom-in.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/128x128/view-zoom-original.png Binary file libgui/src/icons/tango/128x128/view-zoom-original.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/128x128/view-zoom-out.png Binary file libgui/src/icons/tango/128x128/view-zoom-out.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/index.theme --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/tango/index.theme Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,18 @@ +[Icon Theme] +Name=Tango-icons +Comment=icon theme tango + +# Directory list +Directories=scalable,128 + +[scalable] +Size=48 +MinSize=16 +MaxSize=512 +Type=Scalable + +[128x128] +Size=128 +MinSize=16 +MaxSize=512 +Type=Scalable diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/scalable/applications-system.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/tango/scalable/applications-system.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,247 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + System Applications + + + Jakub Steiner + + + http://jimmac.musichall.cz/ + + + system + applications + group + category + admin + root + + + + + + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/scalable/bookmark-new.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/tango/scalable/bookmark-new.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,672 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + New Bookmark + + + bookmark + remember + favorite + + + + + + Andreas Nilsson + + + + + + Jakub Steiner + + + create bookmark action + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/scalable/bp-next.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/tango/scalable/bp-next.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1072 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + Lapo Calamandrei + + + + + + media + player + record + music + sound + video + + + + + + + + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/scalable/bp-prev.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/tango/scalable/bp-prev.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + Lapo Calamandrei + + + + + + media + player + record + music + sound + video + + + + + + + + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/scalable/bp-rm-all.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/tango/scalable/bp-rm-all.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1243 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + Lapo Calamandrei + + + + + + media + player + record + music + sound + video + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/scalable/bp-toggle.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/tango/scalable/bp-toggle.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,948 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + Lapo Calamandrei + + + + + + media + player + record + music + sound + video + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/scalable/db-cont.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/tango/scalable/db-cont.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1162 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + Jakub Steiner + + + http://jimmac.musichall.cz/ + + + system + applications + group + category + admin + root + + + + + + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/scalable/db-step-in.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/tango/scalable/db-step-in.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1185 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + Lapo Calamandrei + + + + + + media + stop + playback + video + music + + + + + Jakub Steiner + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/scalable/db-step-out.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/tango/scalable/db-step-out.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1190 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + Lapo Calamandrei + + + + + + media + stop + playback + video + music + + + + + Jakub Steiner + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/scalable/db-step.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/tango/scalable/db-step.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1197 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + Lapo Calamandrei + + + + + + media + stop + playback + video + music + + + + + Jakub Steiner + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/scalable/db-stop.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/tango/scalable/db-stop.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,677 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + Lapo Calamandrei + + + + + + media + stop + playback + video + music + + + + + Jakub Steiner + + + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/scalable/dialog-error.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/tango/scalable/dialog-error.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,330 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + Rodney Dawes + + + + + Jakub Steiner, Garrett LeSage + + + + Dialog Error + + + + + + + + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/scalable/dialog-information.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/tango/scalable/dialog-information.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,1159 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Info + + + Jakub Steiner + + + + + dialog + info + + + http://jimmac.musichall.cz + + + + Garrett LeSage + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/scalable/dialog-warning.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/tango/scalable/dialog-warning.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,373 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Dialog Warning + 2005-10-14 + + + Andreas Nilsson + + + + + Jakub Steiner, Garrett LeSage + + + + + dialog + warning + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/scalable/document-new.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/tango/scalable/document-new.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,448 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + New Document + + + Jakub Steiner + + + http://jimmac.musichall.cz + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/scalable/document-open.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/tango/scalable/document-open.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,535 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Folder Icon Accept + 2005-01-31 + + + Jakub Steiner + + + + http://jimmac.musichall.cz + Active state - when files are being dragged to. + + + Novell, Inc. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/scalable/document-print.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/tango/scalable/document-print.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,532 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Print Document + + + Jakub Steiner + + + + http://jimmac.musichall.cz + + + document + lpr + print + local + laser + bubblejet + inkjet + print + output + cups + lpd + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/scalable/document-save-as.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/tango/scalable/document-save-as.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,663 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Save As + + + Jakub Steiner + + + + + hdd + hard drive + save as + io + store + + + + + http://jimmac.musichall.cz + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/scalable/document-save.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/tango/scalable/document-save.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,619 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Save + + + Jakub Steiner + + + + + hdd + hard drive + save + io + store + + + + + http://jimmac.musichall.cz + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/scalable/edit-copy.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/tango/scalable/edit-copy.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,328 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Edit Copy + 2005-10-15 + + + Andreas Nilsson + + + + + edit + copy + + + + + + Jakub Steiner + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/scalable/edit-cut.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/tango/scalable/edit-cut.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,508 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Edit Cut + + + Garrett Le Sage + + + + + edit + cut + clipboard + + + + + + Jakub Steiner + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/scalable/edit-delete.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/tango/scalable/edit-delete.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Delete + 2005-12-28 + + + Andreas Nilsson + + + http://tango-project.org + + + delete + remove + + + + + + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/scalable/edit-find-replace.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/tango/scalable/edit-find-replace.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,974 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Edit Find Replace + + + edit + find + locate + search + + + + + + Garrett LeSage + + + + + + Jakub Steiner, Steven Garrity + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/scalable/edit-find.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/tango/scalable/edit-find.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,750 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Edit Find + + + edit + find + locate + search + + + + + + Steven Garrity + + + + + + Jakub Steiner + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/scalable/edit-paste.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/tango/scalable/edit-paste.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,531 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Edit Paste + 2005-10-10 + + + Andreas Nilsson + + + + + edit + paste + + + + + + Jakub Steiner + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/scalable/edit-redo.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/tango/scalable/edit-redo.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,231 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + Jakub Steiner + + + http://jimmac.musichall.cz + + Edit Redo + + + edit + redo + again + reapply + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/scalable/edit-undo.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/tango/scalable/edit-undo.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,230 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + Jakub Steiner + + + http://jimmac.musichall.cz + + Edit Undo + + + edit + undo + revert + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/scalable/folder-new.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/tango/scalable/folder-new.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,452 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + New Folder + + + + Jakub Steiner + + + + http://jimmac.musichall.cz + + + folder + directory + create + new + + + + + Tuomas Kuosmanen + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/scalable/folder-up.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/tango/scalable/folder-up.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + Jakub Steiner + + + http://jimmac.musichall.cz + + Go Up + + + go + higher + up + arrow + pointer + > + + + + + Andreas Nilsson + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/scalable/folder.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/tango/scalable/folder.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,424 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Folder Icon + + + + Jakub Steiner + + + + http://jimmac.musichall.cz + + + folder + directory + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/scalable/go-down.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/tango/scalable/go-down.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,200 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + Jakub Steiner + + + http://jimmac.musichall.cz + + Go Down + + + go + lower + down + arrow + pointer + > + + + + + Andreas Nilsson + + + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/scalable/go-first.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/tango/scalable/go-first.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,204 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + Jakub Steiner + + + http://jimmac.musichall.cz + + Go Previous + + + go + previous + left + arrow + pointer + < + + + + + Andreas Nilsson + + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/scalable/go-home.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/tango/scalable/go-home.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,445 @@ + +image/svg+xmlGo HomeJakub Steinerhttp://jimmac.musichall.czhomereturngodefaultuserdirectoryTuomas Kuosmanen + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/scalable/go-last.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/tango/scalable/go-last.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,204 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + Jakub Steiner + + + http://jimmac.musichall.cz + + Go Next + + + go + next + right + arrow + pointer + > + + + + + Andreas Nilsson + + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/scalable/go-next.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/tango/scalable/go-next.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,192 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + Jakub Steiner + + + http://jimmac.musichall.cz + + Go Next + + + go + next + right + arrow + pointer + > + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/scalable/go-previous.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/tango/scalable/go-previous.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,854 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + Jakub Steiner + + + http://jimmac.musichall.cz + + Go Previous + + + go + previous + left + arrow + pointer + < + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/scalable/go-up.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/tango/scalable/go-up.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + Jakub Steiner + + + http://jimmac.musichall.cz + + Go Up + + + go + higher + up + arrow + pointer + > + + + + + Andreas Nilsson + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/scalable/preferences-system.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/tango/scalable/preferences-system.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,398 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + Jakub Steiner + + + http://jimmac.musichall.cz + + Preferences System + + + preferences + settings + control panel + tweaks + system + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/scalable/user-home.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/tango/scalable/user-home.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,529 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Home Folder Icon + + + + Jakub Steiner + + + + http://jimmac.musichall.cz + + + folder + directory + home + user + + + + + Garrett LeSage + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/scalable/view-refresh.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/tango/scalable/view-refresh.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,393 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + Jakub Steiner + + + http://jimmac.musichall.cz + + View Refresh + + + reload + refresh + view + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/scalable/view-zoom-in.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/tango/scalable/view-zoom-in.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,436 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Add + 2006-01-04 + + + Andreas Nilsson + + + http://tango-project.org + + + add + plus + + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/scalable/view-zoom-original.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/tango/scalable/view-zoom-original.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,371 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + 2006-01-04 + + + Andreas Nilsson + + + http://tango-project.org + + + add + plus + + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/tango/scalable/view-zoom-out.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/tango/scalable/view-zoom-out.svg Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,424 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Remove + 2006-01-04 + + + Andreas Nilsson + + + http://tango-project.org + + + remove + delete + + + + + + + + + + + + + + + + + diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/top_left_corner.png Binary file libgui/src/icons/top_left_corner.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/top_right_corner.png Binary file libgui/src/icons/top_right_corner.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/top_side.png Binary file libgui/src/icons/top_side.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/user-home.png Binary file libgui/src/icons/user-home.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/user-home.svg --- a/libgui/src/icons/user-home.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,529 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - Home Folder Icon - - - - Jakub Steiner - - - - http://jimmac.musichall.cz - - - folder - directory - home - user - - - - - Garrett LeSage - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/view-refresh.png Binary file libgui/src/icons/view-refresh.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/view-refresh.svg --- a/libgui/src/icons/view-refresh.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,393 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - Jakub Steiner - - - http://jimmac.musichall.cz - - View Refresh - - - reload - refresh - view - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/widget-close-light.png Binary file libgui/src/icons/widget-close-light.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/widget-close-light.svg --- a/libgui/src/icons/widget-close-light.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ - - - - - - - - - - - image/svg+xml - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/widget-close.png Binary file libgui/src/icons/widget-close.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/widget-close.svg --- a/libgui/src/icons/widget-close.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ - - - - - - - - - - - image/svg+xml - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/widget-dock-light.png Binary file libgui/src/icons/widget-dock-light.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/widget-dock-light.svg --- a/libgui/src/icons/widget-dock-light.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,95 +0,0 @@ - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/widget-dock.png Binary file libgui/src/icons/widget-dock.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/widget-dock.svg --- a/libgui/src/icons/widget-dock.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,95 +0,0 @@ - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/widget-undock-light.png Binary file libgui/src/icons/widget-undock-light.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/widget-undock-light.svg --- a/libgui/src/icons/widget-undock-light.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,92 +0,0 @@ - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/widget-undock.png Binary file libgui/src/icons/widget-undock.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/widget-undock.svg --- a/libgui/src/icons/widget-undock.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,104 +0,0 @@ - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/zoom-in.png Binary file libgui/src/icons/zoom-in.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/zoom-in.svg --- a/libgui/src/icons/zoom-in.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,436 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - Add - 2006-01-04 - - - Andreas Nilsson - - - http://tango-project.org - - - add - plus - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/zoom-original.png Binary file libgui/src/icons/zoom-original.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/zoom-original.svg --- a/libgui/src/icons/zoom-original.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,371 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - 2006-01-04 - - - Andreas Nilsson - - - http://tango-project.org - - - add - plus - - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/zoom-out.png Binary file libgui/src/icons/zoom-out.png has changed diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/icons/zoom-out.svg --- a/libgui/src/icons/zoom-out.svg Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,424 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - Remove - 2006-01-04 - - - Andreas Nilsson - - - http://tango-project.org - - - remove - delete - - - - - - - - - - - - - - - - - diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/m-editor/file-editor-tab.cc --- a/libgui/src/m-editor/file-editor-tab.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libgui/src/m-editor/file-editor-tab.cc Thu Mar 03 13:37:10 2022 -0500 @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -508,6 +509,9 @@ update_lexer (); } + // set the window title to actual filename (not modified) + update_window_title (m_edit_area->isModified ()); + // update the file editor with current editing directory emit editor_state_changed (m_copy_available, m_is_octave_file, m_edit_area->isModified ()); @@ -531,6 +535,14 @@ return true; } + void file_editor_tab::enable_file_watcher (bool do_enable) + { + if (do_enable) + m_file_system_watcher.addPath (m_file_name); + else + m_file_system_watcher.removePath (m_file_name); + } + // We cannot create a breakpoint when the file is modified // because the line number the editor is providing might // not match what Octave core is interpreting in the @@ -1844,9 +1856,8 @@ QApplication::restoreOverrideCursor (); m_copy_available = false; // no selection yet available + m_edit_area->setModified (false); // loaded file is not modified yet set_file_name (file_to_load); - update_window_title (false); // window title (no modification) - m_edit_area->setModified (false); // loaded file is not modified yet update_eol_indicator (); @@ -2183,7 +2194,7 @@ bool remove_on_success, bool restore_breakpoints) { - QFile file (file_to_save); + QSaveFile file (file_to_save); // stop watching file QStringList trackedFiles = m_file_system_watcher.files (); @@ -2239,36 +2250,47 @@ out.flush (); QApplication::restoreOverrideCursor (); - file.flush (); - file.close (); - - // file exists now - QFileInfo file_info = QFileInfo (file); - QString full_file_to_save = file_info.canonicalFilePath (); - - // save filename after closing file as set_file_name starts watching again - set_file_name (full_file_to_save); // make absolute - - // set the window title to actual filename (not modified) - update_window_title (false); - - // file is save -> not modified, update encoding in statusbar - m_edit_area->setModified (false); - m_enc_indicator->setText (m_encoding); - - emit tab_ready_to_close (); - - if (remove_on_success) + + // Finish writing by committing the changes to disk, + // where nothing is done when an error occurred while writing above + bool writing_ok = file.commit (); + + if (writing_ok) { - emit tab_remove_request (); - return; // Don't touch member variables after removal + // Writing was successful: file exists now + QFileInfo file_info = QFileInfo (file.fileName ()); + QString full_file_to_save = file_info.canonicalFilePath (); + + // file is save -> not modified, update encoding in statusbar + m_edit_area->setModified (false); + m_enc_indicator->setText (m_encoding); + + // save filename after closing file as set_file_name starts watching again + set_file_name (full_file_to_save); // make absolute + + emit tab_ready_to_close (); + + if (remove_on_success) + { + emit tab_remove_request (); + return; // Don't touch member variables after removal + } + + // Attempt to restore the breakpoints if that is desired. + // This is only allowed if the tab is not closing since changing + // breakpoints would reopen the tab in this case. + if (restore_breakpoints) + check_restore_breakpoints (); } - - // Attempt to restore the breakpoints if that is desired. - // This is only allowed if the tab is not closing since changing - // breakpoints would reopen the tab in this case. - if (restore_breakpoints) - check_restore_breakpoints (); + else + { + QMessageBox::critical (nullptr, + tr ("Octave Editor"), + tr ("The changes could not be saved to the file\n" + "%1") + .arg (file.fileName ()) + ); + } } void file_editor_tab::save_file_as (bool remove_on_success) diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/m-editor/file-editor-tab.h --- a/libgui/src/m-editor/file-editor-tab.h Thu Mar 03 13:31:24 2022 -0500 +++ b/libgui/src/m-editor/file-editor-tab.h Thu Mar 03 13:37:10 2022 -0500 @@ -64,6 +64,8 @@ bool conditional_close (void); void update_breakpoints (); + void set_file_name (const QString& fileName); + void enable_file_watcher (bool do_enable); QString file_name (void) const { return m_file_name; } QString encoding (void) const { return m_encoding; } @@ -255,7 +257,6 @@ protected: void closeEvent (QCloseEvent *event); - void set_file_name (const QString& fileName); private: diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/m-editor/file-editor.cc --- a/libgui/src/m-editor/file-editor.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libgui/src/m-editor/file-editor.cc Thu Mar 03 13:37:10 2022 -0500 @@ -1167,7 +1167,7 @@ { // Clear old list of file data and declare a structure for file data m_tmp_closed_files.clear (); - session_data f_data; + removed_file_data f_data; // Preprocessing old name(s) QString old_name_clean = old_name.trimmed (); @@ -1201,22 +1201,12 @@ if (editor_tab) { - // Get index and line. - - f_data.encoding = editor_tab->encoding (); - f_data.index = m_tab_widget->indexOf (editor_tab); - int l, c; - editor_tab->qsci_edit_area ()->getCursorPosition (&l, &c); - f_data.line = l + 1; - - // Close it silently - m_no_focus = true; // Remember for not focussing editor - editor_tab->file_has_changed (QString (), true); // Close the tab - m_no_focus = false; // Back to normal - - // For reloading old file if error while removing - f_data.file_name = old_names.at (i); - // For reloading new file (if new_file is not empty) + + editor_tab->enable_file_watcher (false); + + // For re-enabling tracking if error while removing/renaming + f_data.editor_tab = editor_tab; + // For renaming into new file (if new_file is not empty) if (new_is_dir) { std::string ndir = new_name.toStdString (); @@ -1239,27 +1229,24 @@ { m_no_focus = true; // Remember for not focussing editor - // Loop over all files that have to be reloaded. Start at the end of the + // Loop over all files that have to be handled. Start at the end of the // list, otherwise the stored indexes are not correct. for (int i = m_tmp_closed_files.count () - 1; i >= 0; i--) { - // Load old or new file if (load_new) { - if (! m_tmp_closed_files.at (i).new_file_name.isEmpty ()) - request_open_file (m_tmp_closed_files.at (i).new_file_name, - m_tmp_closed_files.at (i).encoding, - m_tmp_closed_files.at (i).line, - false, false, true, "", - m_tmp_closed_files.at (i).index); + // Close file (remove) or rename into new file (rename) + if (m_tmp_closed_files.at (i).new_file_name.isEmpty ()) + m_tmp_closed_files.at (i).editor_tab->file_has_changed (QString (), true); + else + m_tmp_closed_files.at (i).editor_tab->set_file_name ( + m_tmp_closed_files.at (i).new_file_name); } else { - request_open_file (m_tmp_closed_files.at (i).file_name, - m_tmp_closed_files.at (i).encoding, - m_tmp_closed_files.at (i).line, - false, false, true, "", - m_tmp_closed_files.at (i).index); + // Something went wrong while renaming or removing: + // Leave everything as it is but reactivate tracking + m_tmp_closed_files.at (i).editor_tab->enable_file_watcher (true); } } @@ -2215,15 +2202,16 @@ view_menu->addSeparator (); m_zoom_in_action - = add_action (view_menu, rmgr.icon ("zoom-in"), tr ("Zoom &In"), + = add_action (view_menu, rmgr.icon ("view-zoom-in"), tr ("Zoom &In"), SLOT (zoom_in (bool))); m_zoom_out_action - = add_action (view_menu, rmgr.icon ("zoom-out"), tr ("Zoom &Out"), + = add_action (view_menu, rmgr.icon ("view-zoom-out"), tr ("Zoom &Out"), SLOT (zoom_out (bool))); m_zoom_normal_action - = add_action (view_menu, tr ("&Normal Size"), SLOT (zoom_normal (bool))); + = add_action (view_menu, rmgr.icon ("view-zoom-original"), tr ("&Normal Size"), + SLOT (zoom_normal (bool))); view_menu->addSeparator (); @@ -2704,7 +2692,7 @@ const QString& new_name) { QDir old_dir (old_name); - session_data f_data; + removed_file_data f_data; std::list editor_tab_lst = m_tab_widget->tab_list (); @@ -2731,52 +2719,39 @@ && (rel_path_to_file.left (3) != QString ("../"))) { // The currently considered file is included in the - // removed/renamed diectory: Delete it. - m_no_focus = true; // Remember for not focussing editor - + // removed/renamed diectory: remeber it if (editor_tab) { - // Get index and line - int l, c; - editor_tab->qsci_edit_area ()->getCursorPosition (&l, &c); - f_data.line = l + 1; - f_data.index = m_tab_widget->indexOf (editor_tab); - // Close - editor_tab->file_has_changed (QString (), true); - } - m_no_focus = false; // Back to normal - - // Store file for possible later reload - f_data.file_name = file_name; - - // Add the new file path and the encoding for later reloading - // if new_name is given - if (! new_name.isEmpty ()) - { - QDir new_dir (new_name); - QString append_to_new_dir; - if (new_dir.exists ()) + editor_tab->enable_file_watcher (false); + f_data.editor_tab = editor_tab; + + // Add the new file path and the encoding for later reloading + // if new_name is given + if (! new_name.isEmpty ()) { - // The new directory already exists (movefile was used). - // This means, we have to add the name (not the path) - // of the old dir and the relative path to the file - // to new dir. - append_to_new_dir - = old_dir.dirName () + "/" + rel_path_to_file; + QDir new_dir (new_name); + QString append_to_new_dir; + if (new_dir.exists ()) + { + // The new directory already exists (movefile was used). + // This means, we have to add the name (not the path) + // of the old dir and the relative path to the file + // to new dir. + append_to_new_dir + = old_dir.dirName () + "/" + rel_path_to_file; + } + else + append_to_new_dir = rel_path_to_file; + + f_data.new_file_name + = new_dir.absoluteFilePath (append_to_new_dir); } else - append_to_new_dir = rel_path_to_file; - - f_data.new_file_name - = new_dir.absoluteFilePath (append_to_new_dir); + f_data.new_file_name = ""; // no new name, just removing this file + + // Store data in list for later reloading + m_tmp_closed_files << f_data; } - else - f_data.new_file_name = ""; // no new name, just removing this file - - f_data.encoding = editor_tab->encoding (); // store the encoding - - // Store data in list for later reloading - m_tmp_closed_files << f_data; } } } diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/m-editor/file-editor.h --- a/libgui/src/m-editor/file-editor.h Thu Mar 03 13:31:24 2022 -0500 +++ b/libgui/src/m-editor/file-editor.h Thu Mar 03 13:37:10 2022 -0500 @@ -89,6 +89,12 @@ } }; + struct removed_file_data + { + file_editor_tab *editor_tab; + QString new_file_name; + }; + file_editor (QWidget *p, base_qobject& oct_qobj); ~file_editor (void) = default; @@ -487,7 +493,7 @@ QPointer m_find_dialog; // List of data on temporarily closed files for later reloading. - QList m_tmp_closed_files; + QList m_tmp_closed_files; }; } diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/m-editor/find-dialog.cc --- a/libgui/src/m-editor/find-dialog.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libgui/src/m-editor/find-dialog.cc Thu Mar 03 13:37:10 2022 -0500 @@ -71,7 +71,6 @@ #include #include #include -#include #include #include #include @@ -83,6 +82,7 @@ #include "find-dialog.h" #include "gui-preferences-ed.h" +#include "gui-utils.h" #include "resource-manager.h" #include "octave-qobject.h" @@ -293,27 +293,21 @@ m_backward_check_box->setChecked (FIND_DLG_BACK & opts); m_search_selection_check_box->setChecked (FIND_DLG_SEL & opts); - // Position: lower right of editor's position + // Default position: lower right of editor's position int xp = ed_bottom_right.x () - sizeHint ().width (); int yp = ed_bottom_right.y () - sizeHint ().height (); - - m_last_position = s->value (ed_fdlg_pos.key, QPoint (xp, yp)).toPoint (); - move (m_last_position); + QRect default_geometry (xp, yp, sizeHint ().width (), sizeHint ().height ()); - if (QApplication::desktop ()->screenNumber (this) == -1) - { - // Last used position is not on screen anymore, use default pos. - m_last_position = QPoint (xp, yp); - move (m_last_position); + // Last position from settings + m_last_position = s->value (ed_fdlg_pos.key, QPoint (xp, yp)).toPoint (); + QRect last_geometry (m_last_position, + QSize (sizeHint ().width (), sizeHint ().height ())); - if (QApplication::desktop ()->screenNumber (this) == -1) - { - // Default position is not on screen, last resort - m_last_position = QPoint (50, 100); // upper left - move (m_last_position); - } - } + // Make sure we are on the screen + adjust_to_screen (last_geometry, default_geometry); + m_last_position = last_geometry.topLeft (); + move (m_last_position); } // set text of "search from start" depending on backward search diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/main-window.cc --- a/libgui/src/main-window.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libgui/src/main-window.cc Thu Mar 03 13:37:10 2022 -0500 @@ -35,7 +35,6 @@ #include #include #include -#include #include #include #include @@ -69,6 +68,7 @@ #include "gui-preferences-nr.h" #include "gui-preferences-sc.h" #include "gui-settings.h" +#include "gui-utils.h" #include "interpreter-qobject.h" #include "main-window.h" #include "news-reader.h" @@ -135,6 +135,8 @@ setObjectName (gui_obj_name_main_window); + rmgr.config_icon_theme (); + rmgr.update_network_settings (); // We provide specific terminal capabilities, so ensure that @@ -828,7 +830,6 @@ // Wait for worker to suspend qt_link->lock (); - // Close the file if opened #if defined (HAVE_QSCINTILLA) m_editor_window->handle_file_remove (o, n); @@ -2592,7 +2593,7 @@ m_main_tool_bar->addWidget (m_current_directory_combo_box); resource_manager& rmgr = m_octave_qobj.get_resource_manager (); QAction *current_dir_up - = m_main_tool_bar->addAction (rmgr.icon ("go-up"), + = m_main_tool_bar->addAction (rmgr.icon ("folder-up"), tr ("One directory up")); QAction *current_dir_search = m_main_tool_bar->addAction (rmgr.icon ("folder"), @@ -2729,15 +2730,6 @@ }); } - // Get size of screen where the main window is located - void main_window::get_screen_geometry (int& width, int& height) - { - QRect screen_geometry = QApplication::desktop ()->availableGeometry (this); - - width = screen_geometry.width (); - height = screen_geometry.height (); - } - void main_window::resize_dock (QDockWidget *dw, int width, int height) { #if defined (HAVE_QMAINWINDOW_RESIZEDOCKS) diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/main-window.h --- a/libgui/src/main-window.h Thu Mar 03 13:31:24 2022 -0500 +++ b/libgui/src/main-window.h Thu Mar 03 13:37:10 2022 -0500 @@ -299,7 +299,6 @@ void update_default_encoding (const QString& default_encoding); - void get_screen_geometry (int& width, int& height); void set_default_geometry (void); void resize_dock (QDockWidget *dw, int width, int height); diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/module.mk --- a/libgui/src/module.mk Thu Mar 03 13:31:24 2022 -0500 +++ b/libgui/src/module.mk Thu Mar 03 13:37:10 2022 -0500 @@ -1,113 +1,244 @@ octave_gui_ICONS = \ - %reldir%/icons/applications-system.png \ - %reldir%/icons/bookmark-new.png \ - %reldir%/icons/bottom_left_corner.png \ - %reldir%/icons/bottom_right_corner.png \ - %reldir%/icons/bottom_side.png \ - %reldir%/icons/bp-next.png \ - %reldir%/icons/bp-prev.png \ - %reldir%/icons/bp-rm-all.png \ - %reldir%/icons/bp-toggle.png \ - %reldir%/icons/circle.png \ - %reldir%/icons/cross.png \ - %reldir%/icons/db-cont.png \ - %reldir%/icons/db-step-in.png \ - %reldir%/icons/db-step-out.png \ - %reldir%/icons/db-step.png \ - %reldir%/icons/db-stop.png \ - %reldir%/icons/dialog-error.png \ - %reldir%/icons/dialog-information.png \ - %reldir%/icons/dialog-warning.png \ - %reldir%/icons/document-new.png \ - %reldir%/icons/document-open.png \ - %reldir%/icons/document-print.png \ - %reldir%/icons/document-save.png \ - %reldir%/icons/document-save-as.png \ - %reldir%/icons/edit-copy.png \ - %reldir%/icons/edit-cut.png \ - %reldir%/icons/edit-delete.png \ - %reldir%/icons/edit-find.png \ - %reldir%/icons/edit-find-replace.png \ - %reldir%/icons/edit-paste.png \ - %reldir%/icons/edit-redo.png \ - %reldir%/icons/edit-undo.png \ - %reldir%/icons/figure-axes.png \ - %reldir%/icons/figure-grid.png \ - %reldir%/icons/figure-pan.png \ - %reldir%/icons/figure-rotate.png \ - %reldir%/icons/figure-text.png \ - %reldir%/icons/figure-zoom-in.png \ - %reldir%/icons/figure-zoom-original.png \ - %reldir%/icons/figure-zoom-out.png \ - %reldir%/icons/fleur.png \ - %reldir%/icons/folder.png \ - %reldir%/icons/folder-new.png \ - %reldir%/icons/go-down.png \ - %reldir%/icons/go-first.png \ - %reldir%/icons/go-home.png \ - %reldir%/icons/go-last.png \ - %reldir%/icons/go-next.png \ - %reldir%/icons/go-previous.png \ - %reldir%/icons/go-up.png \ - %reldir%/icons/graphic_logo_DocumentationDockWidget.png \ - %reldir%/icons/graphic_logo_Figure.png \ - %reldir%/icons/graphic_logo_FileEditor.png \ - %reldir%/icons/graphic_logo_FilesDockWidget.png \ - %reldir%/icons/graphic_logo_HistoryDockWidget.png \ - %reldir%/icons/graphic_logo_NewsDockWidget.png \ - %reldir%/icons/graphic_logo_TerminalDockWidget.png \ - %reldir%/icons/graphic_logo_WorkspaceView.png \ - %reldir%/icons/graphic_logo_ReleaseWidget.png \ - %reldir%/icons/graphic_logo_VariableEditor.png \ - %reldir%/icons/graphic_logo_DocumentationDockWidget.svg \ - %reldir%/icons/graphic_logo_FileEditor.svg \ - %reldir%/icons/graphic_logo_FilesDockWidget.svg \ - %reldir%/icons/graphic_logo_HistoryDockWidget.svg \ - %reldir%/icons/graphic_logo_NewsDockWidget.svg \ - %reldir%/icons/graphic_logo_TerminalDockWidget.svg \ - %reldir%/icons/graphic_logo_WorkspaceView.svg \ - %reldir%/icons/graphic_logo_ReleaseWidget.svg \ - %reldir%/icons/graphic_logo_VariableEditor.svg \ - %reldir%/icons/hand2.png \ - %reldir%/icons/icons_license \ - %reldir%/icons/left_side.png \ - %reldir%/icons/letter_logo_DocumentationDockWidget.png \ - %reldir%/icons/letter_logo_FileEditor.png \ - %reldir%/icons/letter_logo_FilesDockWidget.png \ - %reldir%/icons/letter_logo_HistoryDockWidget.png \ - %reldir%/icons/letter_logo_NewsDockWidget.png \ - %reldir%/icons/letter_logo_TerminalDockWidget.png \ - %reldir%/icons/letter_logo_WorkspaceView.png \ - %reldir%/icons/letter_logo_ReleaseWidget.png \ - %reldir%/icons/letter_logo_VariableEditor.png \ - %reldir%/icons/letter_logo_DocumentationDockWidget.svg \ - %reldir%/icons/letter_logo_FileEditor.svg \ - %reldir%/icons/letter_logo_FilesDockWidget.svg \ - %reldir%/icons/letter_logo_HistoryDockWidget.svg \ - %reldir%/icons/letter_logo_NewsDockWidget.svg \ - %reldir%/icons/letter_logo_TerminalDockWidget.svg \ - %reldir%/icons/letter_logo_WorkspaceView.svg \ - %reldir%/icons/letter_logo_ReleaseWidget.svg \ - %reldir%/icons/letter_logo_VariableEditor.svg \ - %reldir%/icons/logo.png \ - %reldir%/icons/plot-xy-curve.png \ - %reldir%/icons/preferences-system.png \ - %reldir%/icons/right_side.png \ - %reldir%/icons/system-run.png \ - %reldir%/icons/top_left_corner.png \ - %reldir%/icons/top_right_corner.png \ - %reldir%/icons/top_side.png \ - %reldir%/icons/user-home.png \ - %reldir%/icons/view-refresh.png \ - %reldir%/icons/widget-close.png \ - %reldir%/icons/widget-dock.png \ - %reldir%/icons/widget-undock.png \ - %reldir%/icons/widget-close-light.png \ - %reldir%/icons/widget-dock-light.png \ - %reldir%/icons/widget-undock-light.png \ - %reldir%/icons/zoom-in.png \ - %reldir%/icons/zoom-original.png \ - %reldir%/icons/zoom-out.png + %reldir%/icons/license.md \ + %reldir%/icons/cursors/bottom_left_corner.png \ + %reldir%/icons/cursors/bottom_right_corner.png \ + %reldir%/icons/cursors/bottom_side.png \ + %reldir%/icons/cursors/circle.png \ + %reldir%/icons/cursors/cross.png \ + %reldir%/icons/cursors/fleur.png \ + %reldir%/icons/cursors/hand2.png \ + %reldir%/icons/cursors/left_side.png \ + %reldir%/icons/cursors/right_side.png \ + %reldir%/icons/cursors/top_left_corner.png \ + %reldir%/icons/cursors/top_right_corner.png \ + %reldir%/icons/cursors/top_side.png \ + %reldir%/icons/octave/index.theme \ + %reldir%/icons/octave/128x128/applications-system.png \ + %reldir%/icons/octave/128x128/bp-next.png \ + %reldir%/icons/octave/128x128/bp-prev.png \ + %reldir%/icons/octave/128x128/bp-rm-all.png \ + %reldir%/icons/octave/128x128/bp-toggle.png \ + %reldir%/icons/octave/128x128/bookmark-new.png \ + %reldir%/icons/octave/128x128/db-cont.png \ + %reldir%/icons/octave/128x128/db-step-in.png \ + %reldir%/icons/octave/128x128/db-step-out.png \ + %reldir%/icons/octave/128x128/db-step.png \ + %reldir%/icons/octave/128x128/db-stop.png \ + %reldir%/icons/octave/128x128/dialog-error.png \ + %reldir%/icons/octave/128x128/document-new.png \ + %reldir%/icons/octave/128x128/document-open.png \ + %reldir%/icons/octave/128x128/document-print.png \ + %reldir%/icons/octave/128x128/document-save-as.png \ + %reldir%/icons/octave/128x128/document-save.png \ + %reldir%/icons/octave/128x128/edit-copy.png \ + %reldir%/icons/octave/128x128/edit-cut.png \ + %reldir%/icons/octave/128x128/edit-find-replace.png \ + %reldir%/icons/octave/128x128/edit-find.png \ + %reldir%/icons/octave/128x128/edit-paste.png \ + %reldir%/icons/octave/128x128/edit-redo.png \ + %reldir%/icons/octave/128x128/edit-undo.png \ + %reldir%/icons/octave/128x128/figure-axes.png \ + %reldir%/icons/octave/128x128/figure-grid.png \ + %reldir%/icons/octave/128x128/figure-pan.png \ + %reldir%/icons/octave/128x128/figure-rotate.png \ + %reldir%/icons/octave/128x128/figure-text.png \ + %reldir%/icons/octave/128x128/figure-zoom-in.png \ + %reldir%/icons/octave/128x128/figure-zoom-original.png \ + %reldir%/icons/octave/128x128/figure-zoom-out.png \ + %reldir%/icons/octave/128x128/folder-new.png \ + %reldir%/icons/octave/128x128/folder-up.png \ + %reldir%/icons/octave/128x128/folder.png \ + %reldir%/icons/octave/128x128/go-down.png \ + %reldir%/icons/octave/128x128/go-first.png \ + %reldir%/icons/octave/128x128/go-last.png \ + %reldir%/icons/octave/128x128/go-next.png \ + %reldir%/icons/octave/128x128/go-previous.png \ + %reldir%/icons/octave/128x128/go-up.png \ + %reldir%/icons/octave/128x128/graphic_logo_DocumentationDockWidget.png \ + %reldir%/icons/octave/128x128/graphic_logo_Figure.png \ + %reldir%/icons/octave/128x128/graphic_logo_FileEditor.png \ + %reldir%/icons/octave/128x128/graphic_logo_FilesDockWidget.png \ + %reldir%/icons/octave/128x128/graphic_logo_HistoryDockWidget.png \ + %reldir%/icons/octave/128x128/graphic_logo_NewsDockWidget.png \ + %reldir%/icons/octave/128x128/graphic_logo_ReleaseWidget.png \ + %reldir%/icons/octave/128x128/graphic_logo_TerminalDockWidget.png \ + %reldir%/icons/octave/128x128/graphic_logo_VariableEditor.png \ + %reldir%/icons/octave/128x128/graphic_logo_WorkspaceView.png \ + %reldir%/icons/octave/128x128/letter_logo_DocumentationDockWidget.png \ + %reldir%/icons/octave/128x128/letter_logo_FileEditor.png \ + %reldir%/icons/octave/128x128/letter_logo_FilesDockWidget.png \ + %reldir%/icons/octave/128x128/letter_logo_HistoryDockWidget.png \ + %reldir%/icons/octave/128x128/letter_logo_NewsDockWidget.png \ + %reldir%/icons/octave/128x128/letter_logo_ReleaseWidget.png \ + %reldir%/icons/octave/128x128/letter_logo_TerminalDockWidget.png \ + %reldir%/icons/octave/128x128/letter_logo_VariableEditor.png \ + %reldir%/icons/octave/128x128/letter_logo_WorkspaceView.png \ + %reldir%/icons/octave/128x128/logo.png \ + %reldir%/icons/octave/128x128/plot-xy-curve.png \ + %reldir%/icons/octave/128x128/system-run.png \ + %reldir%/icons/octave/128x128/user-home.png \ + %reldir%/icons/octave/128x128/widget-close-light.png \ + %reldir%/icons/octave/128x128/widget-close.png \ + %reldir%/icons/octave/128x128/widget-dock-light.png \ + %reldir%/icons/octave/128x128/widget-dock.png \ + %reldir%/icons/octave/128x128/widget-undock-light.png \ + %reldir%/icons/octave/128x128/widget-undock.png \ + %reldir%/icons/octave/scalable/applications-system.svg \ + %reldir%/icons/octave/scalable/bookmark-new.svg \ + %reldir%/icons/octave/scalable/bp-next.svg \ + %reldir%/icons/octave/scalable/bp-prev.svg \ + %reldir%/icons/octave/scalable/bp-rm-all.svg \ + %reldir%/icons/octave/scalable/bp-toggle.svg \ + %reldir%/icons/octave/scalable/db-cont.svg \ + %reldir%/icons/octave/scalable/db-step-in.svg \ + %reldir%/icons/octave/scalable/db-step-out.svg \ + %reldir%/icons/octave/scalable/db-step.svg \ + %reldir%/icons/octave/scalable/db-stop.svg \ + %reldir%/icons/octave/scalable/dialog-error.svg \ + %reldir%/icons/octave/scalable/document-new.svg \ + %reldir%/icons/octave/scalable/document-open.svg \ + %reldir%/icons/octave/scalable/document-print.svg \ + %reldir%/icons/octave/scalable/document-save-as.svg \ + %reldir%/icons/octave/scalable/document-save.svg \ + %reldir%/icons/octave/scalable/edit-copy.svg \ + %reldir%/icons/octave/scalable/edit-cut.svg \ + %reldir%/icons/octave/scalable/edit-find-replace.svg \ + %reldir%/icons/octave/scalable/edit-find.svg \ + %reldir%/icons/octave/scalable/edit-paste.svg \ + %reldir%/icons/octave/scalable/edit-redo.svg \ + %reldir%/icons/octave/scalable/edit-undo.svg \ + %reldir%/icons/octave/scalable/figure-axes.svg \ + %reldir%/icons/octave/scalable/figure-grid.svg \ + %reldir%/icons/octave/scalable/figure-pan.svg \ + %reldir%/icons/octave/scalable/figure-rotate.svg \ + %reldir%/icons/octave/scalable/figure-text.svg \ + %reldir%/icons/octave/scalable/figure-zoom-in.svg \ + %reldir%/icons/octave/scalable/figure-zoom-original.svg \ + %reldir%/icons/octave/scalable/figure-zoom-out.svg \ + %reldir%/icons/octave/scalable/folder-new.svg \ + %reldir%/icons/octave/scalable/folder-up.svg \ + %reldir%/icons/octave/scalable/folder.svg \ + %reldir%/icons/octave/scalable/go-down.svg \ + %reldir%/icons/octave/scalable/go-first.svg \ + %reldir%/icons/octave/scalable/go-last.svg \ + %reldir%/icons/octave/scalable/go-next.svg \ + %reldir%/icons/octave/scalable/go-previous.svg \ + %reldir%/icons/octave/scalable/go-up.svg \ + %reldir%/icons/octave/scalable/graphic_logo_DocumentationDockWidget.svg \ + %reldir%/icons/octave/scalable/graphic_logo_Figure.svg \ + %reldir%/icons/octave/scalable/graphic_logo_FileEditor.svg \ + %reldir%/icons/octave/scalable/graphic_logo_FilesDockWidget.svg \ + %reldir%/icons/octave/scalable/graphic_logo_HistoryDockWidget.svg \ + %reldir%/icons/octave/scalable/graphic_logo_NewsDockWidget.svg \ + %reldir%/icons/octave/scalable/graphic_logo_ReleaseWidget.svg \ + %reldir%/icons/octave/scalable/graphic_logo_TerminalDockWidget.svg \ + %reldir%/icons/octave/scalable/graphic_logo_VariableEditor.svg \ + %reldir%/icons/octave/scalable/graphic_logo_WorkspaceView.svg \ + %reldir%/icons/octave/scalable/letter_logo_DocumentationDockWidget.svg \ + %reldir%/icons/octave/scalable/letter_logo_FileEditor.svg \ + %reldir%/icons/octave/scalable/letter_logo_FilesDockWidget.svg \ + %reldir%/icons/octave/scalable/letter_logo_HistoryDockWidget.svg \ + %reldir%/icons/octave/scalable/letter_logo_NewsDockWidget.svg \ + %reldir%/icons/octave/scalable/letter_logo_ReleaseWidget.svg \ + %reldir%/icons/octave/scalable/letter_logo_TerminalDockWidget.svg \ + %reldir%/icons/octave/scalable/letter_logo_VariableEditor.svg \ + %reldir%/icons/octave/scalable/letter_logo_WorkspaceView.svg \ + %reldir%/icons/octave/scalable/plot-xy-curve.svg \ + %reldir%/icons/octave/scalable/system-run.svg \ + %reldir%/icons/octave/scalable/user-home.svg \ + %reldir%/icons/octave/scalable/widget-close-light.svg \ + %reldir%/icons/octave/scalable/widget-close.svg \ + %reldir%/icons/octave/scalable/widget-dock-light.svg \ + %reldir%/icons/octave/scalable/widget-dock.svg \ + %reldir%/icons/octave/scalable/widget-undock-light.svg \ + %reldir%/icons/octave/scalable/widget-undock.svg \ + %reldir%/icons/tango/index.theme \ + %reldir%/icons/tango/128x128/applications-system.png \ + %reldir%/icons/tango/128x128/bookmark-new.png \ + %reldir%/icons/tango/128x128/bp-next.png \ + %reldir%/icons/tango/128x128/bp-prev.png \ + %reldir%/icons/tango/128x128/bp-rm-all.png \ + %reldir%/icons/tango/128x128/bp-toggle.png \ + %reldir%/icons/tango/128x128/db-cont.png \ + %reldir%/icons/tango/128x128/db-step-in.png \ + %reldir%/icons/tango/128x128/db-step-out.png \ + %reldir%/icons/tango/128x128/db-step.png \ + %reldir%/icons/tango/128x128/db-stop.png \ + %reldir%/icons/tango/128x128/dialog-error.png \ + %reldir%/icons/tango/128x128/dialog-information.png \ + %reldir%/icons/tango/128x128/dialog-warning.png \ + %reldir%/icons/tango/128x128/document-new.png \ + %reldir%/icons/tango/128x128/document-open.png \ + %reldir%/icons/tango/128x128/document-print.png \ + %reldir%/icons/tango/128x128/document-save.png \ + %reldir%/icons/tango/128x128/document-save-as.png \ + %reldir%/icons/tango/128x128/edit-copy.png \ + %reldir%/icons/tango/128x128/edit-cut.png \ + %reldir%/icons/tango/128x128/edit-delete.png \ + %reldir%/icons/tango/128x128/edit-find-replace.png \ + %reldir%/icons/tango/128x128/edit-find.png \ + %reldir%/icons/tango/128x128/edit-paste.png \ + %reldir%/icons/tango/128x128/edit-redo.png \ + %reldir%/icons/tango/128x128/edit-undo.png \ + %reldir%/icons/tango/128x128/folder-new.png \ + %reldir%/icons/tango/128x128/folder-up.png \ + %reldir%/icons/tango/128x128/folder.png \ + %reldir%/icons/tango/128x128/go-down.png \ + %reldir%/icons/tango/128x128/go-first.png \ + %reldir%/icons/tango/128x128/go-home.png \ + %reldir%/icons/tango/128x128/go-last.png \ + %reldir%/icons/tango/128x128/go-next.png \ + %reldir%/icons/tango/128x128/go-previous.png \ + %reldir%/icons/tango/128x128/go-up.png \ + %reldir%/icons/tango/128x128/preferences-system.png \ + %reldir%/icons/tango/128x128/user-home.png \ + %reldir%/icons/tango/128x128/view-refresh.png \ + %reldir%/icons/tango/128x128/view-zoom-in.png \ + %reldir%/icons/tango/128x128/view-zoom-original.png \ + %reldir%/icons/tango/128x128/view-zoom-out.png \ + %reldir%/icons/tango/scalable/applications-system.svg \ + %reldir%/icons/tango/scalable/bookmark-new.svg \ + %reldir%/icons/tango/scalable/bp-next.svg \ + %reldir%/icons/tango/scalable/bp-prev.svg \ + %reldir%/icons/tango/scalable/bp-rm-all.svg \ + %reldir%/icons/tango/scalable/bp-toggle.svg \ + %reldir%/icons/tango/scalable/db-cont.svg \ + %reldir%/icons/tango/scalable/db-step-in.svg \ + %reldir%/icons/tango/scalable/db-step-out.svg \ + %reldir%/icons/tango/scalable/db-step.svg \ + %reldir%/icons/tango/scalable/db-stop.svg \ + %reldir%/icons/tango/scalable/dialog-error.svg \ + %reldir%/icons/tango/scalable/dialog-information.svg \ + %reldir%/icons/tango/scalable/dialog-warning.svg \ + %reldir%/icons/tango/scalable/document-new.svg \ + %reldir%/icons/tango/scalable/document-open.svg \ + %reldir%/icons/tango/scalable/document-print.svg \ + %reldir%/icons/tango/scalable/document-save.svg \ + %reldir%/icons/tango/scalable/document-save-as.svg \ + %reldir%/icons/tango/scalable/edit-copy.svg \ + %reldir%/icons/tango/scalable/edit-cut.svg \ + %reldir%/icons/tango/scalable/edit-delete.svg \ + %reldir%/icons/tango/scalable/edit-find-replace.svg \ + %reldir%/icons/tango/scalable/edit-find.svg \ + %reldir%/icons/tango/scalable/edit-paste.svg \ + %reldir%/icons/tango/scalable/edit-redo.svg \ + %reldir%/icons/tango/scalable/edit-undo.svg \ + %reldir%/icons/tango/scalable/folder-new.svg \ + %reldir%/icons/tango/scalable/folder-up.svg \ + %reldir%/icons/tango/scalable/folder.svg \ + %reldir%/icons/tango/scalable/go-down.svg \ + %reldir%/icons/tango/scalable/go-first.svg \ + %reldir%/icons/tango/scalable/go-home.svg \ + %reldir%/icons/tango/scalable/go-last.svg \ + %reldir%/icons/tango/scalable/go-next.svg \ + %reldir%/icons/tango/scalable/go-previous.svg \ + %reldir%/icons/tango/scalable/go-up.svg \ + %reldir%/icons/tango/scalable/preferences-system.svg \ + %reldir%/icons/tango/scalable/user-home.svg \ + %reldir%/icons/tango/scalable/view-refresh.svg \ + %reldir%/icons/tango/scalable/view-zoom-in.svg \ + %reldir%/icons/tango/scalable/view-zoom-original.svg \ + %reldir%/icons/tango/scalable/view-zoom-out.svg octave_gui_MOC = diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/octave-dock-widget.cc --- a/libgui/src/octave-dock-widget.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libgui/src/octave-dock-widget.cc Thu Mar 03 13:37:10 2022 -0500 @@ -29,18 +29,20 @@ #include #include -#include #include #include +#include #include #include #include +#include #include "gui-preferences-dw.h" #include "gui-preferences-global.h" #include "gui-preferences-mw.h" #include "gui-preferences-sc.h" #include "gui-settings.h" +#include "gui-utils.h" #include "main-window.h" #include "octave-dock-widget.h" #include "octave-qobject.h" @@ -71,11 +73,13 @@ } } + resource_manager& rmgr = m_octave_qobj.get_resource_manager (); + // the custom (extra) title bar of the widget m_title_widget = new QWidget (); m_dock_action = new QAction - (QIcon (":/actions/icons/widget-undock.png"), "", this); + (rmgr.icon ("widget-undock", true), "", this); m_dock_action->setToolTip (tr ("Undock widget")); m_dock_button = new QToolButton (m_title_widget); m_dock_button->setDefaultAction (m_dock_action); @@ -83,7 +87,7 @@ m_dock_button->setIconSize (QSize (m_icon_size, m_icon_size)); m_close_action = new QAction - (QIcon (":/actions/icons/widget-close.png"), "", this); + (rmgr.icon ("widget-close", true), "", this); m_close_action->setToolTip (tr ("Close widget")); m_close_button = new QToolButton (m_title_widget); m_close_button->setDefaultAction (m_close_action); @@ -231,13 +235,15 @@ m_close_action->setToolTip (tr ("Hide widget")); - setStyleSheet (qdockwidget_css (QString (":/actions/icons/widget-close.png"), - QString ("Close widget"), - QString (":/actions/icons/widget-undock.png"), - QString ("Undock widget"), - m_icon_size, - QString (""), - QString (""))); + setStyleSheet (qdockwidget_css ( + global_icon_paths.at (ICON_THEME_OCTAVE) + "widget-close.png", + QString ("Close widget"), + global_icon_paths.at (ICON_THEME_OCTAVE) + "widget-undock.png", + QString ("Undock widget"), + m_icon_size, + QString (""), + QString (""))); + if (widget ()) widget ()->setToolTip (QString ("")); @@ -309,8 +315,8 @@ // adjust the (un)dock icon if (titleBarWidget ()) { - m_dock_action->setIcon (QIcon (":/actions/icons/widget-dock" - + m_icon_color + ".png")); + resource_manager& rmgr = m_octave_qobj.get_resource_manager (); + m_dock_action->setIcon (rmgr.icon ("widget-dock" + m_icon_color, true)); m_dock_action->setToolTip (tr ("Dock widget")); } else @@ -368,8 +374,7 @@ this, &octave_dock_widget::make_window); if (titleBarWidget ()) { - m_dock_action->setIcon (QIcon (":/actions/icons/widget-undock" - + m_icon_color + ".png")); + m_dock_action->setIcon (rmgr.icon ("widget-undock" + m_icon_color, true)); m_dock_action->setToolTip (tr ("Undock widget")); } else @@ -513,12 +518,8 @@ m_icon_color_active = ""; - QWidget *ref_widget = m_main_window; - if (! ref_widget) - ref_widget = this; - int x, y, w, h; - QApplication::desktop ()->availableGeometry (ref_widget).getRect (&x, &y, &w, &h); + QGuiApplication::primaryScreen ()->availableGeometry ().getRect (&x, &y, &w, &h); QRect default_floating_size = QRect (x+16, y+32, w/3, h/2); QRect default_dock_size; @@ -538,11 +539,7 @@ = settings->value (dw_float_geometry.key.arg (objectName ()), default_floating_size).toRect (); - QWidget dummy; - dummy.setGeometry (m_recent_float_geom); - - if (QApplication::desktop ()->screenNumber (&dummy) == -1) - m_recent_float_geom = default_floating_size; + adjust_to_screen (m_recent_float_geom, default_floating_size); // The following is required for ensure smooth transition from old // saveGeomety to new QRect setting (see comment for restoring size @@ -804,22 +801,23 @@ css_background = QString (""); } - QString full_dock_icon = ":/actions/icons/" + dock_icon + icon_col + ".png"; - QString full_close_icon = ":/actions/icons/widget-close" + icon_col + ".png"; + QString full_dock_icon = dock_icon + icon_col; + QString full_close_icon = "widget-close" + icon_col; if (titleBarWidget ()) { + resource_manager& rmgr = m_octave_qobj.get_resource_manager (); titleBarWidget ()->setStyleSheet (css_foreground + css_background); css_button = QString ("QToolButton {background: transparent; border: 0px;}"); m_dock_button->setStyleSheet (css_button); m_close_button->setStyleSheet (css_button); - m_dock_action->setIcon (QIcon (full_dock_icon)); - m_close_action->setIcon (QIcon (full_close_icon)); + m_dock_action->setIcon (rmgr.icon (full_dock_icon, true)); + m_close_action->setIcon (rmgr.icon (full_close_icon, true)); } else { - setStyleSheet (qdockwidget_css (full_close_icon, + setStyleSheet (qdockwidget_css (global_icon_paths.at (ICON_THEME_OCTAVE) + full_close_icon + ".png", close_tooltip, - full_dock_icon, + global_icon_paths.at (ICON_THEME_OCTAVE) + full_dock_icon + ".png", dock_tooltip, m_icon_size, css_foreground, diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/octave-qobject.cc --- a/libgui/src/octave-qobject.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libgui/src/octave-qobject.cc Thu Mar 03 13:37:10 2022 -0500 @@ -313,6 +313,7 @@ // After settings. config_translators (); + m_resource_manager.config_icon_theme (); // Initilize the shortcut-manager m_shortcut_manager.init_data (); diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/release-notes.cc --- a/libgui/src/release-notes.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libgui/src/release-notes.cc Thu Mar 03 13:37:10 2022 -0500 @@ -27,15 +27,17 @@ # include "config.h" #endif -#include +#include #include #include #include +#include #include #include #include #include "release-notes.h" +#include "gui-utils.h" #include "gui-preferences-nr.h" #include "news-reader.h" #include "octave-qobject.h" @@ -116,14 +118,4 @@ activateWindow (); } - // FIXME: This function is duplicated in main_window.cc. Maybe it - // should be a utility function? - - void release_notes::get_screen_geometry (int& width, int& height) - { - QRect screen_geometry = QApplication::desktop ()->availableGeometry (this); - - width = screen_geometry.width (); - height = screen_geometry.height (); - } } diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/release-notes.h --- a/libgui/src/release-notes.h Thu Mar 03 13:31:24 2022 -0500 +++ b/libgui/src/release-notes.h Thu Mar 03 13:37:10 2022 -0500 @@ -51,8 +51,6 @@ private: - void get_screen_geometry (int& width, int& height); - QTextBrowser *m_browser; QString m_release_notes_icon; }; diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/resource-manager.cc --- a/libgui/src/resource-manager.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libgui/src/resource-manager.cc Thu Mar 03 13:37:10 2022 -0500 @@ -27,6 +27,8 @@ # include "config.h" #endif +#include + #include #include #include @@ -67,7 +69,7 @@ { resource_manager::resource_manager (void) : m_settings_directory (), m_settings_file (), m_settings (nullptr), - m_default_settings (nullptr), m_temporary_files () + m_default_settings (nullptr), m_temporary_files (), m_icon_fallbacks () { // Let gui_settings decide where to put the ini file with gui preferences m_default_settings @@ -185,6 +187,52 @@ } + void resource_manager::config_icon_theme (void) + { + m_icon_fallbacks.clear (); + + int theme = global_icon_theme_index.def.toInt (); + + if (m_settings) + { + // check for new and old setting and use old if required + if (! m_settings->contains (global_icon_theme_index.key)) + { + // new pref does not exist + if (m_settings->value (global_icon_theme).toBool ()) + theme = ICON_THEME_SYSTEM; + else + theme = ICON_THEME_OCTAVE; + m_settings->setValue (global_icon_theme_index.key, theme); // add new + m_settings->remove (global_icon_theme.key); // remove deprecated key + } + else + { + // get new settings + theme = m_settings->value (global_icon_theme_index).toInt (); + } + } + + QIcon::setThemeName (global_all_icon_themes.at (theme)); + + // set the required fallback search paths + switch (theme) + { + case ICON_THEME_SYSTEM: + m_icon_fallbacks << global_icon_paths.at (ICON_THEME_OCTAVE); + m_icon_fallbacks << global_icon_paths.at (ICON_THEME_TANGO); + break; + case ICON_THEME_TANGO: + m_icon_fallbacks << global_icon_paths.at (ICON_THEME_OCTAVE); + break; + case ICON_THEME_OCTAVE: + m_icon_fallbacks << global_icon_paths.at (ICON_THEME_TANGO); + break; + } + + m_icon_fallbacks << global_icon_paths.at (ICON_THEME_CURSORS); + } + gui_settings * resource_manager::get_settings (void) const { return m_settings; @@ -581,19 +629,23 @@ sys::env::putenv ("HTTPS_PROXY", proxy_url_str); } - QIcon resource_manager::icon (const QString& icon_name, bool fallback) + QIcon resource_manager::icon (const QString& icon_name, bool octave_only) { - // If system icon theme is not desired, take own icon files - if (! m_settings->value (global_icon_theme).toBool ()) - return QIcon (":/actions/icons/" + icon_name + ".png"); + if (octave_only) + return QIcon (global_icon_paths.at (ICON_THEME_OCTAVE) + icon_name + ".png"); + + if (QIcon::hasThemeIcon (icon_name)) + return QIcon (QIcon::fromTheme (icon_name)); - // Use system icon theme with own files as fallback except when the - // fallback is explicitly disabled (fallback=false) - if (fallback) - return QIcon::fromTheme (icon_name, - QIcon (":/actions/icons/" + icon_name + ".png")); - else - return QIcon::fromTheme (icon_name); + for (int i = 0; i < m_icon_fallbacks.length (); i++ ) + { + QString icon_file (m_icon_fallbacks.at (i) + icon_name + ".png"); + if (QFile (icon_file).exists ()) + return QIcon (icon_file); + } + + //QIcon::setThemeName (current_theme); + return QIcon (); } // get a list of all available encodings diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/resource-manager.h --- a/libgui/src/resource-manager.h Thu Mar 03 13:31:24 2022 -0500 +++ b/libgui/src/resource-manager.h Thu Mar 03 13:37:10 2022 -0500 @@ -61,6 +61,7 @@ void config_translators (QTranslator *qt_tr, QTranslator *qsci_tr, QTranslator *gui_tr); + void config_icon_theme (void); gui_settings * get_settings (void) const; @@ -96,7 +97,7 @@ void update_network_settings (void); - QIcon icon (const QString& icon_name, bool fallback = true); + QIcon icon (const QString& icon_name, bool octave_only = false); void get_codecs (QStringList *codecs); @@ -122,6 +123,8 @@ gui_settings *m_default_settings; QList m_temporary_files; + + QStringList m_icon_fallbacks; }; } diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/resource.qrc --- a/libgui/src/resource.qrc Thu Mar 03 13:31:24 2022 -0500 +++ b/libgui/src/resource.qrc Thu Mar 03 13:37:10 2022 -0500 @@ -1,94 +1,131 @@ - - icons/applications-system.png - icons/bookmark-new.png - icons/bp-toggle.png - icons/bp-rm-all.png - icons/bp-prev.png - icons/bp-next.png - icons/bottom_left_corner.png - icons/bottom_right_corner.png - icons/bottom_side.png - icons/circle.png - icons/cross.png - icons/db-cont.png - icons/db-step.png - icons/db-step-in.png - icons/db-step-out.png - icons/db-stop.png - icons/dialog-error.png - icons/dialog-information.png - icons/dialog-warning.png - icons/document-new.png - icons/document-open.png - icons/document-print.png - icons/document-save.png - icons/document-save-as.png - icons/edit-copy.png - icons/edit-cut.png - icons/edit-delete.png - icons/edit-find.png - icons/edit-find-replace.png - icons/edit-paste.png - icons/edit-redo.png - icons/edit-undo.png - icons/figure-axes.png - icons/figure-grid.png - icons/figure-pan.png - icons/figure-rotate.png - icons/figure-text.png - icons/figure-zoom-in.png - icons/figure-zoom-original.png - icons/figure-zoom-out.png - icons/folder.png - icons/folder-new.png - icons/go-down.png - icons/go-first.png - icons/go-home.png - icons/go-last.png - icons/go-next.png - icons/go-previous.png - icons/go-up.png - icons/graphic_logo_FilesDockWidget.png - icons/graphic_logo_Figure.png - icons/graphic_logo_FileEditor.png - icons/graphic_logo_NewsDockWidget.png - icons/graphic_logo_TerminalDockWidget.png - icons/graphic_logo_HistoryDockWidget.png - icons/graphic_logo_WorkspaceView.png - icons/graphic_logo_DocumentationDockWidget.png - icons/graphic_logo_ReleaseWidget.png - icons/graphic_logo_VariableEditor.png - icons/fleur.png - icons/hand2.png - icons/left_side.png - icons/letter_logo_FilesDockWidget.png - icons/letter_logo_FileEditor.png - icons/letter_logo_NewsDockWidget.png - icons/letter_logo_TerminalDockWidget.png - icons/letter_logo_HistoryDockWidget.png - icons/letter_logo_WorkspaceView.png - icons/letter_logo_DocumentationDockWidget.png - icons/letter_logo_ReleaseWidget.png - icons/letter_logo_VariableEditor.png - icons/logo.png - icons/plot-xy-curve.png - icons/preferences-system.png - icons/right_side.png - icons/system-run.png - icons/top_left_corner.png - icons/top_right_corner.png - icons/top_side.png - icons/user-home.png - icons/view-refresh.png - icons/widget-close.png - icons/widget-dock.png - icons/widget-undock.png - icons/widget-close-light.png - icons/widget-dock-light.png - icons/widget-undock-light.png - icons/zoom-in.png - icons/zoom-original.png - icons/zoom-out.png + + icons/cursors/bottom_left_corner.png + icons/cursors/bottom_right_corner.png + icons/cursors/bottom_side.png + icons/cursors/circle.png + icons/cursors/cross.png + icons/cursors/fleur.png + icons/cursors/hand2.png + icons/cursors/left_side.png + icons/cursors/right_side.png + icons/cursors/top_left_corner.png + icons/cursors/top_right_corner.png + icons/cursors/top_side.png + icons/octave/128x128/applications-system.png + icons/octave/128x128/bookmark-new.png + icons/octave/128x128/bp-toggle.png + icons/octave/128x128/bp-rm-all.png + icons/octave/128x128/bp-prev.png + icons/octave/128x128/bp-next.png + icons/octave/128x128/db-cont.png + icons/octave/128x128/db-step.png + icons/octave/128x128/db-step-in.png + icons/octave/128x128/db-step-out.png + icons/octave/128x128/db-stop.png + icons/octave/128x128/dialog-error.png + icons/octave/128x128/document-new.png + icons/octave/128x128/document-open.png + icons/octave/128x128/document-print.png + icons/octave/128x128/document-save-as.png + icons/octave/128x128/document-save.png + icons/octave/128x128/edit-copy.png + icons/octave/128x128/edit-cut.png + icons/octave/128x128/edit-find-replace.png + icons/octave/128x128/edit-find.png + icons/octave/128x128/edit-paste.png + icons/octave/128x128/edit-redo.png + icons/octave/128x128/edit-undo.png + icons/octave/128x128/figure-axes.png + icons/octave/128x128/figure-grid.png + icons/octave/128x128/figure-pan.png + icons/octave/128x128/figure-rotate.png + icons/octave/128x128/figure-text.png + icons/octave/128x128/figure-zoom-in.png + icons/octave/128x128/figure-zoom-original.png + icons/octave/128x128/figure-zoom-out.png + icons/octave/128x128/folder.png + icons/octave/128x128/folder-new.png + icons/octave/128x128/folder-up.png + icons/octave/128x128/go-down.png + icons/octave/128x128/go-first.png + icons/octave/128x128/go-last.png + icons/octave/128x128/go-next.png + icons/octave/128x128/go-previous.png + icons/octave/128x128/go-up.png + icons/octave/128x128/graphic_logo_FilesDockWidget.png + icons/octave/128x128/graphic_logo_Figure.png + icons/octave/128x128/graphic_logo_FileEditor.png + icons/octave/128x128/graphic_logo_NewsDockWidget.png + icons/octave/128x128/graphic_logo_TerminalDockWidget.png + icons/octave/128x128/graphic_logo_HistoryDockWidget.png + icons/octave/128x128/graphic_logo_WorkspaceView.png + icons/octave/128x128/graphic_logo_DocumentationDockWidget.png + icons/octave/128x128/graphic_logo_ReleaseWidget.png + icons/octave/128x128/graphic_logo_VariableEditor.png + icons/octave/128x128/letter_logo_FilesDockWidget.png + icons/octave/128x128/letter_logo_FileEditor.png + icons/octave/128x128/letter_logo_NewsDockWidget.png + icons/octave/128x128/letter_logo_TerminalDockWidget.png + icons/octave/128x128/letter_logo_HistoryDockWidget.png + icons/octave/128x128/letter_logo_WorkspaceView.png + icons/octave/128x128/letter_logo_DocumentationDockWidget.png + icons/octave/128x128/letter_logo_ReleaseWidget.png + icons/octave/128x128/letter_logo_VariableEditor.png + icons/octave/128x128/logo.png + icons/octave/128x128/plot-xy-curve.png + icons/octave/128x128/system-run.png + icons/octave/128x128/user-home.png + icons/octave/128x128/widget-close.png + icons/octave/128x128/widget-dock.png + icons/octave/128x128/widget-undock.png + icons/octave/128x128/widget-close-light.png + icons/octave/128x128/widget-dock-light.png + icons/octave/128x128/widget-undock-light.png + icons/octave/index.theme + icons/tango/128x128/applications-system.png + icons/tango/128x128/bookmark-new.png + icons/tango/128x128/bp-toggle.png + icons/tango/128x128/bp-rm-all.png + icons/tango/128x128/bp-prev.png + icons/tango/128x128/bp-next.png + icons/tango/128x128/db-cont.png + icons/tango/128x128/db-step.png + icons/tango/128x128/db-step-in.png + icons/tango/128x128/db-step-out.png + icons/tango/128x128/db-stop.png + icons/tango/128x128/dialog-error.png + icons/tango/128x128/dialog-information.png + icons/tango/128x128/dialog-warning.png + icons/tango/128x128/document-new.png + icons/tango/128x128/document-open.png + icons/tango/128x128/document-print.png + icons/tango/128x128/document-save.png + icons/tango/128x128/document-save-as.png + icons/tango/128x128/edit-copy.png + icons/tango/128x128/edit-cut.png + icons/tango/128x128/edit-delete.png + icons/tango/128x128/edit-find.png + icons/tango/128x128/edit-find-replace.png + icons/tango/128x128/edit-paste.png + icons/tango/128x128/edit-redo.png + icons/tango/128x128/edit-undo.png + icons/tango/128x128/folder.png + icons/tango/128x128/folder-new.png + icons/tango/128x128/folder-up.png + icons/tango/128x128/go-down.png + icons/tango/128x128/go-first.png + icons/tango/128x128/go-home.png + icons/tango/128x128/go-last.png + icons/tango/128x128/go-next.png + icons/tango/128x128/go-previous.png + icons/tango/128x128/go-up.png + icons/tango/128x128/preferences-system.png + icons/tango/128x128/user-home.png + icons/tango/128x128/view-refresh.png + icons/tango/128x128/view-zoom-in.png + icons/tango/128x128/view-zoom-original.png + icons/tango/128x128/view-zoom-out.png + icons/tango/index.theme diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/settings-dialog.cc --- a/libgui/src/settings-dialog.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libgui/src/settings-dialog.cc Thu Mar 03 13:37:10 2022 -0500 @@ -137,7 +137,9 @@ icon_size_normal->setChecked (true); // the default icon_size_small->setChecked (icon_size < 0); icon_size_large->setChecked (icon_size > 0); - cb_system_icon_theme->setChecked (settings->value (global_icon_theme).toBool ()); + combo_box_icon_theme->addItems (global_all_icon_theme_names); + int theme = settings->value (global_icon_theme_index.key).toInt (); + combo_box_icon_theme->setCurrentIndex (theme); // which icon has to be selected QButtonGroup *icon_group = new QButtonGroup (this); @@ -1020,7 +1022,7 @@ // icon size and theme int icon_size = icon_size_large->isChecked () - icon_size_small->isChecked (); settings->setValue (global_icon_size.key, icon_size); - settings->setValue (global_icon_theme.key, cb_system_icon_theme->isChecked ()); + settings->setValue (global_icon_theme_index.key, combo_box_icon_theme->currentIndex ()); // native file dialogs settings->setValue (global_use_native_dialogs.key, cb_use_native_file_dialogs->isChecked ()); diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/settings-dialog.ui --- a/libgui/src/settings-dialog.ui Thu Mar 03 13:31:24 2022 -0500 +++ b/libgui/src/settings-dialog.ui Thu Mar 03 13:37:10 2022 -0500 @@ -35,7 +35,7 @@ - 6 + 0 @@ -55,8 +55,8 @@ 0 0 - 657 - 629 + 1021 + 618 @@ -68,30 +68,44 @@ - - + + + + Dock widget title bar + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + + + Dock widgets window icons + + + + + + + Style + + + + + - + 135 0 - - QComboBox::InsertAtBottom - - - - (requires restart) - - - - - + Qt::Horizontal @@ -105,19 +119,26 @@ - - + + - Dock widget title bar - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + Language - - + + + + + Icon theme (requires restart) + + + + + + + @@ -143,58 +164,10 @@ - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Use system icon theme if available (requires restart) - - - - - - - - - - - Octave logo only - - - true - - - - - - - Letter icons - - - - - - - Graphic icons - - - - - + + Qt::Horizontal @@ -208,23 +181,6 @@ - - - - Toolbar Icons - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - - - - - Icon set for dock widgets - - - @@ -387,27 +343,40 @@ - - + + - Language + Toolbar Icons + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - + + - + 135 0 + + QComboBox::InsertAtBottom + - + + + (requires restart) + + + + + Qt::Horizontal @@ -421,12 +390,46 @@ - - - - Style - - + + + + + + Octave logo only + + + true + + + + + + + Letter icons + + + + + + + Graphic icons + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + @@ -584,8 +587,8 @@ 0 0 - 668 - 267 + 1035 + 569 @@ -865,8 +868,8 @@ 0 0 - 765 - 1515 + 1021 + 1497 @@ -2173,8 +2176,8 @@ 0 0 - 595 - 410 + 1035 + 569 @@ -2323,8 +2326,8 @@ 0 0 - 259 - 67 + 1035 + 569 @@ -2385,8 +2388,8 @@ 0 0 - 605 - 233 + 1035 + 569 @@ -2770,8 +2773,8 @@ 0 0 - 703 - 310 + 1035 + 569 diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/terminal-dock-widget.cc --- a/libgui/src/terminal-dock-widget.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libgui/src/terminal-dock-widget.cc Thu Mar 03 13:37:10 2022 -0500 @@ -27,7 +27,7 @@ # include "config.h" #endif -#include +#include // This header is only needed for the new terminal widget. #include "command-widget.h" @@ -107,8 +107,8 @@ int win_x = metrics.maxWidth()*80; int win_y = metrics.height()*25; - int max_x = QApplication::desktop ()->screenGeometry (this).width (); - int max_y = QApplication::desktop ()->screenGeometry (this).height (); + int max_x = QGuiApplication::primaryScreen ()->availableGeometry ().width (); + int max_y = QGuiApplication::primaryScreen ()->availableGeometry ().height (); if (win_x > max_x) win_x = max_x; diff -r 103efb7e1600 -r 4392386b5ecb libgui/src/welcome-wizard.cc --- a/libgui/src/welcome-wizard.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libgui/src/welcome-wizard.cc Thu Mar 03 13:37:10 2022 -0500 @@ -28,7 +28,6 @@ #endif #include -#include #include #include #include diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/__isprimelarge__.cc --- a/libinterp/corefcn/__isprimelarge__.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/__isprimelarge__.cc Thu Mar 03 13:37:10 2022 -0500 @@ -98,7 +98,8 @@ bool isprimescalar (uint64_t n) { - // Fast return for even numbers. n==2 is excluded by the time this function is called. + // Fast return for even numbers. + // n==2 is excluded by the time this function is called. if (! (n & 1)) return false; @@ -197,7 +198,10 @@ %!assert (__isprimelarge__ (uint64 (2305843009213693951)), true) %!assert (__isprimelarge__ (uint64 (18446744073709551557)), true) -%!assert (__isprimelarge__ ([uint64(12345), uint64(2147483647), uint64(2305843009213693951), uint64(18446744073709551557)]), logical ([0 1 1 1])) +%!assert (__isprimelarge__ ([uint64(12345), uint64(2147483647), ... +%! uint64(2305843009213693951), ... +%! uint64(18446744073709551557)]), +%! logical ([0 1 1 1])) %!error (__isprimelarge__ ({'foo'; 'bar'})) */ diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/__lin_interpn__.cc --- a/libinterp/corefcn/__lin_interpn__.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/__lin_interpn__.cc Thu Mar 03 13:37:10 2022 -0500 @@ -35,6 +35,8 @@ #include "error.h" #include "ovl.h" +#include + OCTAVE_NAMESPACE_BEGIN // equivalent to isvector.m @@ -127,11 +129,11 @@ // n-dimensional linear interpolation -template +template void lin_interpn (int n, const octave_idx_type *size, const octave_idx_type *scale, - octave_idx_type Ni, T extrapval, const T **x, - const T *v, const T **y, T *vi) + octave_idx_type Ni, DT extrapval, const T **x, + const DT *v, const T **y, DT *vi) { bool out = false; int bit; @@ -185,13 +187,17 @@ } } -template +template octave_value -lin_interpn (int n, M *X, const M V, M *Y) +lin_interpn (int n, MT *X, const DMT V, MT *Y, DT extrapval) { + static_assert(std::is_same::value, + "Type DMT must be an ArrayType with elements of type DT."); + using T = typename MT::element_type; + octave_value retval; - M Vi = M (Y[0].dims ()); + DMT Vi = DMT (Y[0].dims ()); OCTAVE_LOCAL_BUFFER (const T *, y, n); OCTAVE_LOCAL_BUFFER (octave_idx_type, size, n); @@ -205,12 +211,10 @@ OCTAVE_LOCAL_BUFFER (const T *, x, n); OCTAVE_LOCAL_BUFFER (octave_idx_type, scale, n); - const T *v = V.data (); - T *vi = Vi.fortran_vec (); + const DT *v = V.data (); + DT *vi = Vi.fortran_vec (); octave_idx_type Ni = Vi.numel (); - T extrapval = octave_NA; - // offset in memory of each dimension scale[0] = 1; @@ -228,7 +232,7 @@ if (X[i].dims () != V.dims ()) error ("interpn: incompatible size of argument number %d", i+1); - M tmp = M (dim_vector (size[i], 1)); + MT tmp = MT (dim_vector (size[i], 1)); for (octave_idx_type j = 0; j < size[i]; j++) tmp(j) = X[i](scale[i]*j); @@ -284,8 +288,6 @@ OCTAVE_LOCAL_BUFFER (FloatNDArray, X, n); OCTAVE_LOCAL_BUFFER (FloatNDArray, Y, n); - const FloatNDArray V = args(n).float_array_value (); - for (int i = 0; i < n; i++) { X[i] = args(i).float_array_value (); @@ -295,15 +297,24 @@ error ("interpn: incompatible size of argument number %d", n+i+2); } - retval = lin_interpn (n, X, V, Y); + if (args(n).iscomplex ()) + { + const FloatComplexNDArray V = args(n).float_complex_array_value (); + FloatComplex extrapval (octave_NA, octave_NA); + retval = lin_interpn (n, X, V, Y, extrapval); + } + else + { + const FloatNDArray V = args(n).float_array_value (); + float extrapval = octave_NA; + retval = lin_interpn (n, X, V, Y, extrapval); + } } else { OCTAVE_LOCAL_BUFFER (NDArray, X, n); OCTAVE_LOCAL_BUFFER (NDArray, Y, n); - const NDArray V = args(n).array_value (); - for (int i = 0; i < n; i++) { X[i] = args(i).array_value (); @@ -313,15 +324,36 @@ error ("interpn: incompatible size of argument number %d", n+i+2); } - retval = lin_interpn (n, X, V, Y); + if (args(n).iscomplex ()) + { + const ComplexNDArray V = args(n).complex_array_value (); + Complex extrapval (octave_NA, octave_NA); + retval = lin_interpn (n, X, V, Y, extrapval); + } + else + { + const NDArray V = args(n).array_value (); + double extrapval = octave_NA; + retval = lin_interpn (n, X, V, Y, extrapval); + } } return retval; } /* -## No test needed for internal helper function. -%!assert (1) +## Test that real and imaginary parts are interpolated the same way +## and outer points are set to NA + 1i*NA +%!test <*61907> +%! x1 = 1:3; +%! x2 = 1:4; +%! v = repmat(1:4, 3, 1) + 1i * repmat((1:3)', 1, 4); +%! [XI2, XI1] = meshgrid(1.5:3.5, 1.5:3.5); +%! vi_complex = __lin_interpn__ (x1, x2, v, XI1, XI2); +%! vi_real = __lin_interpn__ (x1, x2, real (v), XI1, XI2); +%! vi_imag = __lin_interpn__ (x1, x2, imag (v), XI1, XI2); +%! assert (real (vi_complex), vi_real); +%! assert (imag (vi_complex), vi_imag); */ OCTAVE_NAMESPACE_END diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/__pchip_deriv__.cc --- a/libinterp/corefcn/__pchip_deriv__.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/__pchip_deriv__.cc Thu Mar 03 13:37:10 2022 -0500 @@ -57,79 +57,167 @@ if (args(0).is_single_type () || args(1).is_single_type ()) { FloatColumnVector xvec (args(0).float_vector_value ()); - FloatMatrix ymat (args(1).float_matrix_value ()); - F77_INT nx = to_f77_int (xvec.numel ()); - if (nx < 2) error ("__pchip_deriv__: X must be at least of length 2"); - octave_idx_type nyr = ymat.rows (); - octave_idx_type nyc = ymat.columns (); + if (args(1).iscomplex ()) + { + FloatComplexMatrix ymat (args(1).float_complex_matrix_value ()); + + octave_idx_type nyr = ymat.rows (); + octave_idx_type nyc = ymat.columns (); - if (nx != (rows ? nyc : nyr)) - error ("__pchip_deriv__: X and Y dimension mismatch"); + if (nx != (rows ? nyc : nyr)) + error ("__pchip_deriv__: X and Y dimension mismatch"); + + FloatComplexMatrix dmat (nyr, nyc); + + F77_INT ierr; + const F77_INT incfd = (rows ? to_f77_int (2*nyr) : 2); + volatile const octave_idx_type inc = (rows ? 2 : 2*nyr); + volatile octave_idx_type k = 0; - FloatMatrix dmat (nyr, nyc); + for (volatile octave_idx_type i = (rows ? nyr : nyc); i > 0; i--) + { + F77_XFCN (pchim, PCHIM, (nx, xvec.data (), + reinterpret_cast(ymat.data ()) + k * inc, + reinterpret_cast(dmat.fortran_vec ()) + k * inc, + incfd, ierr)); - F77_INT ierr; - const F77_INT incfd = (rows ? to_f77_int (nyr) : 1); - volatile const octave_idx_type inc = (rows ? 1 : nyr); - volatile octave_idx_type k = 0; + if (ierr < 0) + error ("__pchip_deriv__: PCHIM failed for real part with ierr = %" + OCTAVE_F77_INT_TYPE_FORMAT, ierr); + + F77_XFCN (pchim, PCHIM, (nx, xvec.data (), + reinterpret_cast(ymat.data ()) + 1 + k * inc, + reinterpret_cast(dmat.fortran_vec ()) + 1 + k * inc, + incfd, ierr)); + + if (ierr < 0) + error ("__pchip_deriv__: PCHIM failed for imaginary part with ierr = %" + OCTAVE_F77_INT_TYPE_FORMAT, ierr); - for (volatile octave_idx_type i = (rows ? nyr : nyc); i > 0; i--) + k++; + } + + retval = dmat; + } + else { - F77_XFCN (pchim, PCHIM, (nx, xvec.data (), - ymat.data () + k * inc, - dmat.fortran_vec () + k * inc, - incfd, ierr)); + FloatMatrix ymat (args(1).float_matrix_value ()); + + octave_idx_type nyr = ymat.rows (); + octave_idx_type nyc = ymat.columns (); + + if (nx != (rows ? nyc : nyr)) + error ("__pchip_deriv__: X and Y dimension mismatch"); + + FloatMatrix dmat (nyr, nyc); - k++; + F77_INT ierr; + const F77_INT incfd = (rows ? to_f77_int (nyr) : 1); + volatile const octave_idx_type inc = (rows ? 1 : nyr); + volatile octave_idx_type k = 0; - if (ierr < 0) - error ("__pchip_deriv__: PCHIM failed with ierr = %" - OCTAVE_F77_INT_TYPE_FORMAT, ierr); + for (volatile octave_idx_type i = (rows ? nyr : nyc); i > 0; i--) + { + F77_XFCN (pchim, PCHIM, (nx, xvec.data (), + ymat.data () + k * inc, + dmat.fortran_vec () + k * inc, + incfd, ierr)); + + k++; + + if (ierr < 0) + error ("__pchip_deriv__: PCHIM failed with ierr = %" + OCTAVE_F77_INT_TYPE_FORMAT, ierr); + } + + retval = dmat; } - - retval = dmat; } else { ColumnVector xvec (args(0).vector_value ()); - Matrix ymat (args(1).matrix_value ()); - F77_INT nx = to_f77_int (xvec.numel ()); - if (nx < 2) error ("__pchip_deriv__: X must be at least of length 2"); - octave_idx_type nyr = ymat.rows (); - octave_idx_type nyc = ymat.columns (); + if (args(1).iscomplex ()) + { + ComplexMatrix ymat (args(1).complex_matrix_value ()); + + octave_idx_type nyr = ymat.rows (); + octave_idx_type nyc = ymat.columns (); - if (nx != (rows ? nyc : nyr)) - error ("__pchip_deriv__: X and Y dimension mismatch"); + if (nx != (rows ? nyc : nyr)) + error ("__pchip_deriv__: X and Y dimension mismatch"); + + ComplexMatrix dmat (nyr, nyc); + + F77_INT ierr; + const F77_INT incfd = (rows ? to_f77_int (2*nyr) : 2); + volatile const octave_idx_type inc = (rows ? 2 : 2*nyr); + volatile octave_idx_type k = 0; - Matrix dmat (nyr, nyc); + for (volatile octave_idx_type i = (rows ? nyr : nyc); i > 0; i--) + { + F77_XFCN (dpchim, DPCHIM, (nx, xvec.data (), + reinterpret_cast(ymat.data ()) + k * inc, + reinterpret_cast(dmat.fortran_vec ()) + k * inc, + incfd, ierr)); - F77_INT ierr; - const F77_INT incfd = (rows ? to_f77_int (nyr) : 1); - volatile const octave_idx_type inc = (rows ? 1 : nyr); - volatile octave_idx_type k = 0; + if (ierr < 0) + error ("__pchip_deriv__: DPCHIM failed for real part with ierr = %" + OCTAVE_F77_INT_TYPE_FORMAT, ierr); + + F77_XFCN (dpchim, DPCHIM, (nx, xvec.data (), + reinterpret_cast(ymat.data ()) + 1 + k * inc, + reinterpret_cast(dmat.fortran_vec ()) + 1 + k * inc, + incfd, ierr)); + + if (ierr < 0) + error ("__pchip_deriv__: DPCHIM failed for imaginary part with ierr = %" + OCTAVE_F77_INT_TYPE_FORMAT, ierr); - for (volatile octave_idx_type i = (rows ? nyr : nyc); i > 0; i--) + k++; + } + + retval = dmat; + } + else { - F77_XFCN (dpchim, DPCHIM, (nx, xvec.data (), - ymat.data () + k * inc, - dmat.fortran_vec () + k * inc, - incfd, ierr)); - k++; + Matrix ymat (args(1).matrix_value ()); + + octave_idx_type nyr = ymat.rows (); + octave_idx_type nyc = ymat.columns (); + + if (nx != (rows ? nyc : nyr)) + error ("__pchip_deriv__: X and Y dimension mismatch"); + + Matrix dmat (nyr, nyc); + + F77_INT ierr; + const F77_INT incfd = (rows ? to_f77_int (nyr) : 1); + volatile const octave_idx_type inc = (rows ? 1 : nyr); + volatile octave_idx_type k = 0; - if (ierr < 0) - error ("__pchip_deriv__: DPCHIM failed with ierr = %" - OCTAVE_F77_INT_TYPE_FORMAT, ierr); + for (volatile octave_idx_type i = (rows ? nyr : nyc); i > 0; i--) + { + F77_XFCN (dpchim, DPCHIM, (nx, xvec.data (), + ymat.data () + k * inc, + dmat.fortran_vec () + k * inc, + incfd, ierr)); + k++; + + if (ierr < 0) + error ("__pchip_deriv__: DPCHIM failed with ierr = %" + OCTAVE_F77_INT_TYPE_FORMAT, ierr); + } + + retval = dmat; } - - retval = dmat; } } @@ -137,8 +225,37 @@ } /* -## No test needed for internal helper function. -%!assert (1) +%!shared x, y +%! x = 0:3; +%! y = x.^2 + 1i * x.^3; + +%!test +%! d_complex = __pchip_deriv__ (x, y, 2); +%! d_real = __pchip_deriv__ (x, real (y), 2); +%! d_imag = __pchip_deriv__ (x, imag (y), 2); +%! assert (real (d_complex), d_real); +%! assert (imag (d_complex), d_imag); + +%!test +%! d_complex = __pchip_deriv__ (x.', y.'); +%! d_real = __pchip_deriv__ (x.', real (y.')); +%! d_imag = __pchip_deriv__ (x.', imag (y.')); +%! assert (real (d_complex), d_real); +%! assert (imag (d_complex), d_imag); + +%!test +%! d_complex = __pchip_deriv__ (single (x), single (y), 2); +%! d_real = __pchip_deriv__ (single (x), real (single (y)), 2); +%! d_imag = __pchip_deriv__ (single (x), imag (single (y)), 2); +%! assert (real (d_complex), d_real); +%! assert (imag (d_complex), d_imag); + +%!test +%! d_complex = __pchip_deriv__ (single (x'), single (y')); +%! d_real = __pchip_deriv__ (single (x'), real (single (y'))); +%! d_imag = __pchip_deriv__ (single (x'), imag (single (y'))); +%! assert (real (d_complex), d_real); +%! assert (imag (d_complex), d_imag); */ OCTAVE_NAMESPACE_END diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/bsxfun.cc --- a/libinterp/corefcn/bsxfun.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/bsxfun.cc Thu Mar 03 13:37:10 2022 -0500 @@ -719,10 +719,12 @@ %!assert (bsxfun (f, a, b), a - repmat (b, [4, 1, 1])) %!assert (bsxfun (f, a, c), a - repmat (c, [1, 4, 1])) %!assert (bsxfun (f, a, d), a - repmat (d, [1, 1, 4])) -%!assert (bsxfun ("minus", ones ([4, 0, 4]), ones ([4, 1, 4])), zeros ([4, 0, 4])) +%!assert (bsxfun ("minus", ones ([4, 0, 4]), ones ([4, 1, 4])), +%! zeros ([4, 0, 4])) ## The test below is a very hard case to treat -%!assert (bsxfun (f, ones ([4, 1, 4, 1]), ones ([1, 4, 1, 4])), zeros ([4, 4, 4, 4])) +%!assert (bsxfun (f, ones ([4, 1, 4, 1]), ones ([1, 4, 1, 4])), +%! zeros ([4, 4, 4, 4])) %!shared a, b, aa, bb %! ## FIXME: Set a known "good" random seed. See bug #51779. diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/call-stack.cc --- a/libinterp/corefcn/call-stack.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/call-stack.cc Thu Mar 03 13:37:10 2022 -0500 @@ -1138,7 +1138,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} max_stack_depth () @deftypefnx {} {@var{old_val} =} max_stack_depth (@var{new_val}) -@deftypefnx {} {} max_stack_depth (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} max_stack_depth (@var{new_val}, "local") Query or set the internal limit on the number of times a function may be called recursively. diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/cellfun.cc --- a/libinterp/corefcn/cellfun.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/cellfun.cc Thu Mar 03 13:37:10 2022 -0500 @@ -859,19 +859,27 @@ %! A = cellfun (@(x,y) cell2str (x,y), {1.1, 4}, {3.1, 6}, ... %! "ErrorHandler", @__cellfunerror); %! B = isfield (A(1), "message") && isfield (A(1), "index"); -%! assert ([(isfield (A(1), "identifier")), (isfield (A(2), "identifier"))], [true, true]); -%! assert ([(isfield (A(1), "message")), (isfield (A(2), "message"))], [true, true]); -%! assert ([(isfield (A(1), "index")), (isfield (A(2), "index"))], [true, true]); -%! assert ([(isempty (A(1).message)), (isempty (A(2).message))], [false, false]); +%! assert ([(isfield (A(1), "identifier")), (isfield (A(2), "identifier"))], +%! [true, true]); +%! assert ([(isfield (A(1), "message")), (isfield (A(2), "message"))], +%! [true, true]); +%! assert ([(isfield (A(1), "index")), (isfield (A(2), "index"))], +%! [true, true]); +%! assert ([(isempty (A(1).message)), (isempty (A(2).message))], +%! [false, false]); %! assert ([A(1).index, A(2).index], [1, 2]); %!test # Overwriting setting of "UniformOutput" true %! A = cellfun (@(x,y) cell2str (x,y), {1.1, 4}, {3.1, 6}, ... %! "UniformOutput", true, "ErrorHandler", @__cellfunerror); %! B = isfield (A(1), "message") && isfield (A(1), "index"); -%! assert ([(isfield (A(1), "identifier")), (isfield (A(2), "identifier"))], [true, true]); -%! assert ([(isfield (A(1), "message")), (isfield (A(2), "message"))], [true, true]); -%! assert ([(isfield (A(1), "index")), (isfield (A(2), "index"))], [true, true]); -%! assert ([(isempty (A(1).message)), (isempty (A(2).message))], [false, false]); +%! assert ([(isfield (A(1), "identifier")), (isfield (A(2), "identifier"))], +%! [true, true]); +%! assert ([(isfield (A(1), "message")), (isfield (A(2), "message"))], +%! [true, true]); +%! assert ([(isfield (A(1), "index")), (isfield (A(2), "index"))], +%! [true, true]); +%! assert ([(isempty (A(1).message)), (isempty (A(2).message))], +%! [false, false]); %! assert ([A(1).index, A(2).index], [1, 2]); ## Input arguments can be of type cell arrays of character or strings @@ -886,18 +894,26 @@ %!test %! A = cellfun (@(x,y) cell2str (x,y), {"a", "d"}, {"c", "f"}, ... %! "ErrorHandler", @__cellfunerror); -%! assert ([(isfield (A(1), "identifier")), (isfield (A(2), "identifier"))], [true, true]); -%! assert ([(isfield (A(1), "message")), (isfield (A(2), "message"))], [true, true]); -%! assert ([(isfield (A(1), "index")), (isfield (A(2), "index"))], [true, true]); -%! assert ([(isempty (A(1).message)), (isempty (A(2).message))], [false, false]); +%! assert ([(isfield (A(1), "identifier")), (isfield (A(2), "identifier"))], +%! [true, true]); +%! assert ([(isfield (A(1), "message")), (isfield (A(2), "message"))], +%! [true, true]); +%! assert ([(isfield (A(1), "index")), (isfield (A(2), "index"))], +%! [true, true]); +%! assert ([(isempty (A(1).message)), (isempty (A(2).message))], +%! [false, false]); %! assert ([A(1).index, A(2).index], [1, 2]); %!test # Overwriting setting of "UniformOutput" true %! A = cellfun (@(x,y) cell2str (x,y), {"a", "d"}, {"c", "f"}, ... %! "UniformOutput", true, "ErrorHandler", @__cellfunerror); -%! assert ([(isfield (A(1), "identifier")), (isfield (A(2), "identifier"))], [true, true]); -%! assert ([(isfield (A(1), "message")), (isfield (A(2), "message"))], [true, true]); -%! assert ([(isfield (A(1), "index")), (isfield (A(2), "index"))], [true, true]); -%! assert ([(isempty (A(1).message)), (isempty (A(2).message))], [false, false]); +%! assert ([(isfield (A(1), "identifier")), (isfield (A(2), "identifier"))], +%! [true, true]); +%! assert ([(isfield (A(1), "message")), (isfield (A(2), "message"))], +%! [true, true]); +%! assert ([(isfield (A(1), "index")), (isfield (A(2), "index"))], +%! [true, true]); +%! assert ([(isempty (A(1).message)), (isempty (A(2).message))], +%! [false, false]); %! assert ([A(1).index, A(2).index], [1, 2]); ## Structures cannot be handled by cellfun @@ -920,18 +936,26 @@ %!test %! A = cellfun (@(x,y) mat2str (x,y), {{1.1}, {4.2}}, {{3.1}, {2}}, ... %! "ErrorHandler", @__cellfunerror); -%! assert ([(isfield (A(1), "identifier")), (isfield (A(2), "identifier"))], [true, true]); -%! assert ([(isfield (A(1), "message")), (isfield (A(2), "message"))], [true, true]); -%! assert ([(isfield (A(1), "index")), (isfield (A(2), "index"))], [true, true]); -%! assert ([(isempty (A(1).message)), (isempty (A(2).message))], [false, false]); +%! assert ([(isfield (A(1), "identifier")), (isfield (A(2), "identifier"))], +%! [true, true]); +%! assert ([(isfield (A(1), "message")), (isfield (A(2), "message"))], +%! [true, true]); +%! assert ([(isfield (A(1), "index")), (isfield (A(2), "index"))], +%! [true, true]); +%! assert ([(isempty (A(1).message)), (isempty (A(2).message))], +%! [false, false]); %! assert ([A(1).index, A(2).index], [1, 2]); %!test # Overwriting setting of "UniformOutput" true %! A = cellfun (@(x,y) mat2str (x,y), {{1.1}, {4.2}}, {{3.1}, {2}}, ... %! "UniformOutput", true, "ErrorHandler", @__cellfunerror); -%! assert ([(isfield (A(1), "identifier")), (isfield (A(2), "identifier"))], [true, true]); -%! assert ([(isfield (A(1), "message")), (isfield (A(2), "message"))], [true, true]); -%! assert ([(isfield (A(1), "index")), (isfield (A(2), "index"))], [true, true]); -%! assert ([(isempty (A(1).message)), (isempty (A(2).message))], [false, false]); +%! assert ([(isfield (A(1), "identifier")), (isfield (A(2), "identifier"))], +%! [true, true]); +%! assert ([(isfield (A(1), "message")), (isfield (A(2), "message"))], +%! [true, true]); +%! assert ([(isfield (A(1), "index")), (isfield (A(2), "index"))], +%! [true, true]); +%! assert ([(isempty (A(1).message)), (isempty (A(2).message))], +%! [false, false]); %! assert ([A(1).index, A(2).index], [1, 2]); ## Input arguments can be of type cell array of structure arrays @@ -984,7 +1008,8 @@ %!assert (cellfun ("size", {zeros([1,2,3]),1}, 2), [2,1]) %!assert (cellfun ("size", {zeros([1,2,3]),1}, 3), [3,1]) %!assert (cellfun (@atan2, {1,1}, {1,2}), [atan2(1,1), atan2(1,2)]) -%!assert (cellfun (@atan2, {1,1}, {1,2},"UniformOutput", false), {atan2(1,1), atan2(1,2)}) +%!assert (cellfun (@atan2, {1,1}, {1,2},"UniformOutput", false), +%! {atan2(1,1), atan2(1,2)}) %!assert (cellfun (@sin, {1,2;3,4}), sin ([1,2;3,4])) %!assert (cellfun (@atan2, {1,1;1,1}, {1,2;1,2}), atan2 ([1,1;1,1],[1,2;1,2])) %!error cellfun (@factorial, {-1,3}) @@ -997,9 +1022,12 @@ %! assert (c, {".d", ".h"}); %!assert <*40467> (cellfun (@isreal, {1 inf nan []}), [true, true, true, true]) -%!assert <*40467> (cellfun (@isreal, {1 inf nan []}, "UniformOutput", false), {true, true, true, true}) -%!assert <*40467> (cellfun (@iscomplex, {1 inf nan []}), [false, false, false, false]) -%!assert <*40467> (cellfun (@iscomplex, {1 inf nan []}, "UniformOutput", false), {false, false, false, false}) +%!assert <*40467> (cellfun (@isreal, {1 inf nan []}, "UniformOutput", false), +%! {true, true, true, true}) +%!assert <*40467> (cellfun (@iscomplex, {1 inf nan []}), +%! [false, false, false, false]) +%!assert <*40467> (cellfun (@iscomplex, {1 inf nan []}, "UniformOutput", false), +%! {false, false, false, false}) %!error cellfun (1) %!error cellfun ("isclass", 1) @@ -1015,7 +1043,8 @@ %!endfunction %!test <*58411> %! global __errmsg; -%! assert (cellfun (@factorial, {1, 2, -3}, "ErrorHandler", @__errfcn), [1, 2, NaN]); +%! assert (cellfun (@factorial, {1, 2, -3}, "ErrorHandler", @__errfcn), +%! [1, 2, NaN]); %! assert (! isempty (__errmsg)); %! clear -global __errmsg; */ @@ -1537,19 +1566,27 @@ %! A = arrayfun (@(x,y) array2str (x,y), {1.1, 4}, {3.1, 6}, ... %! "ErrorHandler", @__arrayfunerror); %! B = isfield (A(1), "message") && isfield (A(1), "index"); -%! assert ([(isfield (A(1), "identifier")), (isfield (A(2), "identifier"))], [true, true]); -%! assert ([(isfield (A(1), "message")), (isfield (A(2), "message"))], [true, true]); -%! assert ([(isfield (A(1), "index")), (isfield (A(2), "index"))], [true, true]); -%! assert ([(isempty (A(1).message)), (isempty (A(2).message))], [false, false]); +%! assert ([(isfield (A(1), "identifier")), (isfield (A(2), "identifier"))], +%! [true, true]); +%! assert ([(isfield (A(1), "message")), (isfield (A(2), "message"))], +%! [true, true]); +%! assert ([(isfield (A(1), "index")), (isfield (A(2), "index"))], +%! [true, true]); +%! assert ([(isempty (A(1).message)), (isempty (A(2).message))], +%! [false, false]); %! assert ([A(1).index, A(2).index], [1, 2]); %!test # Overwriting setting of "UniformOutput" true %! A = arrayfun (@(x,y) array2str (x,y), {1.1, 4}, {3.1, 6}, ... %! "UniformOutput", true, "ErrorHandler", @__arrayfunerror); %! B = isfield (A(1), "message") && isfield (A(1), "index"); -%! assert ([(isfield (A(1), "identifier")), (isfield (A(2), "identifier"))], [true, true]); -%! assert ([(isfield (A(1), "message")), (isfield (A(2), "message"))], [true, true]); -%! assert ([(isfield (A(1), "index")), (isfield (A(2), "index"))], [true, true]); -%! assert ([(isempty (A(1).message)), (isempty (A(2).message))], [false, false]); +%! assert ([(isfield (A(1), "identifier")), (isfield (A(2), "identifier"))], +%! [true, true]); +%! assert ([(isfield (A(1), "message")), (isfield (A(2), "message"))], +%! [true, true]); +%! assert ([(isfield (A(1), "index")), (isfield (A(2), "index"))], +%! [true, true]); +%! assert ([(isempty (A(1).message)), (isempty (A(2).message))], +%! [false, false]); %! assert ([A(1).index, A(2).index], [1, 2]); ## Input arguments can be of type character or strings @@ -1565,7 +1602,8 @@ %!test %! A = arrayfun (@(x,y) cell2str (x,y), ["a", "d"], ["c", "f"], ... %! "ErrorHandler", @__arrayfunerror); -%! B = isfield (A(1), "identifier") && isfield (A(1), "message") && isfield (A(1), "index"); +%! B = isfield (A(1), "identifier") && isfield (A(1), "message") ... +%! && isfield (A(1), "index"); %! assert (B, true); ## Input arguments can be of type structure @@ -1609,18 +1647,26 @@ %! assert (A, {true, false}); %!test %! A = arrayfun (@(x,y) num2str(x,y), {1.1, 4.2}, {3.1, 2}, "ErrorHandler", @__arrayfunerror); -%! assert ([(isfield (A(1), "identifier")), (isfield (A(2), "identifier"))], [true, true]); -%! assert ([(isfield (A(1), "message")), (isfield (A(2), "message"))], [true, true]); -%! assert ([(isfield (A(1), "index")), (isfield (A(2), "index"))], [true, true]); -%! assert ([(isempty (A(1).message)), (isempty (A(2).message))], [false, false]); +%! assert ([(isfield (A(1), "identifier")), (isfield (A(2), "identifier"))], +%! [true, true]); +%! assert ([(isfield (A(1), "message")), (isfield (A(2), "message"))], +%! [true, true]); +%! assert ([(isfield (A(1), "index")), (isfield (A(2), "index"))], +%! [true, true]); +%! assert ([(isempty (A(1).message)), (isempty (A(2).message))], +%! [false, false]); %! assert ([A(1).index, A(2).index], [1, 2]); %!test %! A = arrayfun (@(x,y) num2str (x,y), {1.1, 4.2}, {3.1, 2}, ... %! "UniformOutput", true, "ErrorHandler", @__arrayfunerror); -%! assert ([(isfield (A(1), "identifier")), (isfield (A(2), "identifier"))], [true, true]); -%! assert ([(isfield (A(1), "message")), (isfield (A(2), "message"))], [true, true]); -%! assert ([(isfield (A(1), "index")), (isfield (A(2), "index"))], [true, true]); -%! assert ([(isempty (A(1).message)), (isempty (A(2).message))], [false, false]); +%! assert ([(isfield (A(1), "identifier")), (isfield (A(2), "identifier"))], +%! [true, true]); +%! assert ([(isfield (A(1), "message")), (isfield (A(2), "message"))], +%! [true, true]); +%! assert ([(isfield (A(1), "index")), (isfield (A(2), "index"))], +%! [true, true]); +%! assert ([(isempty (A(1).message)), (isempty (A(2).message))], +%! [false, false]); %! assert ([A(1).index, A(2).index], [1, 2]); */ @@ -1944,8 +1990,8 @@ do_mat2cell_2d (const Array2D& a, const Array *d, int nd) { Cell retval; - assert (nd == 1 || nd == 2); - assert (a.ndims () == 2); + error_unless (nd == 1 || nd == 2); + error_unless (a.ndims () == 2); if (mat2cell_mismatch (a.dims (), d, nd)) return retval; @@ -2001,7 +2047,7 @@ do_mat2cell_nd (const ArrayND& a, const Array *d, int nd) { Cell retval; - assert (nd >= 1); + error_unless (nd >= 1); if (mat2cell_mismatch (a.dims (), d, nd)) return retval; @@ -2065,7 +2111,7 @@ do_mat2cell (octave_value& a, const Array *d, int nd) { Cell retval; - assert (nd >= 1); + error_unless (nd >= 1); if (mat2cell_mismatch (a.dims (), d, nd)) return retval; diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/chol.cc --- a/libinterp/corefcn/chol.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/chol.cc Thu Mar 03 13:37:10 2022 -0500 @@ -314,7 +314,8 @@ /* %!assert (chol ([2, 1; 1, 1]), [sqrt(2), 1/sqrt(2); 0, 1/sqrt(2)], sqrt (eps)) -%!assert (chol (single ([2, 1; 1, 1])), single ([sqrt(2), 1/sqrt(2); 0, 1/sqrt(2)]), sqrt (eps ("single"))) +%!assert (chol (single ([2, 1; 1, 1])), +%! single ([sqrt(2), 1/sqrt(2); 0, 1/sqrt(2)]), sqrt (eps ("single"))) %!assert (chol ([2, 1; 1, 1], "upper"), [sqrt(2), 1/sqrt(2); 0, 1/sqrt(2)], %! sqrt (eps)) diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/daspk.cc --- a/libinterp/corefcn/daspk.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/daspk.cc Thu Mar 03 13:37:10 2022 -0500 @@ -68,7 +68,7 @@ { ColumnVector retval; - assert (x.numel () == xdot.numel ()); + error_unless (x.numel () == xdot.numel ()); octave_value_list args; @@ -117,7 +117,7 @@ { Matrix retval; - assert (x.numel () == xdot.numel ()); + error_unless (x.numel () == xdot.numel ()); octave_value_list args; diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/dasrt.cc --- a/libinterp/corefcn/dasrt.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/dasrt.cc Thu Mar 03 13:37:10 2022 -0500 @@ -69,7 +69,7 @@ { ColumnVector retval; - assert (x.numel () == xdot.numel ()); + error_unless (x.numel () == xdot.numel ()); octave_value_list args; @@ -155,7 +155,7 @@ { Matrix retval; - assert (x.numel () == xdot.numel ()); + error_unless (x.numel () == xdot.numel ()); octave_value_list args; diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/dassl.cc --- a/libinterp/corefcn/dassl.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/dassl.cc Thu Mar 03 13:37:10 2022 -0500 @@ -67,7 +67,7 @@ { ColumnVector retval; - assert (x.numel () == xdot.numel ()); + error_unless (x.numel () == xdot.numel ()); octave_value_list args; @@ -116,7 +116,7 @@ { Matrix retval; - assert (x.numel () == xdot.numel ()); + error_unless (x.numel () == xdot.numel ()); octave_value_list args; diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/data.cc --- a/libinterp/corefcn/data.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/data.cc Thu Mar 03 13:37:10 2022 -0500 @@ -703,8 +703,10 @@ %!assert (rem ([1, 2, 3; -1, -2, -3], 2), [1, 0, 1; -1, 0, -1]) %!assert (rem ([1, 2, 3; -1, -2, -3], 2 * ones (2, 3)),[1, 0, 1; -1, 0, -1]) %!assert (rem ([0, 1, 2], [0, 0, 1]), [NaN, NaN, 0]) -%!assert (rem (uint8 ([1, 2, 3; -1, -2, -3]), uint8 (2)), uint8 ([1, 0, 1; -1, 0, -1])) -%!assert (uint8 (rem ([1, 2, 3; -1, -2, -3], 2 * ones (2, 3))),uint8 ([1, 0, 1; -1, 0, -1])) +%!assert (rem (uint8 ([1, 2, 3; -1, -2, -3]), uint8 (2)), +%! uint8 ([1, 0, 1; -1, 0, -1])) +%!assert (uint8 (rem ([1, 2, 3; -1, -2, -3], 2 * ones (2, 3))), +%! uint8 ([1, 0, 1; -1, 0, -1])) %!assert (rem (uint8 ([0, 1, 2]), [0, 0, 1]), uint8 ([0, 0, 0])) ## Test sparse implementations @@ -1020,12 +1022,15 @@ %!assert (cumprod ([1, 2, 3]), [1, 2, 6]) %!assert (cumprod ([-1; -2; -3]), [-1; 2; -6]) %!assert (cumprod ([i, 2+i, -3+2i, 4]), [i, -1+2i, -1-8i, -4-32i]) -%!assert (cumprod ([1, 2, 3; i, 2i, 3i; 1+i, 2+2i, 3+3i]), [1, 2, 3; i, 4i, 9i; -1+i, -8+8i, -27+27i]) +%!assert (cumprod ([1, 2, 3; i, 2i, 3i; 1+i, 2+2i, 3+3i]), +%! [1, 2, 3; i, 4i, 9i; -1+i, -8+8i, -27+27i]) %!assert (cumprod (single ([1, 2, 3])), single ([1, 2, 6])) %!assert (cumprod (single ([-1; -2; -3])), single ([-1; 2; -6])) -%!assert (cumprod (single ([i, 2+i, -3+2i, 4])), single ([i, -1+2i, -1-8i, -4-32i])) -%!assert (cumprod (single ([1, 2, 3; i, 2i, 3i; 1+i, 2+2i, 3+3i])), single ([1, 2, 3; i, 4i, 9i; -1+i, -8+8i, -27+27i])) +%!assert (cumprod (single ([i, 2+i, -3+2i, 4])), +%! single ([i, -1+2i, -1-8i, -4-32i])) +%!assert (cumprod (single ([1, 2, 3; i, 2i, 3i; 1+i, 2+2i, 3+3i])), +%! single ([1, 2, 3; i, 4i, 9i; -1+i, -8+8i, -27+27i])) %!assert (cumprod ([2, 3; 4, 5], 1), [2, 3; 8, 15]) %!assert (cumprod ([2, 3; 4, 5], 2), [2, 6; 4, 20]) @@ -1170,12 +1175,15 @@ %!assert (cumsum ([1, 2, 3]), [1, 3, 6]) %!assert (cumsum ([-1; -2; -3]), [-1; -3; -6]) %!assert (cumsum ([i, 2+i, -3+2i, 4]), [i, 2+2i, -1+4i, 3+4i]) -%!assert (cumsum ([1, 2, 3; i, 2i, 3i; 1+i, 2+2i, 3+3i]), [1, 2, 3; 1+i, 2+2i, 3+3i; 2+2i, 4+4i, 6+6i]) +%!assert (cumsum ([1, 2, 3; i, 2i, 3i; 1+i, 2+2i, 3+3i]), +%! [1, 2, 3; 1+i, 2+2i, 3+3i; 2+2i, 4+4i, 6+6i]) %!assert (cumsum (single ([1, 2, 3])), single ([1, 3, 6])) %!assert (cumsum (single ([-1; -2; -3])), single ([-1; -3; -6])) -%!assert (cumsum (single ([i, 2+i, -3+2i, 4])), single ([i, 2+2i, -1+4i, 3+4i])) -%!assert (cumsum (single ([1, 2, 3; i, 2i, 3i; 1+i, 2+2i, 3+3i])), single ([1, 2, 3; 1+i, 2+2i, 3+3i; 2+2i, 4+4i, 6+6i])) +%!assert (cumsum (single ([i, 2+i, -3+2i, 4])), +%! single ([i, 2+2i, -1+4i, 3+4i])) +%!assert (cumsum (single ([1, 2, 3; i, 2i, 3i; 1+i, 2+2i, 3+3i])), +%! single ([1, 2, 3; 1+i, 2+2i, 3+3i; 2+2i, 4+4i, 6+6i])) %!assert (cumsum ([1, 2; 3, 4], 1), [1, 2; 4, 6]) %!assert (cumsum ([1, 2; 3, 4], 2), [1, 3; 3, 7]) @@ -1254,35 +1262,53 @@ %!assert (full (diag ([1; 2; 3])), [1, 0, 0; 0, 2, 0; 0, 0, 3]) %!assert (diag ([1; 2; 3], 1), [0, 1, 0, 0; 0, 0, 2, 0; 0, 0, 0, 3; 0, 0, 0, 0]) -%!assert (diag ([1; 2; 3], 2), [0, 0, 1, 0, 0; 0, 0, 0, 2, 0; 0, 0, 0, 0, 3; 0, 0, 0, 0, 0; 0, 0, 0, 0, 0]) -%!assert (diag ([1; 2; 3],-1), [0, 0, 0, 0; 1, 0, 0, 0; 0, 2, 0, 0; 0, 0, 3, 0]) -%!assert (diag ([1; 2; 3],-2), [0, 0, 0, 0, 0; 0, 0, 0, 0, 0; 1, 0, 0, 0, 0; 0, 2, 0, 0, 0; 0, 0, 3, 0, 0]) +%!assert (diag ([1; 2; 3], 2), +%! [0 0 1 0 0; 0 0 0 2 0; 0 0 0 0 3; 0 0 0 0 0; 0 0 0 0 0]) +%!assert (diag ([1; 2; 3],-1), +%! [0 0 0 0; 1 0 0 0; 0 2 0 0; 0 0 3 0]) +%!assert (diag ([1; 2; 3],-2), +%! [0 0 0 0 0; 0 0 0 0 0; 1 0 0 0 0; 0 2 0 0 0; 0 0 3 0 0]) %!assert (diag ([1, 0, 0; 0, 2, 0; 0, 0, 3]), [1; 2; 3]) -%!assert (diag ([0, 1, 0, 0; 0, 0, 2, 0; 0, 0, 0, 3; 0, 0, 0, 0], 1), [1; 2; 3]) -%!assert (diag ([0, 0, 0, 0; 1, 0, 0, 0; 0, 2, 0, 0; 0, 0, 3, 0], -1), [1; 2; 3]) +%!assert (diag ([0, 1, 0, 0; 0, 0, 2, 0; 0, 0, 0, 3; 0, 0, 0, 0], 1), +%! [1; 2; 3]) +%!assert (diag ([0, 0, 0, 0; 1, 0, 0, 0; 0, 2, 0, 0; 0, 0, 3, 0], -1), +%! [1; 2; 3]) %!assert (diag (ones (1, 0), 2), zeros (2)) %!assert (diag (1:3, 4, 2), [1, 0; 0, 2; 0, 0; 0, 0]) -%!assert (full (diag (single ([1; 2; 3]))), single ([1, 0, 0; 0, 2, 0; 0, 0, 3])) -%!assert (diag (single ([1; 2; 3]), 1), single ([0, 1, 0, 0; 0, 0, 2, 0; 0, 0, 0, 3; 0, 0, 0, 0])) -%!assert (diag (single ([1; 2; 3]), 2), single ([0, 0, 1, 0, 0; 0, 0, 0, 2, 0; 0, 0, 0, 0, 3; 0, 0, 0, 0, 0; 0, 0, 0, 0, 0])) -%!assert (diag (single ([1; 2; 3]),-1), single ([0, 0, 0, 0; 1, 0, 0, 0; 0, 2, 0, 0; 0, 0, 3, 0])) -%!assert (diag (single ([1; 2; 3]),-2), single ([0, 0, 0, 0, 0; 0, 0, 0, 0, 0; 1, 0, 0, 0, 0; 0, 2, 0, 0, 0; 0, 0, 3, 0, 0])) +%!assert (full (diag (single ([1; 2; 3]))), +%! single ([1, 0, 0; 0, 2, 0; 0, 0, 3])) +%!assert (diag (single ([1; 2; 3]), 1), +%! single ([0, 1, 0, 0; 0, 0, 2, 0; 0, 0, 0, 3; 0, 0, 0, 0])) +%!assert (diag (single ([1; 2; 3]), 2), +%! single ([0 0 1 0 0; 0 0 0 2 0; 0 0 0 0 3; 0 0 0 0 0; 0 0 0 0 0])) +%!assert (diag (single ([1; 2; 3]),-1), +%! single ([0, 0, 0, 0; 1, 0, 0, 0; 0, 2, 0, 0; 0, 0, 3, 0])) +%!assert (diag (single ([1; 2; 3]),-2), +%! single ([0 0 0 0 0; 0 0 0 0 0; 1 0 0 0 0; 0 2 0 0 0; 0 0 3 0 0])) %!assert (diag (single ([1, 0, 0; 0, 2, 0; 0, 0, 3])), single ([1; 2; 3])) -%!assert (diag (single ([0, 1, 0, 0; 0, 0, 2, 0; 0, 0, 0, 3; 0, 0, 0, 0]), 1), single ([1; 2; 3])) -%!assert (diag (single ([0, 0, 0, 0; 1, 0, 0, 0; 0, 2, 0, 0; 0, 0, 3, 0]), -1), single ([1; 2; 3])) +%!assert (diag (single ([0, 1, 0, 0; 0, 0, 2, 0; 0, 0, 0, 3; 0, 0, 0, 0]), 1), +%! single ([1; 2; 3])) +%!assert (diag (single ([0, 0, 0, 0; 1, 0, 0, 0; 0, 2, 0, 0; 0, 0, 3, 0]), -1), +%! single ([1; 2; 3])) %!assert (diag (int8 ([1; 2; 3])), int8 ([1, 0, 0; 0, 2, 0; 0, 0, 3])) -%!assert (diag (int8 ([1; 2; 3]), 1), int8 ([0, 1, 0, 0; 0, 0, 2, 0; 0, 0, 0, 3; 0, 0, 0, 0])) -%!assert (diag (int8 ([1; 2; 3]), 2), int8 ([0, 0, 1, 0, 0; 0, 0, 0, 2, 0; 0, 0, 0, 0, 3; 0, 0, 0, 0, 0; 0, 0, 0, 0, 0])) -%!assert (diag (int8 ([1; 2; 3]),-1), int8 ([0, 0, 0, 0; 1, 0, 0, 0; 0, 2, 0, 0; 0, 0, 3, 0])) -%!assert (diag (int8 ([1; 2; 3]),-2), int8 ([0, 0, 0, 0, 0; 0, 0, 0, 0, 0; 1, 0, 0, 0, 0; 0, 2, 0, 0, 0; 0, 0, 3, 0, 0])) +%!assert (diag (int8 ([1; 2; 3]), 1), +%! int8 ([0, 1, 0, 0; 0, 0, 2, 0; 0, 0, 0, 3; 0, 0, 0, 0])) +%!assert (diag (int8 ([1; 2; 3]), 2), +%! int8 ([0 0 1 0 0; 0 0 0 2 0; 0 0 0 0 3; 0 0 0 0 0; 0 0 0 0 0])) +%!assert (diag (int8 ([1; 2; 3]),-1), +%! int8 ([0 0 0 0; 1 0 0 0; 0 2 0 0; 0 0 3 0])) +%!assert (diag (int8 ([1; 2; 3]),-2), +%! int8 ([0 0 0 0 0; 0 0 0 0 0; 1 0 0 0 0; 0 2 0 0 0; 0 0 3 0 0])) %!assert (diag (int8 ([1, 0, 0; 0, 2, 0; 0, 0, 3])), int8 ([1; 2; 3])) -%!assert (diag (int8 ([0, 1, 0, 0; 0, 0, 2, 0; 0, 0, 0, 3; 0, 0, 0, 0]), 1), int8 ([1; 2; 3])) -%!assert (diag (int8 ([0, 0, 0, 0; 1, 0, 0, 0; 0, 2, 0, 0; 0, 0, 3, 0]), -1), int8 ([1; 2; 3])) +%!assert (diag (int8 ([0, 1, 0, 0; 0, 0, 2, 0; 0, 0, 0, 3; 0, 0, 0, 0]), 1), +%! int8 ([1; 2; 3])) +%!assert (diag (int8 ([0, 0, 0, 0; 1, 0, 0, 0; 0, 2, 0, 0; 0, 0, 3, 0]), -1), +%! int8 ([1; 2; 3])) %!assert (diag (1, 3, 3), diag ([1, 0, 0])) %!assert (diag (i, 3, 3), diag ([i, 0, 0])) @@ -1295,7 +1321,8 @@ %!assert <*37411> (diag (diag ([5, 2, 3])(:,1)), diag([5 0 0 ])) %!assert <*37411> (diag (diag ([5, 2, 3])(:,1), 2), [0 0 5 0 0; zeros(4, 5)]) -%!assert <*37411> (diag (diag ([5, 2, 3])(:,1), -2), [[0 0 5 0 0]', zeros(5, 4)]) +%!assert <*37411> (diag (diag ([5, 2, 3])(:,1), -2), +%! [[0 0 5 0 0]', zeros(5, 4)]) ## Test non-square size %!assert (diag ([1,2,3], 6, 3), [1 0 0; 0 2 0; 0 0 3; 0 0 0; 0 0 0; 0 0 0]) @@ -1464,14 +1491,16 @@ %!assert (prod (single ([1, 2, 3])), single (6)) %!assert (prod (single ([-1; -2; -3])), single (-6)) %!assert (prod (single ([i, 2+i, -3+2i, 4])), single (-4 - 32i)) -%!assert (prod (single ([1, 2, 3; i, 2i, 3i; 1+i, 2+2i, 3+3i])), single ([-1+i, -8+8i, -27+27i])) +%!assert (prod (single ([1, 2, 3; i, 2i, 3i; 1+i, 2+2i, 3+3i])), +%! single ([-1+i, -8+8i, -27+27i])) ## Test sparse %!assert (prod (sparse ([1, 2, 3])), sparse (6)) %!assert (prod (sparse ([-1; -2; -3])), sparse (-6)) ## Commented out until bug #42290 is fixed #%!assert (prod (sparse ([i, 2+i, -3+2i, 4])), sparse (-4 - 32i)) -#%!assert (prod (sparse ([1, 2, 3; i, 2i, 3i; 1+i, 2+2i, 3+3i])), sparse ([-1+i, -8+8i, -27+27i])) +#%!assert (prod (sparse ([1, 2, 3; i, 2i, 3i; 1+i, 2+2i, 3+3i])), +#%! sparse ([-1+i, -8+8i, -27+27i])) %!assert (prod ([1, 2; 3, 4], 1), [3, 8]) %!assert (prod ([1, 2; 3, 4], 2), [2; 12]) @@ -1507,7 +1536,8 @@ %!assert (prod (single ([1, 2, 3]), "double"), 6) %!assert (prod (single ([-1; -2; -3]), "double"), -6) %!assert (prod (single ([i, 2+i, -3+2i, 4]), "double"), -4 - 32i) -%!assert (prod (single ([1, 2, 3; i, 2i, 3i; 1+i, 2+2i, 3+3i]), "double"), [-1+i, -8+8i, -27+27i]) +%!assert (prod (single ([1, 2, 3; i, 2i, 3i; 1+i, 2+2i, 3+3i]), "double"), +%! [-1+i, -8+8i, -27+27i]) ## Test "native" type argument %!assert (prod (uint8 ([1, 2, 3]), "native"), uint8 (6)) @@ -2254,7 +2284,8 @@ /* %!test %! c = {"foo"; "bar"; "bazoloa"}; -%! assert (vertcat (c, "a", "bc", "def"), {"foo"; "bar"; "bazoloa"; "a"; "bc"; "def"}); +%! assert (vertcat (c, "a", "bc", "def"), +%! {"foo"; "bar"; "bazoloa"; "a"; "bc"; "def"}); */ DEFUN (cat, args, , @@ -2321,11 +2352,13 @@ %! assert (cat (1, cast (1, t1), cast (2, t2)), cast ([1; 2], tr)); %! assert (cat (1, cast (1, t1), cast ([2; 3], t2)), cast ([1; 2; 3], tr)); %! assert (cat (1, cast ([1; 2], t1), cast (3, t2)), cast ([1; 2; 3], tr)); -%! assert (cat (1, cast ([1; 2], t1), cast ([3; 4], t2)), cast ([1; 2; 3; 4], tr)); +%! assert (cat (1, cast ([1; 2], t1), cast ([3; 4], t2)), +%! cast ([1; 2; 3; 4], tr)); %! assert (cat (2, cast (1, t1), cast (2, t2)), cast ([1, 2], tr)); %! assert (cat (2, cast (1, t1), cast ([2, 3], t2)), cast ([1, 2, 3], tr)); %! assert (cat (2, cast ([1, 2], t1), cast (3, t2)), cast ([1, 2, 3], tr)); -%! assert (cat (2, cast ([1, 2], t1), cast ([3, 4], t2)), cast ([1, 2, 3, 4], tr)); +%! assert (cat (2, cast ([1, 2], t1), cast ([3, 4], t2)), +%! cast ([1, 2, 3, 4], tr)); %! %! assert ([cast(1, t1); cast(2, t2)], cast ([1; 2], tr)); %! assert ([cast(1, t1); cast([2; 3], t2)], cast ([1; 2; 3], tr)); @@ -2340,12 +2373,13 @@ %! assert (cat (1, cast (1i, t1), cast (2, t2)), cast ([1i; 2], tr)); %! assert (cat (1, cast (1i, t1), cast ([2; 3], t2)), cast ([1i; 2; 3], tr)); %! assert (cat (1, cast ([1i; 2], t1), cast (3, t2)), cast ([1i; 2; 3], tr)); -%! assert (cat (1, cast ([1i; 2], t1), cast ([3; 4], t2)), cast ([1i; 2; 3; 4], tr)); +%! assert (cat (1, cast ([1i; 2], t1), cast ([3; 4], t2)), +%! cast ([1i; 2; 3; 4], tr)); %! assert (cat (2, cast (1i, t1), cast (2, t2)), cast ([1i, 2], tr)); %! assert (cat (2, cast (1i, t1), cast ([2, 3], t2)), cast ([1i, 2, 3], tr)); %! assert (cat (2, cast ([1i, 2], t1), cast (3, t2)), cast ([1i, 2, 3], tr)); -%! assert (cat (2, cast ([1i, 2], t1), cast ([3, 4], t2)), cast ([1i, 2, 3, 4], tr)); -%! +%! assert (cat (2, cast ([1i, 2], t1), cast ([3, 4], t2)), +%! cast ([1i, 2, 3, 4], tr)); %! assert ([cast(1i, t1); cast(2, t2)], cast ([1i; 2], tr)); %! assert ([cast(1i, t1); cast([2; 3], t2)], cast ([1i; 2; 3], tr)); %! assert ([cast([1i; 2], t1); cast(3, t2)], cast ([1i; 2; 3], tr)); @@ -2358,12 +2392,13 @@ %! assert (cat (1, cast (1, t1), cast (2i, t2)), cast ([1; 2i], tr)); %! assert (cat (1, cast (1, t1), cast ([2i; 3], t2)), cast ([1; 2i; 3], tr)); %! assert (cat (1, cast ([1; 2], t1), cast (3i, t2)), cast ([1; 2; 3i], tr)); -%! assert (cat (1, cast ([1; 2], t1), cast ([3i; 4], t2)), cast ([1; 2; 3i; 4], tr)); +%! assert (cat (1, cast ([1; 2], t1), cast ([3i; 4], t2)), +%! cast ([1; 2; 3i; 4], tr)); %! assert (cat (2, cast (1, t1), cast (2i, t2)), cast ([1, 2i], tr)); %! assert (cat (2, cast (1, t1), cast ([2i, 3], t2)), cast ([1, 2i, 3], tr)); %! assert (cat (2, cast ([1, 2], t1), cast (3i, t2)), cast ([1, 2, 3i], tr)); -%! assert (cat (2, cast ([1, 2], t1), cast ([3i, 4], t2)), cast ([1, 2, 3i, 4], tr)); -%! +%! assert (cat (2, cast ([1, 2], t1), cast ([3i, 4], t2)), +%! cast ([1, 2, 3i, 4], tr)); %! assert ([cast(1, t1); cast(2i, t2)], cast ([1; 2i], tr)); %! assert ([cast(1, t1); cast([2i; 3], t2)], cast ([1; 2i; 3], tr)); %! assert ([cast([1; 2], t1); cast(3i, t2)], cast ([1; 2; 3i], tr)); @@ -2374,22 +2409,30 @@ %! assert ([cast([1, 2], t1), cast([3i, 4], t2)], cast ([1, 2, 3i, 4], tr)); %! %! assert (cat (1, cast (1i, t1), cast (2i, t2)), cast ([1i; 2i], tr)); -%! assert (cat (1, cast (1i, t1), cast ([2i; 3], t2)), cast ([1i; 2i; 3], tr)); -%! assert (cat (1, cast ([1i; 2], t1), cast (3i, t2)), cast ([1i; 2; 3i], tr)); -%! assert (cat (1, cast ([1i; 2], t1), cast ([3i; 4], t2)), cast ([1i; 2; 3i; 4], tr)); +%! assert (cat (1, cast (1i, t1), cast ([2i; 3], t2)), +%! cast ([1i; 2i; 3], tr)); +%! assert (cat (1, cast ([1i; 2], t1), cast (3i, t2)), +%! cast ([1i; 2; 3i], tr)); +%! assert (cat (1, cast ([1i; 2], t1), cast ([3i; 4], t2)), +%! cast ([1i; 2; 3i; 4], tr)); %! assert (cat (2, cast (1i, t1), cast (2i, t2)), cast ([1i, 2i], tr)); -%! assert (cat (2, cast (1i, t1), cast ([2i, 3], t2)), cast ([1i, 2i, 3], tr)); -%! assert (cat (2, cast ([1i, 2], t1), cast (3i, t2)), cast ([1i, 2, 3i], tr)); -%! assert (cat (2, cast ([1i, 2], t1), cast ([3i, 4], t2)), cast ([1i, 2, 3i, 4], tr)); +%! assert (cat (2, cast (1i, t1), cast ([2i, 3], t2)), +%! cast ([1i, 2i, 3], tr)); +%! assert (cat (2, cast ([1i, 2], t1), cast (3i, t2)), +%! cast ([1i, 2, 3i], tr)); +%! assert (cat (2, cast ([1i, 2], t1), cast ([3i, 4], t2)), +%! cast ([1i, 2, 3i, 4], tr)); %! %! assert ([cast(1i, t1); cast(2i, t2)], cast ([1i; 2i], tr)); %! assert ([cast(1i, t1); cast([2i; 3], t2)], cast ([1i; 2i; 3], tr)); %! assert ([cast([1i; 2], t1); cast(3i, t2)], cast ([1i; 2; 3i], tr)); -%! assert ([cast([1i; 2], t1); cast([3i; 4], t2)], cast ([1i; 2; 3i; 4], tr)); +%! assert ([cast([1i; 2], t1); cast([3i; 4], t2)], +%! cast ([1i; 2; 3i; 4], tr)); %! assert ([cast(1i, t1), cast(2i, t2)], cast ([1i, 2i], tr)); %! assert ([cast(1i, t1), cast([2i, 3], t2)], cast ([1i, 2i, 3], tr)); %! assert ([cast([1i, 2], t1), cast(3i, t2)], cast ([1i, 2, 3i], tr)); -%! assert ([cast([1i, 2], t1), cast([3i, 4], t2)], cast ([1i, 2, 3i, 4], tr)); +%! assert ([cast([1i, 2], t1), cast([3i, 4], t2)], +%! cast ([1i, 2, 3i, 4], tr)); %! endif %! ret = true; %!endfunction @@ -3173,7 +3216,8 @@ %!assert (sum (single ([1, 2, 3])), single (6)) %!assert (sum (single ([-1; -2; -3])), single (-6)) %!assert (sum (single ([i, 2+i, -3+2i, 4])), single (3+4i)) -%!assert (sum (single ([1, 2, 3; i, 2i, 3i; 1+i, 2+2i, 3+3i])), single ([2+2i, 4+4i, 6+6i])) +%!assert (sum (single ([1, 2, 3; i, 2i, 3i; 1+i, 2+2i, 3+3i])), +%! single ([2+2i, 4+4i, 6+6i])) %!assert (sum ([1, 2; 3, 4], 1), [4, 6]) %!assert (sum ([1, 2; 3, 4], 2), [3; 7]) @@ -3271,8 +3315,8 @@ DEFUN (islogical, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} islogical (@var{x}) -@deftypefnx {} {} isbool (@var{x}) +@deftypefn {} {@var{tf} =} islogical (@var{x}) +@deftypefnx {} {@var{tf} =} isbool (@var{x}) Return true if @var{x} is a logical object. @seealso{ischar, isfloat, isinteger, isstring, isnumeric, isa} @end deftypefn */) @@ -3301,7 +3345,7 @@ DEFUN (isinteger, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} isinteger (@var{x}) +@deftypefn {} {@var{tf} =} isinteger (@var{x}) Return true if @var{x} is an integer object (int8, uint8, int16, etc.). Note that @w{@code{isinteger (14)}} is false because numeric constants in @@ -3359,7 +3403,7 @@ DEFUN (iscomplex, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} iscomplex (@var{x}) +@deftypefn {} {@var{tf} =} iscomplex (@var{x}) Return true if @var{x} is a complex-valued numeric object. @seealso{isreal, isnumeric, ischar, isfloat, islogical, isstring, isa} @end deftypefn */) @@ -3389,7 +3433,7 @@ DEFUN (isfloat, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} isfloat (@var{x}) +@deftypefn {} {@var{tf} =} isfloat (@var{x}) Return true if @var{x} is a floating-point numeric object. Objects of class double or single are floating-point objects. @@ -3428,6 +3472,12 @@ @end example @seealso{real, imag, iscomplex, abs, arg} @end deftypefn */) +// Programming Note: Throughout this function the coding pattern +// octave_value (new XXX)) is used. This is done specifically because the +// default octave_value constructor would otherwise perform automatic narrowing +// (i.e., complex values with 0 for the imaginary part would be converted +// to real values). The complex() function *must* return a complex value +// even when the imaginary part is 0. { int nargin = args.length (); @@ -3565,11 +3615,10 @@ { const FloatNDArray im_val = im.float_array_value (); - FloatComplexNDArray result (im_val.dims (), - FloatComplex ()); + FloatComplexNDArray result (im_val.dims ()); for (octave_idx_type i = 0; i < im_val.numel (); i++) - result.xelem (i) = FloatComplex (re_val, im_val(i)); + result.xelem (i) = FloatComplex (re_val, im_val.xelem (i)); retval = octave_value (new octave_float_complex_matrix (result)); @@ -3583,11 +3632,10 @@ { float im_val = im.float_value (); - FloatComplexNDArray result (re_val.dims (), - FloatComplex ()); + FloatComplexNDArray result (re_val.dims ()); for (octave_idx_type i = 0; i < re_val.numel (); i++) - result.xelem (i) = FloatComplex (re_val(i), im_val); + result.xelem (i) = FloatComplex (re_val.xelem (i), im_val); retval = octave_value (new octave_float_complex_matrix (result)); @@ -3599,12 +3647,11 @@ if (re_val.dims () != im_val.dims ()) error ("complex: dimension mismatch"); - FloatComplexNDArray result (re_val.dims (), - FloatComplex ()); + FloatComplexNDArray result (re_val.dims ()); for (octave_idx_type i = 0; i < re_val.numel (); i++) - result.xelem (i) = FloatComplex (re_val(i), - im_val(i)); + result.xelem (i) = FloatComplex (re_val.xelem (i), + im_val.xelem (i)); retval = octave_value (new octave_float_complex_matrix (result)); @@ -3626,10 +3673,10 @@ { const NDArray im_val = im.array_value (); - ComplexNDArray result (im_val.dims (), Complex ()); + ComplexNDArray result (im_val.dims ()); for (octave_idx_type i = 0; i < im_val.numel (); i++) - result.xelem (i) = Complex (re_val, im_val(i)); + result.xelem (i) = Complex (re_val, im_val.xelem (i)); retval = octave_value (new octave_complex_matrix (result)); } @@ -3642,10 +3689,10 @@ { double im_val = im.double_value (); - ComplexNDArray result (re_val.dims (), Complex ()); + ComplexNDArray result (re_val.dims ()); for (octave_idx_type i = 0; i < re_val.numel (); i++) - result.xelem (i) = Complex (re_val(i), im_val); + result.xelem (i) = Complex (re_val.xelem (i), im_val); retval = octave_value (new octave_complex_matrix (result)); } @@ -3659,7 +3706,8 @@ ComplexNDArray result (re_val.dims (), Complex ()); for (octave_idx_type i = 0; i < re_val.numel (); i++) - result.xelem (i) = Complex (re_val(i), im_val(i)); + result.xelem (i) = Complex (re_val.xelem (i), + im_val.xelem (i)); retval = octave_value (new octave_complex_matrix (result)); } @@ -3714,7 +3762,7 @@ DEFUN (isreal, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} isreal (@var{x}) +@deftypefn {} {@var{tf} =} isreal (@var{x}) Return true if @var{x} is a non-complex matrix or scalar. For compatibility with @sc{matlab}, this includes logical and character @@ -3730,7 +3778,7 @@ DEFUN (isempty, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} isempty (@var{a}) +@deftypefn {} {@var{tf} =} isempty (@var{a}) Return true if @var{a} is an empty matrix (any one of its dimensions is zero). @seealso{isnull, isa} @@ -3749,7 +3797,7 @@ DEFUN (isnumeric, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} isnumeric (@var{x}) +@deftypefn {} {@var{tf} =} isnumeric (@var{x}) Return true if @var{x} is a numeric object, i.e., an integer, real, or complex array. @@ -3782,7 +3830,7 @@ DEFUN (isscalar, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} isscalar (@var{x}) +@deftypefn {} {@var{tf} =} isscalar (@var{x}) Return true if @var{x} is a scalar. A scalar is an object with two dimensions for which @code{size (@var{x})} @@ -3821,7 +3869,7 @@ DEFUN (isvector, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} isvector (@var{x}) +@deftypefn {} {@var{tf} =} isvector (@var{x}) Return true if @var{x} is a vector. A vector is a 2-D array where one of the dimensions is equal to 1 (either @@ -3862,7 +3910,7 @@ DEFUN (isrow, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} isrow (@var{x}) +@deftypefn {} {@var{tf} =} isrow (@var{x}) Return true if @var{x} is a row vector. A row vector is a 2-D array for which @code{size (@var{x})} returns @@ -3911,7 +3959,7 @@ DEFUN (iscolumn, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} iscolumn (@var{x}) +@deftypefn {} {@var{tf} =} iscolumn (@var{x}) Return true if @var{x} is a column vector. A column vector is a 2-D array for which @code{size (@var{x})} returns @@ -3960,7 +4008,7 @@ DEFUN (ismatrix, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} ismatrix (@var{x}) +@deftypefn {} {@var{tf} =} ismatrix (@var{x}) Return true if @var{x} is a 2-D array. A matrix is an object with two dimensions (@code{ndims (@var{x}) == 2}) for @@ -4009,7 +4057,7 @@ DEFUN (issquare, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} issquare (@var{x}) +@deftypefn {} {@var{tf} =} issquare (@var{x}) Return true if @var{x} is a 2-D square array. A square array is a 2-D object for which @code{size (@var{x})} returns @@ -4715,7 +4763,8 @@ %!assert (Inf (3, 2), [Inf, Inf; Inf, Inf; Inf, Inf]) %!assert (size (Inf (3, 4, 5)), [3, 4, 5]) -%!assert (Inf (3, "single"), single ([Inf, Inf, Inf; Inf, Inf, Inf; Inf, Inf, Inf])) +%!assert (Inf (3, "single"), +%! single ([Inf, Inf, Inf; Inf, Inf, Inf; Inf, Inf, Inf])) %!assert (Inf (2, 3, "single"), single ([Inf, Inf, Inf; Inf, Inf, Inf])) %!assert (Inf (3, 2, "single"), single ([Inf, Inf; Inf, Inf; Inf, Inf])) %!assert (size (inf (3, 4, 5, "single")), [3, 4, 5]) @@ -4723,7 +4772,8 @@ %!assert (Inf (2, 2, "like", speye (2)), sparse ([Inf, Inf; Inf, Inf])) %!assert (Inf (2, 2, "like", complex (ones (2, 2))), [Inf, Inf; Inf, Inf]) %!assert (Inf (2, 2, "like", double (1)), double ([Inf, Inf; Inf, Inf])) -%!assert (Inf (3, 3, "like", single (1)), single ([Inf, Inf, Inf; Inf, Inf, Inf; Inf, Inf, Inf])) +%!assert (Inf (3, 3, "like", single (1)), +%! single ([Inf, Inf, Inf; Inf, Inf, Inf; Inf, Inf, Inf])) %!assert (Inf (2, "like", single (1i)), single ([Inf, Inf; Inf, Inf])) %!error Inf (3, "like", int8 (1)) @@ -4794,14 +4844,16 @@ %!assert (NaN (3, 2), [NaN, NaN; NaN, NaN; NaN, NaN]) %!assert (size (NaN (3, 4, 5)), [3, 4, 5]) -%!assert (NaN (3, "single"), single ([NaN, NaN, NaN; NaN, NaN, NaN; NaN, NaN, NaN])) +%!assert (NaN (3, "single"), +%! single ([NaN, NaN, NaN; NaN, NaN, NaN; NaN, NaN, NaN])) %!assert (NaN (2, 3, "single"), single ([NaN, NaN, NaN; NaN, NaN, NaN])) %!assert (NaN (3, 2, "single"), single ([NaN, NaN; NaN, NaN; NaN, NaN])) %!assert (size (NaN (3, 4, 5, "single")), [3, 4, 5]) %!assert (NaN (2, 2, "like", double (1)), double ([NaN, NaN; NaN, NaN])) %!assert (NaN (2, 2, "like", complex (ones(2, 2))), [NaN, NaN; NaN, NaN]) -%!assert (NaN (3, 3, "like", single (1)), single ([NaN, NaN, NaN; NaN, NaN, NaN; NaN, NaN, NaN])) +%!assert (NaN (3, 3, "like", single (1)), +%! single ([NaN, NaN, NaN; NaN, NaN, NaN; NaN, NaN, NaN])) %!assert (NaN (2, "like", single (1i)), single ([NaN, NaN; NaN, NaN])) %!assert (NaN (2, 2, "like", speye (2)), sparse ([NaN, NaN; NaN, NaN])) @@ -4952,7 +5004,7 @@ %!assert (eps (Inf), NaN) %!assert (eps (NaN), NaN) %!assert (eps ([1/2 1 2 realmax 0 realmin/2 realmin/16 Inf NaN]), -%! [2^(-53) 2^(-52) 2^(-51) 2^971 2^(-1074) 2^(-1074) 2^(-1074) NaN NaN]) +%! [2^-53 2^-52 2^-51 2^971 2^-1074 2^-1074 2^-1074 NaN NaN]) %!assert (eps (single (1/2)), single (2^(-24))) %!assert (eps (single (1)), single (2^(-23))) %!assert (eps (single (2)), single (2^(-22))) @@ -4963,7 +5015,7 @@ %!assert (eps (single (Inf)), single (NaN)) %!assert (eps (single (NaN)), single (NaN)) %!assert (eps (single ([1/2 1 2 realmax("single") 0 realmin("single")/2 realmin("single")/16 Inf NaN])), -%! single ([2^(-24) 2^(-23) 2^(-22) 2^104 2^(-149) 2^(-149) 2^(-149) NaN NaN])) +%! single ([2^-24 2^-23 2^-22 2^104 2^-149 2^-149 2^-149 NaN NaN])) %!error eps (uint8 ([0 1 2])) */ @@ -7026,16 +7078,26 @@ ## Single %!assert (sort (single ([NaN, 1, -1, 2, Inf])), single ([-1, 1, 2, Inf, NaN])) -%!assert (sort (single ([NaN, 1, -1, 2, Inf]), 1), single ([NaN, 1, -1, 2, Inf])) -%!assert (sort (single ([NaN, 1, -1, 2, Inf]), 2), single ([-1, 1, 2, Inf, NaN])) -%!assert (sort (single ([NaN, 1, -1, 2, Inf]), 3), single ([NaN, 1, -1, 2, Inf])) -%!assert (sort (single ([NaN, 1, -1, 2, Inf]), "ascend"), single ([-1, 1, 2, Inf, NaN])) -%!assert (sort (single ([NaN, 1, -1, 2, Inf]), 2, "ascend"), single ([-1, 1, 2, Inf, NaN])) -%!assert (sort (single ([NaN, 1, -1, 2, Inf]), "descend"), single ([NaN, Inf, 2, 1, -1])) -%!assert (sort (single ([NaN, 1, -1, 2, Inf]), 2, "descend"), single ([NaN, Inf, 2, 1, -1])) -%!assert (sort (single ([3, 1, 7, 5; 8, 2, 6, 4])), single ([3, 1, 6, 4; 8, 2, 7, 5])) -%!assert (sort (single ([3, 1, 7, 5; 8, 2, 6, 4]), 1), single ([3, 1, 6, 4; 8, 2, 7, 5])) -%!assert (sort (single ([3, 1, 7, 5; 8, 2, 6, 4]), 2), single ([1, 3, 5, 7; 2, 4, 6, 8])) +%!assert (sort (single ([NaN, 1, -1, 2, Inf]), 1), +%! single ([NaN, 1, -1, 2, Inf])) +%!assert (sort (single ([NaN, 1, -1, 2, Inf]), 2), +%! single ([-1, 1, 2, Inf, NaN])) +%!assert (sort (single ([NaN, 1, -1, 2, Inf]), 3), +%! single ([NaN, 1, -1, 2, Inf])) +%!assert (sort (single ([NaN, 1, -1, 2, Inf]), "ascend"), +%! single ([-1, 1, 2, Inf, NaN])) +%!assert (sort (single ([NaN, 1, -1, 2, Inf]), 2, "ascend"), +%! single ([-1, 1, 2, Inf, NaN])) +%!assert (sort (single ([NaN, 1, -1, 2, Inf]), "descend"), +%! single ([NaN, Inf, 2, 1, -1])) +%!assert (sort (single ([NaN, 1, -1, 2, Inf]), 2, "descend"), +%! single ([NaN, Inf, 2, 1, -1])) +%!assert (sort (single ([3, 1, 7, 5; 8, 2, 6, 4])), +%! single ([3, 1, 6, 4; 8, 2, 7, 5])) +%!assert (sort (single ([3, 1, 7, 5; 8, 2, 6, 4]), 1), +%! single ([3, 1, 6, 4; 8, 2, 7, 5])) +%!assert (sort (single ([3, 1, 7, 5; 8, 2, 6, 4]), 2), +%! single ([1, 3, 5, 7; 2, 4, 6, 8])) %!assert (sort (single (1)), single (1)) %!test @@ -7045,16 +7107,26 @@ ## Single Complex %!assert (sort (single ([NaN, 1i, -1, 2, Inf])), single ([1i, -1, 2, Inf, NaN])) -%!assert (sort (single ([NaN, 1i, -1, 2, Inf]), 1), single ([NaN, 1i, -1, 2, Inf])) -%!assert (sort (single ([NaN, 1i, -1, 2, Inf]), 2), single ([1i, -1, 2, Inf, NaN])) -%!assert (sort (single ([NaN, 1i, -1, 2, Inf]), 3), single ([NaN, 1i, -1, 2, Inf])) -%!assert (sort (single ([NaN, 1i, -1, 2, Inf]), "ascend"), single ([1i, -1, 2, Inf, NaN])) -%!assert (sort (single ([NaN, 1i, -1, 2, Inf]), 2, "ascend"), single ([1i, -1, 2, Inf, NaN])) -%!assert (sort (single ([NaN, 1i, -1, 2, Inf]), "descend"), single ([NaN, Inf, 2, -1, 1i])) -%!assert (sort (single ([NaN, 1i, -1, 2, Inf]), 2, "descend"), single ([NaN, Inf, 2, -1, 1i])) -%!assert (sort (single ([3, 1i, 7, 5; 8, 2, 6, 4])), single ([3, 1i, 6, 4; 8, 2, 7, 5])) -%!assert (sort (single ([3, 1i, 7, 5; 8, 2, 6, 4]), 1), single ([3, 1i, 6, 4; 8, 2, 7, 5])) -%!assert (sort (single ([3, 1i, 7, 5; 8, 2, 6, 4]), 2), single ([1i, 3, 5, 7; 2, 4, 6, 8])) +%!assert (sort (single ([NaN, 1i, -1, 2, Inf]), 1), +%! single ([NaN, 1i, -1, 2, Inf])) +%!assert (sort (single ([NaN, 1i, -1, 2, Inf]), 2), +%! single ([1i, -1, 2, Inf, NaN])) +%!assert (sort (single ([NaN, 1i, -1, 2, Inf]), 3), +%! single ([NaN, 1i, -1, 2, Inf])) +%!assert (sort (single ([NaN, 1i, -1, 2, Inf]), "ascend"), +%! single ([1i, -1, 2, Inf, NaN])) +%!assert (sort (single ([NaN, 1i, -1, 2, Inf]), 2, "ascend"), +%! single ([1i, -1, 2, Inf, NaN])) +%!assert (sort (single ([NaN, 1i, -1, 2, Inf]), "descend"), +%! single ([NaN, Inf, 2, -1, 1i])) +%!assert (sort (single ([NaN, 1i, -1, 2, Inf]), 2, "descend"), +%! single ([NaN, Inf, 2, -1, 1i])) +%!assert (sort (single ([3, 1i, 7, 5; 8, 2, 6, 4])), +%! single ([3, 1i, 6, 4; 8, 2, 7, 5])) +%!assert (sort (single ([3, 1i, 7, 5; 8, 2, 6, 4]), 1), +%! single ([3, 1i, 6, 4; 8, 2, 7, 5])) +%!assert (sort (single ([3, 1i, 7, 5; 8, 2, 6, 4]), 2), +%! single ([1i, 3, 5, 7; 2, 4, 6, 8])) %!assert (sort (single (1i)), single (1i)) %!test @@ -7067,10 +7139,14 @@ %!assert (sort ([true, false, true, false], 1), [true, false, true, false]) %!assert (sort ([true, false, true, false], 2), [false, false, true, true]) %!assert (sort ([true, false, true, false], 3), [true, false, true, false]) -%!assert (sort ([true, false, true, false], "ascend"), [false, false, true, true]) -%!assert (sort ([true, false, true, false], 2, "ascend"), [false, false, true, true]) -%!assert (sort ([true, false, true, false], "descend"), [true, true, false, false]) -%!assert (sort ([true, false, true, false], 2, "descend"), [true, true, false, false]) +%!assert (sort ([true, false, true, false], "ascend"), +%! [false, false, true, true]) +%!assert (sort ([true, false, true, false], 2, "ascend"), +%! [false, false, true, true]) +%!assert (sort ([true, false, true, false], "descend"), +%! [true, true, false, false]) +%!assert (sort ([true, false, true, false], 2, "descend"), +%! [true, true, false, false]) %!assert (sort (true), true) %!test @@ -7079,14 +7155,22 @@ %! assert (i, [2, 4, 1, 3]); ## Sparse Double -%!assert (sort (sparse ([0, NaN, 1, 0, -1, 2, Inf])), sparse ([-1, 0, 0, 1, 2, Inf, NaN])) -%!assert (sort (sparse ([0, NaN, 1, 0, -1, 2, Inf]), 1), sparse ([0, NaN, 1, 0, -1, 2, Inf])) -%!assert (sort (sparse ([0, NaN, 1, 0, -1, 2, Inf]), 2), sparse ([-1, 0, 0, 1, 2, Inf, NaN])) -%!assert (sort (sparse ([0, NaN, 1, 0, -1, 2, Inf]), 3), sparse ([0, NaN, 1, 0, -1, 2, Inf])) -%!assert (sort (sparse ([0, NaN, 1, 0, -1, 2, Inf]), "ascend"), sparse ([-1, 0, 0, 1, 2, Inf, NaN])) -%!assert (sort (sparse ([0, NaN, 1, 0, -1, 2, Inf]), 2, "ascend"), sparse ([-1, 0, 0, 1, 2, Inf, NaN])) -%!assert (sort (sparse ([0, NaN, 1, 0, -1, 2, Inf]), "descend"), sparse ([NaN, Inf, 2, 1, 0, 0, -1])) -%!assert (sort (sparse ([0, NaN, 1, 0, -1, 2, Inf]), 2, "descend"), sparse ([NaN, Inf, 2, 1, 0, 0, -1])) +%!assert (sort (sparse ([0, NaN, 1, 0, -1, 2, Inf])), +%! sparse ([-1, 0, 0, 1, 2, Inf, NaN])) +%!assert (sort (sparse ([0, NaN, 1, 0, -1, 2, Inf]), 1), +%! sparse ([0, NaN, 1, 0, -1, 2, Inf])) +%!assert (sort (sparse ([0, NaN, 1, 0, -1, 2, Inf]), 2), +%! sparse ([-1, 0, 0, 1, 2, Inf, NaN])) +%!assert (sort (sparse ([0, NaN, 1, 0, -1, 2, Inf]), 3), +%! sparse ([0, NaN, 1, 0, -1, 2, Inf])) +%!assert (sort (sparse ([0, NaN, 1, 0, -1, 2, Inf]), "ascend"), +%! sparse ([-1, 0, 0, 1, 2, Inf, NaN])) +%!assert (sort (sparse ([0, NaN, 1, 0, -1, 2, Inf]), 2, "ascend"), +%! sparse ([-1, 0, 0, 1, 2, Inf, NaN])) +%!assert (sort (sparse ([0, NaN, 1, 0, -1, 2, Inf]), "descend"), +%! sparse ([NaN, Inf, 2, 1, 0, 0, -1])) +%!assert (sort (sparse ([0, NaN, 1, 0, -1, 2, Inf]), 2, "descend"), +%! sparse ([NaN, Inf, 2, 1, 0, 0, -1])) %!shared a %! a = randn (10, 10); @@ -7101,14 +7185,22 @@ %! assert (is, i); ## Sparse Complex -%!assert (sort (sparse ([0, NaN, 1i, 0, -1, 2, Inf])), sparse ([0, 0, 1i, -1, 2, Inf, NaN])) -%!assert (sort (sparse ([0, NaN, 1i, 0, -1, 2, Inf]), 1), sparse ([0, NaN, 1i, 0, -1, 2, Inf])) -%!assert (sort (sparse ([0, NaN, 1i, 0, -1, 2, Inf]), 2), sparse ([0, 0, 1i, -1, 2, Inf, NaN])) -%!assert (sort (sparse ([0, NaN, 1i, 0, -1, 2, Inf]), 3), sparse ([0, NaN, 1i, 0, -1, 2, Inf])) -%!assert (sort (sparse ([0, NaN, 1i, 0, -1, 2, Inf]), "ascend"), sparse ([0, 0, 1i, -1, 2, Inf, NaN])) -%!assert (sort (sparse ([0, NaN, 1i, 0, -1, 2, Inf]), 2, "ascend"), sparse ([0, 0, 1i, -1, 2, Inf, NaN])) -%!assert (sort (sparse ([0, NaN, 1i, 0, -1, 2, Inf]), "descend"), sparse ([NaN, Inf, 2, -1, 1i, 0, 0])) -%!assert (sort (sparse ([0, NaN, 1i, 0, -1, 2, Inf]), 2, "descend"), sparse ([NaN, Inf, 2, -1, 1i, 0, 0])) +%!assert (sort (sparse ([0, NaN, 1i, 0, -1, 2, Inf])), +%! sparse ([0, 0, 1i, -1, 2, Inf, NaN])) +%!assert (sort (sparse ([0, NaN, 1i, 0, -1, 2, Inf]), 1), +%! sparse ([0, NaN, 1i, 0, -1, 2, Inf])) +%!assert (sort (sparse ([0, NaN, 1i, 0, -1, 2, Inf]), 2), +%! sparse ([0, 0, 1i, -1, 2, Inf, NaN])) +%!assert (sort (sparse ([0, NaN, 1i, 0, -1, 2, Inf]), 3), +%! sparse ([0, NaN, 1i, 0, -1, 2, Inf])) +%!assert (sort (sparse ([0, NaN, 1i, 0, -1, 2, Inf]), "ascend"), +%! sparse ([0, 0, 1i, -1, 2, Inf, NaN])) +%!assert (sort (sparse ([0, NaN, 1i, 0, -1, 2, Inf]), 2, "ascend"), +%! sparse ([0, 0, 1i, -1, 2, Inf, NaN])) +%!assert (sort (sparse ([0, NaN, 1i, 0, -1, 2, Inf]), "descend"), +%! sparse ([NaN, Inf, 2, -1, 1i, 0, 0])) +%!assert (sort (sparse ([0, NaN, 1i, 0, -1, 2, Inf]), 2, "descend"), +%! sparse ([NaN, Inf, 2, -1, 1i, 0, 0])) %!shared a %! a = randn (10, 10); @@ -7124,14 +7216,22 @@ %! assert (is, i); ## Sparse Bool -%!assert (sort (sparse ([true, false, true, false])), sparse ([false, false, true, true])) -%!assert (sort (sparse ([true, false, true, false]), 1), sparse ([true, false, true, false])) -%!assert (sort (sparse ([true, false, true, false]), 2), sparse ([false, false, true, true])) -%!assert (sort (sparse ([true, false, true, false]), 3), sparse ([true, false, true, false])) -%!assert (sort (sparse ([true, false, true, false]), "ascend"), sparse ([false, false, true, true])) -%!assert (sort (sparse ([true, false, true, false]), 2, "ascend"), sparse ([false, false, true, true])) -%!assert (sort (sparse ([true, false, true, false]), "descend"), sparse ([true, true, false, false])) -%!assert (sort (sparse ([true, false, true, false]), 2, "descend"), sparse ([true, true, false, false])) +%!assert (sort (sparse ([true, false, true, false])), +%! sparse ([false, false, true, true])) +%!assert (sort (sparse ([true, false, true, false]), 1), +%! sparse ([true, false, true, false])) +%!assert (sort (sparse ([true, false, true, false]), 2), +%! sparse ([false, false, true, true])) +%!assert (sort (sparse ([true, false, true, false]), 3), +%! sparse ([true, false, true, false])) +%!assert (sort (sparse ([true, false, true, false]), "ascend"), +%! sparse ([false, false, true, true])) +%!assert (sort (sparse ([true, false, true, false]), 2, "ascend"), +%! sparse ([false, false, true, true])) +%!assert (sort (sparse ([true, false, true, false]), "descend"), +%! sparse ([true, true, false, false])) +%!assert (sort (sparse ([true, false, true, false]), 2, "descend"), +%! sparse ([true, true, false, false])) %!test %! [v, i] = sort (sparse ([true, false, true, false])); @@ -7231,17 +7331,17 @@ DEFUN (issorted, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} issorted (@var{a}) -@deftypefnx {} {} issorted (@var{a}, @var{mode}) -@deftypefnx {} {} issorted (@var{a}, "rows", @var{mode}) -Return true if the array is sorted according to @var{mode}, which may be either -@qcode{"ascend"}, @qcode{"descend"}, or @qcode{"either"}. +@deftypefn {} {@var{tf} =} issorted (@var{a}) +@deftypefnx {} {@var{tf} =} issorted (@var{a}, @var{mode}) +@deftypefnx {} {@var{tf} =} issorted (@var{a}, "rows", @var{mode}) +Return true if the vector @var{a} is sorted according to @var{mode}, which +may be either @qcode{"ascend"}, @qcode{"descend"}, or @qcode{"either"}. By default, @var{mode} is @qcode{"ascend"}. NaNs are treated in the same manner as @code{sort}. -If the optional argument @qcode{"rows"} is supplied, check whether the array is -sorted by rows as output by the function @code{sortrows} (with no options). +If the optional argument @qcode{"rows"} is supplied, check whether the matrix +is sorted by rows as output by the function @code{sortrows} (with no options). This function does not support sparse matrices. @seealso{sort, sortrows} @@ -7954,7 +8054,7 @@ idx_vector col1 (':'), col2 (':'), sl1 (1, k), sl2 (0, k-1); retval = SparseT (retval.index (col1, sl1)) - SparseT (retval.index (col2, sl2)); - assert (retval.columns () == k-1); + error_unless (retval.columns () == k-1); order--; k--; } @@ -7967,7 +8067,7 @@ idx_vector col1 (':'), col2 (':'), sl1 (1, k), sl2 (0, k-1); retval = SparseT (retval.index (sl1, col1)) - SparseT (retval.index (sl2, col2)); - assert (retval.rows () == k-1); + error_unless (retval.rows () == k-1); order--; k--; } @@ -8147,7 +8247,8 @@ { Array retval; - assert (rep.ndims () == 2 && rep.rows () == 2); + if (rep.ndims () != 2 || rep.rows () != 2) + error ("repelems: R must be a 2-row, N-column matrix of integers"); octave_idx_type n = rep.columns (); octave_idx_type l = 0; diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/debug.cc --- a/libinterp/corefcn/debug.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/debug.cc Thu Mar 03 13:37:10 2022 -0500 @@ -529,12 +529,12 @@ %!test %! if (isguirunning ()) %! orig_show_dbg = __event_manager_gui_preference__ ("editor/show_dbg_file", -%! "0"); +%! "0"); %! endif %! unwind_protect %! dbclear all; # Clear out breakpoints before test %! dbstop @ftp/dir; -%! dbstop @audioplayer/set 70; +%! dbstop @audioplayer/set 75; %! dbstop quantile>__quantile__; %! dbstop ls; %! s = dbstatus; @@ -1171,7 +1171,7 @@ DEFMETHOD (isdebugmode, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} isdebugmode () +@deftypefn {} {@var{tf} =} isdebugmode () Return true if in debugging mode, otherwise false. @seealso{dbwhere, dbstack, dbstatus} @end deftypefn */) diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/dirfns.cc --- a/libinterp/corefcn/dirfns.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/dirfns.cc Thu Mar 03 13:37:10 2022 -0500 @@ -713,7 +713,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} confirm_recursive_rmdir () @deftypefnx {} {@var{old_val} =} confirm_recursive_rmdir (@var{new_val}) -@deftypefnx {} {} confirm_recursive_rmdir (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} confirm_recursive_rmdir (@var{new_val}, "local") Query or set the internal variable that controls whether Octave will ask for confirmation before recursively removing a directory tree. diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/dot.cc --- a/libinterp/corefcn/dot.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/dot.cc Thu Mar 03 13:37:10 2022 -0500 @@ -37,12 +37,14 @@ OCTAVE_NAMESPACE_BEGIN +// FIXME: input 'y' is no longer necessary (2/5/2022). +// At some point it would be better to change all occurrences of +// get_red_dims to eliminate this input parameter. static void -get_red_dims (const dim_vector& x, const dim_vector& y, int dim, +get_red_dims (const dim_vector& x, const dim_vector& /* y */, int dim, dim_vector& z, F77_INT& m, F77_INT& n, F77_INT& k) { int nd = x.ndims (); - assert (nd == y.ndims ()); z = dim_vector::alloc (nd); octave_idx_type tmp_m = 1; octave_idx_type tmp_n = 1; diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/environment.cc --- a/libinterp/corefcn/environment.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/environment.cc Thu Mar 03 13:37:10 2022 -0500 @@ -157,7 +157,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} EDITOR () @deftypefnx {} {@var{old_val} =} EDITOR (@var{new_val}) -@deftypefnx {} {} EDITOR (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} EDITOR (@var{new_val}, "local") Query or set the internal variable that specifies the default text editor. The default value is taken from the environment variable @w{@env{EDITOR}} @@ -192,7 +192,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} EXEC_PATH () @deftypefnx {} {@var{old_val} =} EXEC_PATH (@var{new_val}) -@deftypefnx {} {} EXEC_PATH (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} EXEC_PATH (@var{new_val}, "local") Query or set the internal variable that specifies a colon separated list of directories to append to the shell PATH when executing external programs. @@ -229,7 +229,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} IMAGE_PATH () @deftypefnx {} {@var{old_val} =} IMAGE_PATH (@var{new_val}) -@deftypefnx {} {} IMAGE_PATH (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} IMAGE_PATH (@var{new_val}, "local") Query or set the internal variable that specifies a colon separated list of directories in which to search for image files. diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/error.cc --- a/libinterp/corefcn/error.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/error.cc Thu Mar 03 13:37:10 2022 -0500 @@ -657,7 +657,7 @@ octave_idx_type nel = ident.numel (); - assert (nel != 0); + panic_if (nel == 0); bool found = false; @@ -689,8 +689,7 @@ // The warning state "all" is always supposed to remain in the list, // so we should always find a state, either explicitly or by using the // state for "all". - - assert (found); + panic_unless (found); retval.assign ("identifier", id); retval.assign ("state", val); @@ -2116,7 +2115,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} beep_on_error () @deftypefnx {} {@var{old_val} =} beep_on_error (@var{new_val}) -@deftypefnx {} {} beep_on_error (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} beep_on_error (@var{new_val}, "local") Query or set the internal variable that controls whether Octave will try to ring the terminal bell before printing an error message. @@ -2134,7 +2133,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} debug_on_error () @deftypefnx {} {@var{old_val} =} debug_on_error (@var{new_val}) -@deftypefnx {} {} debug_on_error (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} debug_on_error (@var{new_val}, "local") Query or set the internal variable that controls whether Octave will try to enter the debugger when an error is encountered. @@ -2156,7 +2155,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} debug_on_warning () @deftypefnx {} {@var{old_val} =} debug_on_warning (@var{new_val}) -@deftypefnx {} {} debug_on_warning (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} debug_on_warning (@var{new_val}, "local") Query or set the internal variable that controls whether Octave will try to enter the debugger when a warning is encountered. @@ -2180,8 +2179,3 @@ } OCTAVE_NAMESPACE_END - -// Deprecated variables and functions. - -// This variable is obsolete and always has the value 0. -int error_state = 0; diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/error.h --- a/libinterp/corefcn/error.h Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/error.h Thu Mar 03 13:37:10 2022 -0500 @@ -174,7 +174,8 @@ octave_map warning_options (void) const { return m_warning_options; } - void set_warning_options (const octave_map& val) { m_warning_options = val; } + void set_warning_options (const octave_map& val) + { m_warning_options = val; } octave_map warning_options (const octave_map& new_val) { @@ -187,9 +188,7 @@ last_error_message (const octave_value_list& args, int nargout); void set_last_error_message (const std::string& val) - { - m_last_error_message = val; - } + { m_last_error_message = val; } std::string last_error_message (void) const { return m_last_error_message; } @@ -203,9 +202,11 @@ OCTINTERP_API octave_value last_warning_message (const octave_value_list& args, int nargout); - void set_last_warning_message (const std::string& val) { m_last_warning_message = val; } + void set_last_warning_message (const std::string& val) + { m_last_warning_message = val; } - std::string last_warning_message (void) const { return m_last_warning_message; } + std::string last_warning_message (void) const + { return m_last_warning_message; } std::string last_warning_message (const std::string& s) { @@ -217,7 +218,8 @@ OCTINTERP_API octave_value last_warning_id (const octave_value_list& args, int nargout); - void set_last_warning_id (const std::string& val) { m_last_warning_id = val; } + void set_last_warning_id (const std::string& val) + { m_last_warning_id = val; } std::string last_warning_id (void) const { return m_last_warning_id; } @@ -408,9 +410,6 @@ // not deprecated and eventually removed, does it make sense to also // define them inside the octave namespace? -#define panic_impossible() \ - panic ("impossible state reached in file '%s' at line %d", __FILE__, __LINE__) - extern OCTINTERP_API void vmessage (const char *name, const char *fmt, va_list args); @@ -506,6 +505,52 @@ OCTAVE_NORETURN extern OCTINTERP_API void panic (const char *fmt, ...); +#define panic_impossible() \ + panic ("impossible state reached in file '%s' at line %d", __FILE__, __LINE__) + +inline void +panic_if (bool cond) +{ +#ifndef NDEBUG + if (cond) + panic_impossible (); + else + return; + +#else + octave_unused_parameter (cond); +#endif +} + +inline void +panic_unless (bool cond) +{ + panic_if (! cond); +} + +#define error_impossible() \ + error ("impossible state reached in file '%s' at line %d", __FILE__, __LINE__) + +inline void +error_if (bool cond) +{ +#ifndef NDEBUG + if (cond) + error_impossible (); + else + return; + +#else + octave_unused_parameter (cond); +#endif +} + +inline void +error_unless (bool cond) +{ + error_if (! cond); +} + OCTAVE_NAMESPACE_BEGIN //! Helper function for print_usage defined in defun.cc. @@ -566,14 +611,6 @@ octave::interpreter_try (uwp); } -OCTAVE_DEPRECATED (6, "this function is obsolete and should not be needed") -inline void reset_error_handler (void) { } #endif -// This symbol must have be declared with the correct visibility -// attributes when Octave is built, so it must appear unconditionally in -// this header file. -OCTAVE_DEPRECATED (6, "this variable is obsolete and always has the value 0") -extern OCTINTERP_API int error_state; - #endif diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/errwarn.h --- a/libinterp/corefcn/errwarn.h Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/errwarn.h Thu Mar 03 13:37:10 2022 -0500 @@ -188,11 +188,4 @@ extern OCTINTERP_API void warn_wrong_type_arg (const char *name, const octave_value& tc); -#if defined (OCTAVE_PROVIDE_DEPRECATED_SYMBOLS) -OCTAVE_DEPRECATED (6, "this function will be removed in a future version of Octave") -inline void -warn_divide_by_zero (void) -{ } #endif - -#endif diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/event-manager.h --- a/libinterp/corefcn/event-manager.h Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/event-manager.h Thu Mar 03 13:37:10 2022 -0500 @@ -623,7 +623,8 @@ return false; } - bool gui_status_update (const std::string& feature, const std::string& status) + bool gui_status_update (const std::string& feature, + const std::string& status) { if (enabled ()) { diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/file-io.cc --- a/libinterp/corefcn/file-io.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/file-io.cc Thu Mar 03 13:37:10 2022 -0500 @@ -67,7 +67,6 @@ #include "defun.h" #include "error.h" #include "errwarn.h" -#include "file-io.h" #include "interpreter-private.h" #include "interpreter.h" #include "load-path.h" @@ -2329,6 +2328,8 @@ %! C = textscan ('5973459727478852968', '%u64'); %! assert (C{1}, uint64 (5973459727478852968)); +%!assert <*60711> (textscan('1,.,2', '%f', 'Delimiter', ','), {1}); + */ // These tests have end-comment sequences, so can't just be in a comment @@ -3253,24 +3254,4 @@ return const_value ("stderr", args, streams.stderr_file ()); } -// Deprecated variables and functions. - -// Remove when corresponding global deprecated function is removed. -void mark_for_deletion_deprecated (const std::string& file) -{ - octave::interpreter& interp - = octave::__get_interpreter__ ("mark_for_deletion"); - - interp.mark_for_deletion (file); -} - -// Remove when corresponding global deprecated function is removed. -void cleanup_tmp_files_deprecated (void) -{ - octave::interpreter& interp - = octave::__get_interpreter__ ("cleanup_tmp_files"); - - interp.cleanup_tmp_files (); -} - OCTAVE_NAMESPACE_END diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/file-io.h --- a/libinterp/corefcn/file-io.h Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/file-io.h Thu Mar 03 13:37:10 2022 -0500 @@ -23,43 +23,9 @@ // //////////////////////////////////////////////////////////////////////// -// Written by John C. Campbell - #if ! defined (octave_file_io_h) #define octave_file_io_h 1 -#include "octave-config.h" - -#include - -OCTAVE_NAMESPACE_BEGIN - -// Use this function internally until the function that uses it is -// removed. Remove when corresponding global deprecated function is -// removed. -extern void mark_for_deletion_deprecated (const std::string&); - -// Use this function internally until the function that uses it is -// removed. Remove when corresponding global deprecated function is -// removed. -extern void cleanup_tmp_files_deprecated (void); - -OCTAVE_NAMESPACE_END - -#if defined (OCTAVE_PROVIDE_DEPRECATED_SYMBOLS) - -OCTAVE_DEPRECATED (6, "use 'interpreter::mark_for_deletion' instead") -inline void mark_for_deletion (const std::string& fname) -{ - octave::mark_for_deletion_deprecated (fname); -} - -OCTAVE_DEPRECATED (6, "use 'interpreter::cleanup_tmp_files' instead") -inline void cleanup_tmp_files (void) -{ - octave::cleanup_tmp_files_deprecated (); -} +#warning "file-io.h was deprecated in Octave 8 and will be removed in a future version." #endif - -#endif diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/filter.cc --- a/libinterp/corefcn/filter.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/filter.cc Thu Mar 03 13:37:10 2022 -0500 @@ -106,6 +106,8 @@ if (a_len <= 1 && si_len <= 0) return b(0) * x; + // Here onwards, either a_len > 1 or si_len >= 1 or both. + y.resize (x_dims, 0.0); octave_idx_type x_stride = 1; @@ -113,29 +115,69 @@ x_stride *= x_dims(i); octave_idx_type x_num = x_dims.numel () / x_len; + // For deconv and fftfilt, x_num seems to always be 1. + // For directly calling filter, it can be more than 1. + for (octave_idx_type num = 0; num < x_num; num++) { - octave_idx_type x_offset; - if (x_stride == 1) - x_offset = num * x_len; - else - { - x_offset = num; - octave_idx_type n_strides = num / x_stride; - x_offset += n_strides * x_stride * (x_len - 1); - } + octave_idx_type x_offset = (x_stride == 1) ? num * x_len + : num + (num / x_stride) * x_stride * (x_len - 1); + octave_idx_type si_offset = num * si_len; + // Try to achieve a balance between speed and interruptibility. + // + // One extreme is to not check for interruptions at all, which gives + // good speed but the user cannot use Ctrl-C for the whole duration. + // The other end is to check frequently from inside an inner loop, + // which slows down performance by 5X or 6X. + // + // Putting any sort of check in an inner loop seems to prevent the + // compiler from optimizing the loop, so we cannot say "check for + // interruptions every M iterations" using an if-statement. + // + // This is a compromise approach to split the total numer of loop + // executions into num_outer and num_inner, to provide periodic checks + // for interruptions without writing a conditional inside a tight loop. + // + // To make it more interruptible and run more slowly, reduce num_inner. + // To speed it up but make it less interruptible, increase it. + // May need to increase it slowly over time as computers get faster. + // The aim is to not lose Ctrl-C ability for longer than about 2 seconds. + // + // In December 2021, num_inner = 100000 is acceptable. + + octave_idx_type num_execs = si_len-1; // 0 to num_execs-1 + octave_idx_type num_inner = 100000; + octave_idx_type num_outer = num_execs / num_inner; + + // The following if-else block depends on a_len and si_len, + // both of which are loop invariants in this 0 <= num < x_num loop. + // But x_num is so small in practice that using the if-else inside + // the loop has more benefits than duplicating the outer for-loop, + // even though the checks are on loop invariants. + + // We cannot have a_len <= 1 AND si_len <= 0 because that case already + // returned above. This means exactly one of the following blocks + // inside the if-conditional will be obeyed: it is not possible for the + // if-block and the else-block to *both* skip. Therefore any code that + // is common to both branches can be pulled out here without affecting + // correctness or speed. + + T *py = y.fortran_vec (); + T *psi = si.fortran_vec (); + const T *pb = b.data (); + const T *px = x.data (); + psi += si_offset; + if (a_len > 1) { - T *py = y.fortran_vec (); - T *psi = si.fortran_vec (); + const T *pa = a.data (); - const T *pa = a.data (); - const T *pb = b.data (); - const T *px = x.data (); - - psi += si_offset; + // Usually the last element to be written will be si_len-1 + // but if si_len is 0, then we need the 0th element to be written. + // Pulling this check out of the for-loop makes it run faster. + octave_idx_type iidx = (si_len > 0) ? si_len-1 : 0; for (octave_idx_type i = 0, idx = x_offset; i < x_len; @@ -143,34 +185,27 @@ { py[idx] = psi[0] + pb[0] * px[idx]; - if (si_len > 0) + // Outer and inner loops for interruption management + for (octave_idx_type u = 0; u <= num_outer; u++) { - for (octave_idx_type j = 0; j < si_len - 1; j++) - { - octave_quit (); - - psi[j] = psi[j+1] - pa[j+1] * py[idx] + pb[j+1] * px[idx]; - } + octave_idx_type lo = u * num_inner; + octave_idx_type hi = (lo + num_inner < num_execs-1) + ? lo + num_inner : num_execs-1; - psi[si_len-1] = pb[si_len] * px[idx] - pa[si_len] * py[idx]; + // Inner loop, no interruption + for (octave_idx_type j = lo; j <= hi; j++) + psi[j] = psi[j+1] - pa[j+1] * py[idx] + pb[j+1] * px[idx]; + + octave_quit(); // Check for interruptions } - else - { - octave_quit (); - psi[0] = pb[si_len] * px[idx] - pa[si_len] * py[idx]; - } + psi[iidx] = pb[si_len] * px[idx] - pa[si_len] * py[idx]; } } - else if (si_len > 0) + else // a_len <= 1 ==> si_len MUST be > 0 { - T *py = y.fortran_vec (); - T *psi = si.fortran_vec (); - - const T *pb = b.data (); - const T *px = x.data (); - - psi += si_offset; + // This else-block is almost the same as the above if-block, + // except for the absence of variable pa. for (octave_idx_type i = 0, idx = x_offset; i < x_len; @@ -178,23 +213,21 @@ { py[idx] = psi[0] + pb[0] * px[idx]; - if (si_len > 1) + // Outer and inner loops for interruption management + for (octave_idx_type u = 0; u <= num_outer; u++) { - for (octave_idx_type j = 0; j < si_len - 1; j++) - { - octave_quit (); - - psi[j] = psi[j+1] + pb[j+1] * px[idx]; - } + octave_idx_type lo = u * num_inner; + octave_idx_type hi = (lo + num_inner < num_execs-1) + ? lo + num_inner : num_execs-1; - psi[si_len-1] = pb[si_len] * px[idx]; + // Inner loop, no interruption + for (octave_idx_type j = lo; j <= hi; j++) + psi[j] = psi[j+1] + pb[j+1] * px[idx]; + + octave_quit(); // Check for interruptions } - else - { - octave_quit (); - psi[0] = pb[1] * px[idx]; - } + psi[si_len-1] = pb[si_len] * px[idx]; } } } @@ -596,14 +629,16 @@ %!assert (filter (1, ones (10,1) / 10, []), []) %!assert (filter (1, ones (10,1) / 10, zeros (0,10)), zeros (0,10)) -%!assert (filter (1, ones (10,1) / 10, single (1:5)), repmat (single (10), 1, 5)) +%!assert (filter (1, ones (10,1) / 10, single (1:5)), +%! repmat (single (10), 1, 5)) ## Test using initial conditions %!assert (filter ([1, 1, 1], [1, 1], [1 2], [1, 1]), [2 2]) %!assert (filter ([1, 1, 1], [1, 1], [1 2], [1, 1]'), [2 2]) %!assert (filter ([1, 3], [1], [1 2; 3 4; 5 6], [4, 5]), [5 7; 6 10; 14 18]) %!error filter ([1, 3], [1], [1 2; 3 4; 5 6], [4, 5]') -%!assert (filter ([1, 3, 2], [1], [1 2; 3 4; 5 6], [1 0 0; 1 0 0], 2), [2 6; 3 13; 5 21]) +%!assert (filter ([1, 3, 2], [1], [1 2; 3 4; 5 6], [1 0 0; 1 0 0], 2), +%! [2 6; 3 13; 5 21]) ## Test of DIM parameter %!test diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/find.cc --- a/libinterp/corefcn/find.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/find.cc Thu Mar 03 13:37:10 2022 -0500 @@ -54,7 +54,8 @@ idx = nda.find (); // The maximum element is always at the end. - octave_idx_type iext = (idx.isempty () ? 0 : idx.xelem (idx.numel () - 1) + 1); + octave_idx_type iext = (idx.isempty () ? 0 + : idx.xelem (idx.numel () - 1) + 1); switch (nargout) { diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/gcd.cc --- a/libinterp/corefcn/gcd.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/gcd.cc Thu Mar 03 13:37:10 2022 -0500 @@ -514,7 +514,8 @@ /* %!assert (gcd (200, 300, 50, 35), 5) %!assert (gcd (int16 (200), int16 (300), int16 (50), int16 (35)), int16 (5)) -%!assert (gcd (uint64 (200), uint64 (300), uint64 (50), uint64 (35)), uint64 (5)) +%!assert (gcd (uint64 (200), uint64 (300), uint64 (50), uint64 (35)), +%! uint64 (5)) %!assert (gcd (18-i, -29+3i), -3-4i) %!test diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/gl-render.h --- a/libinterp/corefcn/gl-render.h Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/gl-render.h Thu Mar 03 13:37:10 2022 -0500 @@ -146,7 +146,8 @@ double p1, double p1N, double p2, double p2N, int xyz, bool is_3D); - virtual void render_tickmarks (const Matrix& ticks, double lim1, double lim2, + virtual void render_tickmarks (const Matrix& ticks, + double lim1, double lim2, double p1, double p1N, double p2, double p2N, double dx, double dy, double dz, int xyz, bool doubleside); diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/gl2ps-print.cc --- a/libinterp/corefcn/gl2ps-print.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/gl2ps-print.cc Thu Mar 03 13:37:10 2022 -0500 @@ -1325,16 +1325,20 @@ std::swap (vp_lim_min(1), vp_lim_max(1)); float clip_xmin - = do_clip ? (vp_lim_min(0) > m_xmin ? vp_lim_min(0) : m_xmin) : vp_lim_min(0); + = do_clip ? (vp_lim_min(0) > m_xmin ? vp_lim_min(0) : m_xmin) + : vp_lim_min(0); float clip_ymin - = do_clip ? (vp_lim_min(1) > m_ymin ? vp_lim_min(1) : m_ymin) : vp_lim_min(1); + = do_clip ? (vp_lim_min(1) > m_ymin ? vp_lim_min(1) : m_ymin) + : vp_lim_min(1); float clip_xmax - = do_clip ? (vp_lim_max(0) < m_xmax ? vp_lim_max(0) : m_xmax) : vp_lim_max(0); + = do_clip ? (vp_lim_max(0) < m_xmax ? vp_lim_max(0) : m_xmax) + : vp_lim_max(0); float clip_ymax - = do_clip ? (vp_lim_max(1) < m_ymax ? vp_lim_max(1) : m_ymax) : vp_lim_max(1); + = do_clip ? (vp_lim_max(1) < m_ymax ? vp_lim_max(1) : m_ymax) + : vp_lim_max(1); if (im_xmin < clip_xmin) j0 += (clip_xmin - im_xmin)/nor_dx + 1; diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/graphics-toolkit.h --- a/libinterp/corefcn/graphics-toolkit.h Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/graphics-toolkit.h Thu Mar 03 13:37:10 2022 -0500 @@ -284,12 +284,4 @@ }; } -#if defined (OCTAVE_PROVIDE_DEPRECATED_SYMBOLS) -OCTAVE_DEPRECATED (6, "use 'octave::graphics_toolkit' instead") -typedef octave::graphics_toolkit graphics_toolkit; - -OCTAVE_DEPRECATED (6, "use 'octave::base_graphics_toolkit' instead") -typedef octave::base_graphics_toolkit base_graphics_toolkit; #endif - -#endif diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/graphics.cc --- a/libinterp/corefcn/graphics.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/graphics.cc Thu Mar 03 13:37:10 2022 -0500 @@ -4138,7 +4138,8 @@ %! set (0, "units", "pixels"); %! assert (get (0, "screensize"), sz + [1, 1, 0, 0]); %! set (0, "units", "characters"); -%! assert (get (0, "screensize"), sz / dpi * (74.951 / 12.0), 0.5 / dpi * (74.951 / 12.0)); +%! assert (get (0, "screensize"), +%! sz / dpi * (74.951 / 12.0), 0.5 / dpi * (74.951 / 12.0)); %! unwind_protect_cleanup %! set (0, "units", old_units); %! end_unwind_protect @@ -5190,7 +5191,8 @@ yaxislocation_is ("origin"), m_xscale.is ("log") ? 2 : (xaxislocation_is ("origin") ? 0 : (xaxislocation_is ("bottom") ? -1 : 1)), m_ylim); - calc_ticklabels (m_ztick, m_zticklabel, m_zscale.is ("log"), false, 2, m_zlim); + calc_ticklabels (m_ztick, m_zticklabel, m_zscale.is ("log"), + false, 2, m_zlim); xset (m_xlabel.handle_value (), "handlevisibility", "off"); xset (m_ylabel.handle_value (), "handlevisibility", "off"); @@ -5502,11 +5504,11 @@ // FIXME: Should this have all properties in it? // Including ones we do don't implement? - // FIXME: This function is probably never called without mode == "reset" - // Check that this is the case with an assert statement (1/6/2017). + // FIXME: This function is probably never called without mode == "reset". + // Verify this is the case with error_unless() (1/6/2017). // If there are reports of problems then figure out what code is // calling it with the mode set to something else. - assert (mode == "reset"); + error_unless (mode == "reset"); Matrix tlim (1, 2, 0.0); tlim(1) = 1; @@ -6486,7 +6488,8 @@ if (xlabel_props.horizontalalignmentmode_is ("auto")) { xlabel_props.set_horizontalalignment - (m_xstate > AXE_DEPTH_DIR ? "center" : (m_xyzSym ? "left" : "right")); + (m_xstate > AXE_DEPTH_DIR ? "center" + : (m_xyzSym ? "left" : "right")); xlabel_props.set_horizontalalignmentmode ("auto"); } @@ -6590,7 +6593,8 @@ if (ylabel_props.horizontalalignmentmode_is ("auto")) { ylabel_props.set_horizontalalignment - (m_ystate > AXE_DEPTH_DIR ? "center" : (! m_xyzSym ? "left" : "right")); + (m_ystate > AXE_DEPTH_DIR ? "center" + : (! m_xyzSym ? "left" : "right")); ylabel_props.set_horizontalalignmentmode ("auto"); } @@ -7782,7 +7786,8 @@ Matrix axes::properties::get_axis_limits (double xmin, double xmax, double min_pos, double max_neg, - const bool logscale) + const bool logscale, + const std::string& method) { Matrix retval; @@ -7834,17 +7839,38 @@ max_val *= 0.9; } } - if (min_val > 0) - { - // Log plots with all positive data - min_val = std::pow (10, std::floor (log10 (min_val))); - max_val = std::pow (10, std::ceil (log10 (max_val))); - } - else - { - // Log plots with all negative data - min_val = -std::pow (10, std::ceil (log10 (-min_val))); - max_val = -std::pow (10, std::floor (log10 (-max_val))); + + if (method == "tickaligned") + { + if (min_val > 0) + { + // Log plots with all positive data + min_val = std::pow (10, std::floor (log10 (min_val))); + max_val = std::pow (10, std::ceil (log10 (max_val))); + } + else + { + // Log plots with all negative data + min_val = -std::pow (10, std::ceil (log10 (-min_val))); + max_val = -std::pow (10, std::floor (log10 (-max_val))); + } + } + else if (method == "padded") + { + if (min_val > 0) + { + // Log plots with all positive data + double pad = (log10 (max_val) - log10 (min_val)) * 0.07; + min_val = std::pow (10, log10 (min_val) - pad); + max_val = std::pow (10, log10 (max_val) + pad); + } + else + { + // Log plots with all negative data + double pad = (log10 (-min_val) - log10 (-max_val)) * 0.07; + min_val = -std::pow (10, log10 (-min_val) + pad); + max_val = -std::pow (10, log10 (-max_val) - pad); + } } } else @@ -7862,12 +7888,21 @@ max_val += 0.1 * std::abs (max_val); } - double tick_sep = calc_tick_sep (min_val, max_val); - double min_tick = std::floor (min_val / tick_sep); - double max_tick = std::ceil (max_val / tick_sep); - // Prevent round-off from cropping ticks - min_val = std::min (min_val, tick_sep * min_tick); - max_val = std::max (max_val, tick_sep * max_tick); + if (method == "tickaligned") + { + double tick_sep = calc_tick_sep (min_val, max_val); + double min_tick = std::floor (min_val / tick_sep); + double max_tick = std::ceil (max_val / tick_sep); + // Prevent round-off from cropping ticks + min_val = std::min (min_val, tick_sep * min_tick); + max_val = std::max (max_val, tick_sep * max_tick); + } + else if (method == "padded") + { + double pad = 0.07 * (max_val - min_val); + min_val -= pad; + max_val += pad; + } } } @@ -8082,13 +8117,16 @@ array_property& mticks, bool limmode_is_auto, bool tickmode_is_auto, - bool is_logscale) + bool is_logscale, + bool method_is_padded, + bool method_is_tight) { if (lims.get ().isempty ()) return; double lo = (lims.get ().matrix_value ())(0); double hi = (lims.get ().matrix_value ())(1); + double lo_lim = lo; double hi_lim = hi; bool is_negative = lo < 0 && hi < 0; @@ -8132,17 +8170,28 @@ if (limmode_is_auto) { - // Adjust limits to include min and max ticks Matrix tmp_lims (1, 2); - tmp_lims(0) = std::min (tick_sep * i1, lo); - tmp_lims(1) = std::max (tick_sep * i2, hi); + + if (! method_is_padded && ! method_is_tight) + { + // Adjust limits to include min and max ticks + tmp_lims(0) = std::min (tick_sep * i1, lo); + tmp_lims(1) = std::max (tick_sep * i2, hi); + } + else + { + tmp_lims(0) = lo; + tmp_lims(1) = hi; + } if (is_logscale) { tmp_lims(0) = std::pow (10., tmp_lims(0)); tmp_lims(1) = std::pow (10., tmp_lims(1)); + if (tmp_lims(0) <= 0) tmp_lims(0) = std::pow (10., lo); + if (is_negative) { double tmp = tmp_lims(0); @@ -8150,6 +8199,7 @@ tmp_lims(1) = -tmp; } } + lims = tmp_lims; } else @@ -8518,9 +8568,11 @@ { get_children_limits (min_val, max_val, min_pos, max_neg, kids, 'x'); + std::string method = m_properties.get_xlimitmethod (); limits = m_properties.get_axis_limits (min_val, max_val, min_pos, max_neg, - m_properties.xscale_is ("log")); + m_properties.xscale_is ("log"), + method); } else m_properties.check_axis_limits (limits, kids, @@ -8539,9 +8591,11 @@ { get_children_limits (min_val, max_val, min_pos, max_neg, kids, 'y'); + std::string method = m_properties.get_ylimitmethod (); limits = m_properties.get_axis_limits (min_val, max_val, min_pos, max_neg, - m_properties.yscale_is ("log")); + m_properties.yscale_is ("log"), + method); } else m_properties.check_axis_limits (limits, kids, @@ -8563,9 +8617,11 @@ m_properties.set_has3Dkids ((max_val - min_val) > std::numeric_limits::epsilon ()); + std::string method = m_properties.get_zlimitmethod (); limits = m_properties.get_axis_limits (min_val, max_val, min_pos, max_neg, - m_properties.zscale_is ("log")); + m_properties.zscale_is ("log"), + method); } else { @@ -8718,9 +8774,11 @@ { get_children_limits (min_val, max_val, min_pos, max_neg, kids, 'x'); + std::string method = m_properties.get_xlimitmethod (); limits = m_properties.get_axis_limits (min_val, max_val, min_pos, max_neg, - m_properties.xscale_is ("log")); + m_properties.xscale_is ("log"), + method); } else { @@ -8741,9 +8799,11 @@ { get_children_limits (min_val, max_val, min_pos, max_neg, kids, 'y'); + std::string method = m_properties.get_ylimitmethod (); limits = m_properties.get_axis_limits (min_val, max_val, min_pos, max_neg, - m_properties.yscale_is ("log")); + m_properties.yscale_is ("log"), + method); } else { @@ -8773,9 +8833,11 @@ && ! m_properties.zscale_is ("log")) min_val = max_val = 0.; + std::string method = m_properties.get_zlimitmethod (); limits = m_properties.get_axis_limits (min_val, max_val, min_pos, max_neg, - m_properties.zscale_is ("log")); + m_properties.zscale_is ("log"), + method); } else { @@ -10324,8 +10386,8 @@ if (! cd.isempty () && (c_rows != 1 || c_cols != 3) && (c_rows != x_rows || (c_cols != 1 && c_cols != 3))) { - m_bad_data_msg = "cdata must be an rgb triplet or have the same number of " - "rows as X and one or three columns"; + m_bad_data_msg = "cdata must be an rgb triplet or have the same number " + "of rows as X and one or three columns"; return; } @@ -12646,7 +12708,7 @@ DEFMETHOD (ishghandle, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} ishghandle (@var{h}) +@deftypefn {} {@var{tf} =} ishghandle (@var{h}) Return true if @var{h} is a graphics handle and false otherwise. @var{h} may also be a matrix of handles in which case a logical array is diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/graphics.in.h --- a/libinterp/corefcn/graphics.in.h Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/graphics.in.h Thu Mar 03 13:37:10 2022 -0500 @@ -950,7 +950,8 @@ const std::string& current_value (void) const { return m_current_val; } - std::string values_as_string (void) const { return m_vals.values_as_string (); } + std::string values_as_string (void) const + { return m_vals.values_as_string (); } Cell values_as_cell (void) const { return m_vals.values_as_cell (); } @@ -1378,7 +1379,8 @@ array_property (void) : base_property ("", graphics_handle ()), m_data (Matrix ()), m_min_val (), m_max_val (), m_min_pos (), m_max_neg (), - m_type_constraints (), m_size_constraints (), m_finite_constraint (NO_CHECK), + m_type_constraints (), m_size_constraints (), + m_finite_constraint (NO_CHECK), m_minval (std::pair (octave_NaN, true)), m_maxval (std::pair (octave_NaN, true)) { @@ -1389,7 +1391,8 @@ const octave_value& m) : base_property (nm, h), m_data (m.issparse () ? m.full_value () : m), m_min_val (), m_max_val (), m_min_pos (), m_max_neg (), - m_type_constraints (), m_size_constraints (), m_finite_constraint (NO_CHECK), + m_type_constraints (), m_size_constraints (), + m_finite_constraint (NO_CHECK), m_minval (std::pair (octave_NaN, true)), m_maxval (std::pair (octave_NaN, true)) { @@ -1401,8 +1404,10 @@ // copy constraints. array_property (const array_property& p) : base_property (p), m_data (p.m_data), - m_min_val (p.m_min_val), m_max_val (p.m_max_val), m_min_pos (p.m_min_pos), m_max_neg (p.m_max_neg), - m_type_constraints (), m_size_constraints (), m_finite_constraint (NO_CHECK), + m_min_val (p.m_min_val), m_max_val (p.m_max_val), + m_min_pos (p.m_min_pos), m_max_neg (p.m_max_neg), + m_type_constraints (), m_size_constraints (), + m_finite_constraint (NO_CHECK), m_minval (std::pair (octave_NaN, true)), m_maxval (std::pair (octave_NaN, true)) { } @@ -3383,7 +3388,9 @@ graphics_xform (const Matrix& xm, const Matrix& xim, const scaler& x, const scaler& y, const scaler& z, const Matrix& zl) - : m_xform (xm), m_xform_inv (xim), m_sx (x), m_sy (y), m_sz (z), m_zlim (zl) { } + : m_xform (xm), m_xform_inv (xim), m_sx (x), m_sy (y), + m_sz (z), m_zlim (zl) + { } graphics_xform (const graphics_xform& g) : m_xform (g.m_xform), m_xform_inv (g.m_xform_inv), m_sx (g.m_sx), @@ -3553,7 +3560,10 @@ OCTINTERP_API void update_title_position (void); graphics_xform get_transform (void) const - { return graphics_xform (m_x_render, m_x_render_inv, m_sx, m_sy, m_sz, m_x_zlim); } + { + return graphics_xform (m_x_render, m_x_render_inv, + m_sx, m_sy, m_sz, m_x_zlim); + } Matrix get_transform_matrix (void) const { return m_x_render; } Matrix get_inverse_transform_matrix (void) const { return m_x_render_inv; } @@ -3603,7 +3613,10 @@ bool get_nearhoriz (void) const { return m_nearhoriz; } ColumnVector pixel2coord (double px, double py) const - { return get_transform ().untransform (px, py, (m_x_zlim(0)+m_x_zlim(1))/2); } + { + return get_transform ().untransform (px, py, + (m_x_zlim(0)+m_x_zlim(1))/2); + } ColumnVector coord2pixel (double x, double y, double z) const { return get_transform ().transform (x, y, z); } @@ -3766,7 +3779,8 @@ radio_property gridcolormode , "{auto}|manual" radio_property gridlinestyle , "{-}|--|:|-.|none" array_property innerposition sg , default_axes_position () - // FIXME: Should be an array of "interaction objects". Make it read-only for now. + // FIXME: Should be an array of "interaction objects". + // Make it read-only for now. any_property interactions r , Matrix () double_property labelfontsizemultiplier u , 1.1 radio_property layer u , "{bottom}|top" @@ -3814,6 +3828,7 @@ bool_property xgrid , "off" handle_property xlabel SOf , make_graphics_handle ("text", m___myhandle__, false, false, false) row_vector_property xlim mu , default_lim () + radio_property xlimitmethod u , "{tickaligned}|tight|padded" radio_property xlimmode al , "{auto}|manual" bool_property xminorgrid , "off" bool_property xminortick , "off" @@ -3833,6 +3848,7 @@ bool_property ygrid , "off" handle_property ylabel SOf , make_graphics_handle ("text", m___myhandle__, false, false, false) row_vector_property ylim mu , default_lim () + radio_property ylimitmethod u , "{tickaligned}|tight|padded" radio_property ylimmode al , "{auto}|manual" bool_property yminorgrid , "off" bool_property yminortick , "off" @@ -3850,6 +3866,7 @@ bool_property zgrid , "off" handle_property zlabel SOf , make_graphics_handle ("text", m___myhandle__, false, false, false) row_vector_property zlim mu , default_lim () + radio_property zlimitmethod u , "{tickaligned}|tight|padded" radio_property zlimmode al , "{auto}|manual" bool_property zminorgrid , "off" bool_property zminortick , "off" @@ -4029,7 +4046,8 @@ { calc_ticks_and_lims (m_xlim, m_xtick, m_xminortickvalues, m_xlimmode.is ("auto"), m_xtickmode.is ("auto"), - m_xscale.is ("log")); + m_xscale.is ("log"), m_xlimitmethod.is ("padded"), + m_xlimitmethod.is ("tight")); if (m_xticklabelmode.is ("auto")) calc_ticklabels (m_xtick, m_xticklabel, m_xscale.is ("log"), xaxislocation_is ("origin"), @@ -4045,7 +4063,8 @@ { calc_ticks_and_lims (m_ylim, m_ytick, m_yminortickvalues, m_ylimmode.is ("auto"), m_ytickmode.is ("auto"), - m_yscale.is ("log")); + m_yscale.is ("log"), m_ylimitmethod.is ("padded"), + m_ylimitmethod.is ("tight")); if (m_yticklabelmode.is ("auto")) calc_ticklabels (m_ytick, m_yticklabel, m_yscale.is ("log"), yaxislocation_is ("origin"), @@ -4061,7 +4080,8 @@ { calc_ticks_and_lims (m_zlim, m_ztick, m_zminortickvalues, m_zlimmode.is ("auto"), m_ztickmode.is ("auto"), - m_zscale.is ("log")); + m_zscale.is ("log"), m_zlimitmethod.is ("padded"), + m_zlimitmethod.is ("tight")); if (m_zticklabelmode.is ("auto")) calc_ticklabels (m_ztick, m_zticklabel, m_zscale.is ("log"), false, 2, m_zlim); @@ -4109,7 +4129,8 @@ void update_zticklabelmode (void) { if (m_zticklabelmode.is ("auto")) - calc_ticklabels (m_ztick, m_zticklabel, m_zscale.is ("log"), false, 2, m_zlim); + calc_ticklabels (m_ztick, m_zticklabel, m_zscale.is ("log"), + false, 2, m_zlim); } void update_fontname (void) @@ -4165,7 +4186,8 @@ OCTINTERP_API void calc_ticks_and_lims (array_property& lims, array_property& ticks, array_property& mticks, bool limmode_is_auto, - bool tickmode_is_auto, bool is_logscale); + bool tickmode_is_auto, bool is_logscale, + bool method_is_padded, bool method_is_tight); OCTINTERP_API void calc_ticklabels (const array_property& ticks, any_property& labels, bool is_logscale, const bool is_origin, @@ -4214,7 +4236,7 @@ OCTINTERP_API Matrix get_axis_limits (double xmin, double xmax, double min_pos, double max_neg, - const bool logscale); + const bool logscale, const std::string& method); OCTINTERP_API void check_axis_limits (Matrix& limits, const Matrix kids, @@ -4226,7 +4248,8 @@ calc_ticks_and_lims (m_xlim, m_xtick, m_xminortickvalues, m_xlimmode.is ("auto"), m_xtickmode.is ("auto"), - m_xscale.is ("log")); + m_xscale.is ("log"), m_xlimitmethod.is ("padded"), + m_xlimitmethod.is ("tight")); if (m_xticklabelmode.is ("auto")) calc_ticklabels (m_xtick, m_xticklabel, m_xscale.is ("log"), m_xaxislocation.is ("origin"), @@ -4242,13 +4265,19 @@ update_axes_layout (); } + void update_xlimitmethod () + { + update_xlim (); + } + void update_ylim (void) { update_axis_limits ("ylim"); calc_ticks_and_lims (m_ylim, m_ytick, m_yminortickvalues, m_ylimmode.is ("auto"), m_ytickmode.is ("auto"), - m_yscale.is ("log")); + m_yscale.is ("log"), m_ylimitmethod.is ("padded"), + m_ylimitmethod.is ("tight")); if (m_yticklabelmode.is ("auto")) calc_ticklabels (m_ytick, m_yticklabel, m_yscale.is ("log"), yaxislocation_is ("origin"), @@ -4264,13 +4293,19 @@ update_axes_layout (); } + void update_ylimitmethod () + { + update_ylim (); + } + void update_zlim (void) { update_axis_limits ("zlim"); calc_ticks_and_lims (m_zlim, m_ztick, m_zminortickvalues, m_zlimmode.is ("auto"), m_ztickmode.is ("auto"), - m_zscale.is ("log")); + m_zscale.is ("log"), m_zlimitmethod.is ("padded"), + m_zlimitmethod.is ("tight")); if (m_zticklabelmode.is ("auto")) calc_ticklabels (m_ztick, m_zticklabel, m_zscale.is ("log"), false, 2, m_zlim); @@ -4282,6 +4317,11 @@ update_axes_layout (); } + void update_zlimitmethod () + { + update_zlim (); + } + void trigger_normals_calc (void); }; diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/hash.cc --- a/libinterp/corefcn/hash.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/hash.cc Thu Mar 03 13:37:10 2022 -0500 @@ -206,18 +206,19 @@ %!assert <*31689> (hash ("md2", "abc\0"), "5a636d615002a7874ac1c9e9a43361f7") %!assert <*31689> (hash ("md4", "abc\0"), "0ee5201897ecb206c4eaba1d2da5224d") %!assert <*31689> (hash ("md5", "abc\0"), "147a664a2ca9410911e61986d3f0d52a") -%!assert <*31689> (hash ("sha1", "abc\0"), "686483805ac47ca14e03514f7481a7973b401762") +%!assert <*31689> (hash ("sha1", "abc\0"), +%! "686483805ac47ca14e03514f7481a7973b401762") %!assert <*31689> (hash ("sha224", "abc\0"), -%! "fbc8e47920e108bb1d0b631d18b36ae9b1549d28362aa15ebe960cfb"); +%! "fbc8e47920e108bb1d0b631d18b36ae9b1549d28362aa15ebe960cfb"); %!assert <*31689> (hash ("sha256", "abc\0"), -%! "dc1114cd074914bd872cc1f9a23ec910ea2203bc79779ab2e17da25782a624fc"); +%! "dc1114cd074914bd872cc1f9a23ec910ea2203bc79779ab2e17da25782a624fc"); %!assert <*31689> (hash ("sha384", "abc\0"), -%! ["eba81f2dfba4ec60d3f786c89d91b08e6c0b63d55986874378e385", ... -%! "e6fac587cce7a520ca9437290fe626cbf75c855e17"]); +%! ["eba81f2dfba4ec60d3f786c89d91b08e6c0b63d55986874378e385", ... +%! "e6fac587cce7a520ca9437290fe626cbf75c855e17"]); %!assert <*31689> (hash ("sha512", "abc\0"), -%! ["7ce05eda233e545a2d5c626862a5ddaafb09b9d8ec3bec08aa458b", ... -%! "7c9e7d939d84a57d5a20d8a9002983aabae2457b19c50ba326bf5b", ... -%! "081f75b41342f42c3383"]); +%! ["7ce05eda233e545a2d5c626862a5ddaafb09b9d8ec3bec08aa458b", ... +%! "7c9e7d939d84a57d5a20d8a9002983aabae2457b19c50ba326bf5b", ... +%! "081f75b41342f42c3383"]); ## Test equivalence to deprecated md5sum offering file hashing %!test diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/help.cc --- a/libinterp/corefcn/help.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/help.cc Thu Mar 03 13:37:10 2022 -0500 @@ -637,7 +637,8 @@ std::string name; int i = 0; int c; - while (file && (c = file.get ()) != std::istream::traits_type::eof ()) + while (file + && (c = file.get ()) != std::istream::traits_type::eof ()) { if (c == '\n' || c == '\r') { @@ -954,7 +955,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} built_in_docstrings_file () @deftypefnx {} {@var{old_val} =} built_in_docstrings_file (@var{new_val}) -@deftypefnx {} {} built_in_docstrings_file (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} built_in_docstrings_file (@var{new_val}, "local") Query or set the internal variable that specifies the name of the file containing docstrings for built-in Octave functions. @@ -979,7 +980,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} doc_cache_file () @deftypefnx {} {@var{old_val} =} doc_cache_file (@var{new_val}) -@deftypefnx {} {} doc_cache_file (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} doc_cache_file (@var{new_val}, "local") Query or set the internal variable that specifies the name of the Octave documentation cache file. @@ -1008,7 +1009,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} info_file () @deftypefnx {} {@var{old_val} =} info_file (@var{new_val}) -@deftypefnx {} {} info_file (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} info_file (@var{new_val}, "local") Query or set the internal variable that specifies the name of the Octave info file. @@ -1034,7 +1035,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} info_program () @deftypefnx {} {@var{old_val} =} info_program (@var{new_val}) -@deftypefnx {} {} info_program (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} info_program (@var{new_val}, "local") Query or set the internal variable that specifies the name of the info program to run. @@ -1057,7 +1058,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} makeinfo_program () @deftypefnx {} {@var{old_val} =} makeinfo_program (@var{new_val}) -@deftypefnx {} {} makeinfo_program (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} makeinfo_program (@var{new_val}, "local") Query or set the internal variable that specifies the name of the program that Octave runs to format help text containing Texinfo markup commands. @@ -1079,7 +1080,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} suppress_verbose_help_message () @deftypefnx {} {@var{old_val} =} suppress_verbose_help_message (@var{new_val}) -@deftypefnx {} {} suppress_verbose_help_message (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} suppress_verbose_help_message (@var{new_val}, "local") Query or set the internal variable that controls whether Octave will add additional help information to the end of the output from the @code{help} command and usage messages for built-in commands. @@ -1098,7 +1099,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} texi_macros_file () @deftypefnx {} {@var{old_val} =} texi_macros_file (@var{new_val}) -@deftypefnx {} {} texi_macros_file (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} texi_macros_file (@var{new_val}, "local") Query or set the internal variable that specifies the name of the file containing Texinfo macros that are prepended to documentation strings before they are passed to makeinfo. diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/hex2num.cc --- a/libinterp/corefcn/hex2num.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/hex2num.cc Thu Mar 03 13:37:10 2022 -0500 @@ -361,8 +361,10 @@ } /* -%!assert (num2hex (-2:2), ["c000000000000000";"bff0000000000000";"0000000000000000";"3ff0000000000000";"4000000000000000"]) -%!assert (num2hex (single (-2:2)), ["c0000000";"bf800000";"00000000";"3f800000";"40000000"]) +%!assert (num2hex (-2:2), +%! ["c000000000000000";"bff0000000000000";"0000000000000000";"3ff0000000000000";"4000000000000000"]) +%!assert (num2hex (single (-2:2)), +%! ["c0000000";"bf800000";"00000000";"3f800000";"40000000"]) %!assert (num2hex (intmax ("uint8")), "ff") %!assert (num2hex (intmax ("uint16")), "ffff") %!assert (num2hex (intmax ("uint32")), "ffffffff") diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/input.cc --- a/libinterp/corefcn/input.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/input.cc Thu Mar 03 13:37:10 2022 -0500 @@ -89,11 +89,6 @@ // the next user prompt. bool Vdrawnow_requested = false; -// TRUE if we are recording line numbers in a source file. -// Always true except when debugging and taking input directly from -// the terminal. -bool Vtrack_line_num = true; - OCTAVE_NAMESPACE_BEGIN static std::string @@ -966,7 +961,8 @@ : m_rep (new file_reader (interp, file)) { } - input_reader::input_reader (interpreter& interp, FILE *file, const std::string& enc) + input_reader::input_reader (interpreter& interp, FILE *file, + const std::string& enc) : m_rep (new file_reader (interp, file, enc)) { } @@ -1453,7 +1449,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} PS1 () @deftypefnx {} {@var{old_val} =} PS1 (@var{new_val}) -@deftypefnx {} {} PS1 (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} PS1 (@var{new_val}, "local") Query or set the primary prompt string. When executing interactively, Octave displays the primary prompt when it is @@ -1497,7 +1493,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} PS2 () @deftypefnx {} {@var{old_val} =} PS2 (@var{new_val}) -@deftypefnx {} {} PS2 (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} PS2 (@var{new_val}, "local") Query or set the secondary prompt string. The secondary prompt is printed when Octave is expecting additional input to @@ -1521,7 +1517,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} completion_append_char () @deftypefnx {} {@var{old_val} =} completion_append_char (@var{new_val}) -@deftypefnx {} {} completion_append_char (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} completion_append_char (@var{new_val}, "local") Query or set the internal character variable that is appended to successful command-line completion attempts. @@ -1650,7 +1646,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} auto_repeat_debug_command () @deftypefnx {} {@var{old_val} =} auto_repeat_debug_command (@var{new_val}) -@deftypefnx {} {} auto_repeat_debug_command (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} auto_repeat_debug_command (@var{new_val}, "local") Query or set the internal variable that controls whether debugging commands are automatically repeated when the input line is empty (typing just @key{RET}). diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/input.h --- a/libinterp/corefcn/input.h Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/input.h Thu Mar 03 13:37:10 2022 -0500 @@ -48,11 +48,6 @@ // the next user prompt. extern OCTINTERP_API bool Vdrawnow_requested; -#if defined (OCTAVE_PROVIDE_DEPRECATED_SYMBOLS) -OCTAVE_DEPRECATED (6, "'Vtrack_line_num' is an obsolete internal variable; any uses should be removed") -extern OCTINTERP_API bool Vtrack_line_num; -#endif - extern OCTINTERP_API octave::sys::time Vlast_prompt_time; class octave_value; diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/interpreter.cc --- a/libinterp/corefcn/interpreter.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/interpreter.cc Thu Mar 03 13:37:10 2022 -0500 @@ -56,7 +56,6 @@ #include "display.h" #include "error.h" #include "event-manager.h" -#include "file-io.h" #include "graphics.h" #include "help.h" #include "input.h" @@ -2023,24 +2022,6 @@ return found; } - // Remove when corresponding public deprecated function is removed. - void interpreter::add_atexit_function_deprecated (const std::string& fname) - { - interpreter& interp - = __get_interpreter__ ("interpreter::add_atexit_function"); - - interp.add_atexit_fcn (fname); - } - - // Remove when corresponding public deprecated function is removed. - bool interpreter::remove_atexit_function_deprecated (const std::string& fname) - { - interpreter& interp - = __get_interpreter__ ("interpreter::remove_atexit_function"); - - return interp.remove_atexit_fcn (fname); - } - // What internal options get configured by --traditional. void interpreter::maximum_braindamage (void) diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/interpreter.h --- a/libinterp/corefcn/interpreter.h Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/interpreter.h Thu Mar 03 13:37:10 2022 -0500 @@ -536,30 +536,6 @@ bool remove_atexit_fcn (const std::string& fname); - private: - - // Remove when corresponding public deprecated function is removed. - static void add_atexit_function_deprecated (const std::string& fname); - - // Remove when corresponding public deprecated function is removed. - static bool remove_atexit_function_deprecated (const std::string& fname); - - public: - -#if defined (OCTAVE_PROVIDE_DEPRECATED_SYMBOLS) - OCTAVE_DEPRECATED (6, "use interpreter::add_atexit_fcn member function instead") - static void add_atexit_function (const std::string& fname) - { - add_atexit_function_deprecated (fname); - } - - OCTAVE_DEPRECATED (6, "use interpreter::remove_atexit_fcn member function instead") - static bool remove_atexit_function (const std::string& fname) - { - return remove_atexit_function_deprecated (fname); - } - #endif - static interpreter * the_interpreter (void) { return m_instance; } private: diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/inv.cc --- a/libinterp/corefcn/inv.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/inv.cc Thu Mar 03 13:37:10 2022 -0500 @@ -70,11 +70,14 @@ octave_value arg = args(0); + if (! arg.isnumeric ()) + err_wrong_type_arg ("inv", arg); + if (arg.isempty ()) return ovl (Matrix ()); if (arg.rows () != arg.columns ()) - err_square_matrix_required ("inverse", "A"); + err_square_matrix_required ("inv", "A"); octave_value result; octave_idx_type info; @@ -191,6 +194,8 @@ } } else + // Shouldn't get here since we checked for suitable arg earlier. + // Maybe for some user-defined classes? err_wrong_type_arg ("inv", arg); } @@ -233,6 +238,12 @@ %! assert (xinv, single ([-2, 1; 1.5, -0.5]), 5*eps ("single")); %! assert (isa (rcond, "single")); +## Basic test for integer inputs +%!assert (inv (int32 (2)), 0.5) +%!assert (inv (uint32 (2)), 0.5) +%!assert (inv (int64 (2)), 0.5) +%!assert (inv (uint64 (2)), 0.5) + ## Normal scalar cases %!assert (inv (2), 0.5) %!test @@ -367,11 +378,15 @@ %! assert (A, sparse ([Inf, Inf; 0, 0])); %!testif HAVE_UMFPACK <*56232> -%! fail ("A = inv (sparse ([1, 0, 0; 0, 0, 0; 0, 0, 1]))", "warning", "matrix singular"); +%! fail ("A = inv (sparse ([1, 0, 0; 0, 0, 0; 0, 0, 1]))", +%! "warning", "matrix singular"); %! assert (A, sparse ([Inf, 0, 0; 0, 0, 0; 0, 0, Inf])); -%!error inv () -%!error inv ([1, 2; 3, 4], 2) +%!error inv () +%!error inv ([1, 2; 3, 4], 2) +%!error inv ("Hello World") +%!error inv ({1}) +%!error inv (true) %!error inv ([1, 2; 3, 4; 5, 6]) %!error inv (sparse (2, 2, 0)) %!error inv (diag ([0, 0])) diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/kron.cc --- a/libinterp/corefcn/kron.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/kron.cc Thu Mar 03 13:37:10 2022 -0500 @@ -55,8 +55,8 @@ static MArray kron (const MArray& a, const MArray& b) { - assert (a.ndims () == 2); - assert (b.ndims () == 2); + error_unless (a.ndims () == 2); + error_unless (b.ndims () == 2); octave_idx_type nra = a.rows (); octave_idx_type nrb = b.rows (); @@ -86,7 +86,7 @@ static MArray kron (const MDiagArray2& a, const MArray& b) { - assert (b.ndims () == 2); + error_unless (b.ndims () == 2); octave_idx_type nra = a.rows (); octave_idx_type nrb = b.rows (); diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/load-path.cc --- a/libinterp/corefcn/load-path.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/load-path.cc Thu Mar 03 13:37:10 2022 -0500 @@ -1035,7 +1035,8 @@ source_file (file, "base"); } - // FIXME: maybe we should also maintain a map to speed up this method of access. + // FIXME: maybe we should also maintain a map to speed up this method of + // access. load_path::const_dir_info_list_iterator load_path::find_dir_info (const std::string& dir_arg) const @@ -1799,7 +1800,8 @@ if (p != fcn_file_map.end ()) { std::string fname - = sys::file_ops::concat (sys::file_ops::concat (dir, "private"), fcn); + = sys::file_ops::concat (sys::file_ops::concat (dir, "private"), + fcn); if (check_file_type (fname, type, p->second, fcn, "load_path::find_private_fcn")) @@ -1970,7 +1972,8 @@ if (symtab.is_built_in_function_name (base)) { - std::string fcn_path = sys::file_ops::concat (dir_name, fname); + std::string fcn_path = sys::file_ops::concat (dir_name, + fname); warning_with_id ("Octave:shadowed-function", "function %s shadows a built-in function", @@ -1992,7 +1995,8 @@ && s_sys_path.find (old.dir_name) != std::string::npos && in_path_list (s_sys_path, old.dir_name)) { - std::string fcn_path = sys::file_ops::concat (dir_name, fname); + std::string fcn_path = sys::file_ops::concat (dir_name, + fname); warning_with_id ("Octave:shadowed-function", "function %s shadows a core library function", @@ -2092,7 +2096,8 @@ void load_path::package_info::move_fcn_map (const std::string& dir_name, - const string_vector& fcn_files, bool at_end) + const string_vector& fcn_files, + bool at_end) { octave_idx_type len = fcn_files.numel (); @@ -2446,7 +2451,8 @@ sys::file_stat fs (nm); if (fs && fs.is_dir ()) - retval += directory_path::path_sep_str () + genpath (nm, skip); + retval += (directory_path::path_sep_str () + + genpath (nm, skip)); } } } diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/load-save.cc --- a/libinterp/corefcn/load-save.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/load-save.cc Thu Mar 03 13:37:10 2022 -0500 @@ -855,7 +855,8 @@ OCTAVE_VERSION ", %Y-%m-%d %T UTC"; std::string comment_string = now.strftime (matlab_format); - std::size_t len = std::min (comment_string.length (), static_cast (124)); + std::size_t len = std::min (comment_string.length (), + static_cast (124)); memset (headertext, ' ', 124); memcpy (headertext, comment_string.data (), len); @@ -1915,7 +1916,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} crash_dumps_octave_core () @deftypefnx {} {@var{old_val} =} crash_dumps_octave_core (@var{new_val}) -@deftypefnx {} {} crash_dumps_octave_core (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} crash_dumps_octave_core (@var{new_val}, "local") Query or set the internal variable that controls whether Octave tries to save all current variables to the file @file{octave-workspace} if it crashes or receives a hangup, terminate or similar signal. @@ -1936,7 +1937,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} save_default_options () @deftypefnx {} {@var{old_val} =} save_default_options (@var{new_val}) -@deftypefnx {} {} save_default_options (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} save_default_options (@var{new_val}, "local") Query or set the internal variable that specifies the default options for the @code{save} command, and defines the default format. @@ -1958,7 +1959,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} octave_core_file_limit () @deftypefnx {} {@var{old_val} =} octave_core_file_limit (@var{new_val}) -@deftypefnx {} {} octave_core_file_limit (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} octave_core_file_limit (@var{new_val}, "local") Query or set the internal variable that specifies the maximum amount of memory that Octave will save when writing a crash dump file. @@ -1987,7 +1988,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} octave_core_file_name () @deftypefnx {} {@var{old_val} =} octave_core_file_name (@var{new_val}) -@deftypefnx {} {} octave_core_file_name (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} octave_core_file_name (@var{new_val}, "local") Query or set the internal variable that specifies the name of the file used for saving data from the top-level workspace if Octave aborts. @@ -2009,7 +2010,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} octave_core_file_options () @deftypefnx {} {@var{old_val} =} octave_core_file_options (@var{new_val}) -@deftypefnx {} {} octave_core_file_options (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} octave_core_file_options (@var{new_val}, "local") Query or set the internal variable that specifies the options used for saving the workspace data if Octave aborts. @@ -2032,7 +2033,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} save_header_format_string () @deftypefnx {} {@var{old_val} =} save_header_format_string (@var{new_val}) -@deftypefnx {} {} save_header_format_string (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} save_header_format_string (@var{new_val}, "local") Query or set the internal variable that specifies the format string used for the comment line written at the beginning of text-format data files saved by Octave. diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/ls-hdf5.cc --- a/libinterp/corefcn/ls-hdf5.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/ls-hdf5.cc Thu Mar 03 13:37:10 2022 -0500 @@ -1272,7 +1272,8 @@ if (space_hid < 0) return space_hid; #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (loc_id, name, H5T_NATIVE_IDX, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (loc_id, name, H5T_NATIVE_IDX, space_hid, octave_H5P_DEFAULT); diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/ls-hdf5.h --- a/libinterp/corefcn/ls-hdf5.h Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/ls-hdf5.h Thu Mar 03 13:37:10 2022 -0500 @@ -53,7 +53,8 @@ ~hdf5_fstreambase () { close (); } - OCTINTERP_API hdf5_fstreambase (const char *name, int mode, int /* prot */ = 0); + OCTINTERP_API hdf5_fstreambase (const char *name, int mode, + int /* prot */ = 0); OCTINTERP_API void close (void); diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/ls-mat5.cc --- a/libinterp/corefcn/ls-mat5.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/ls-mat5.cc Thu Mar 03 13:37:10 2022 -0500 @@ -913,7 +913,8 @@ if (ov_fcn.is_defined ()) // XXX FCN_HANDLE: SIMPLE/SCOPED - tc = octave_value (new octave_fcn_handle (ov_fcn, fname)); + tc = octave_value (new octave_fcn_handle (ov_fcn, + fname)); } else { @@ -940,7 +941,8 @@ if (ov_fcn.is_defined ()) // XXX FCN_HANDLE: SIMPLE/SCOPED - tc = octave_value (new octave_fcn_handle (ov_fcn, fname)); + tc = octave_value (new octave_fcn_handle (ov_fcn, + fname)); else { warning_with_id ("Octave:load:file-not-found", @@ -1041,7 +1043,8 @@ error ("load: failed to load anonymous function handle"); // XXX FCN_HANDLE: ANONYMOUS - tc = octave_value (new octave_fcn_handle (fh->fcn_val (), local_vars)); + tc = octave_value (new octave_fcn_handle (fh->fcn_val (), + local_vars)); } else error ("load: invalid function handle type"); @@ -2703,7 +2706,8 @@ { if (tc.is_inline_function () || tc.isobject ()) { - std::string classname = (tc.isobject () ? tc.class_name () : "inline"); + std::string classname = (tc.isobject () ? tc.class_name () + : "inline"); std::size_t namelen = classname.length (); if (namelen > max_namelen) diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/ls-oct-text.cc --- a/libinterp/corefcn/ls-oct-text.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/ls-oct-text.cc Thu Mar 03 13:37:10 2022 -0500 @@ -463,7 +463,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} save_precision () @deftypefnx {} {@var{old_val} =} save_precision (@var{new_val}) -@deftypefnx {} {} save_precision (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} save_precision (@var{new_val}, "local") Query or set the internal variable that specifies the number of digits to keep when saving data in text format. diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/lu.cc --- a/libinterp/corefcn/lu.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/lu.cc Thu Mar 03 13:37:10 2022 -0500 @@ -781,14 +781,16 @@ %! [L,U] = luupdate (L,U,P*single (u), single (v)); %! assert (norm (vec (tril (L)-L), Inf) == 0); %! assert (norm (vec (triu (U)-U), Inf) == 0); -%! assert (norm (vec (P'*L*U - single (A) - single (u)*single (v).'), Inf) < norm (single (A))*1e1*eps ("single")); +%! assert (norm (vec (P'*L*U - single (A) - single (u)*single (v).'), Inf) +%! < norm (single (A))*1e1*eps ("single")); %! %!testif HAVE_QRUPDATE_LUU %! [L,U,P] = lu (single (Ac)); %! [L,U] = luupdate (L,U,P*single (uc),single (vc)); %! assert (norm (vec (tril (L)-L), Inf) == 0); %! assert (norm (vec (triu (U)-U), Inf) == 0); -%! assert (norm (vec (P'*L*U - single (Ac) - single (uc)*single (vc).'), Inf) < norm (single (Ac))*1e1*eps ("single")); +%! assert (norm (vec (P'*L*U - single (Ac) - single (uc)*single (vc).'), Inf) +%! < norm (single (Ac))*1e1*eps ("single")); %!testif HAVE_QRUPDATE_LUU %! [L,U,P] = lu (A); @@ -823,14 +825,16 @@ %! [L,U,P] = luupdate (L,U,P,single (u),single (v)); %! assert (norm (vec (tril (L)-L), Inf) == 0); %! assert (norm (vec (triu (U)-U), Inf) == 0); -%! assert (norm (vec (P'*L*U - single (A) - single (u)*single (v).'), Inf) < norm (single (A))*1e1*eps ("single")); +%! assert (norm (vec (P'*L*U - single (A) - single (u)*single (v).'), Inf) +%! < norm (single (A))*1e1*eps ("single")); %! %!testif HAVE_QRUPDATE_LUU %! [L,U,P] = lu (single (Ac)); %! [L,U,P] = luupdate (L,U,P,single (uc),single (vc)); %! assert (norm (vec (tril (L)-L), Inf) == 0); %! assert (norm (vec (triu (U)-U), Inf) == 0); -%! assert (norm (vec (P'*L*U - single (Ac) - single (uc)*single (vc).'), Inf) < norm (single (Ac))*1e1*eps ("single")); +%! assert (norm (vec (P'*L*U - single (Ac) - single (uc)*single (vc).'), Inf) +%! < norm (single (Ac))*1e1*eps ("single")); */ OCTAVE_NAMESPACE_END diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/mappers.cc --- a/libinterp/corefcn/mappers.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/mappers.cc Thu Mar 03 13:37:10 2022 -0500 @@ -280,7 +280,8 @@ %! assert (arg (single (-1)), single (pi)); %! endif %!assert (arg (single (-i)), single (-pi/2)) -%!assert (arg (single ([1, i; -1, -i])), single ([0, pi/2; pi, -pi/2]), 2e1*eps ("single")) +%!assert (arg (single ([1, i; -1, -i])), +%! single ([0, pi/2; pi, -pi/2]), 2e1*eps ("single")) %!error arg () %!error arg (1, 2) @@ -535,7 +536,8 @@ %!assert (ceil (single ([2, 1.1, -1.1, -1])), single ([2, 2, -1, -1])) ## complex single precision -%!assert (ceil (single ([2+2i, 1.1+1.1i, -1.1-1.1i, -1-i])), single ([2+2i, 2+2i, -1-i, -1-i])) +%!assert (ceil (single ([2+2i, 1.1+1.1i, -1.1-1.1i, -1-i])), +%! single ([2+2i, 2+2i, -1-i, -1-i])) %!error ceil () %!error ceil (1, 2) @@ -732,13 +734,18 @@ /* ## middle region %!assert (erf (erfinv ([-0.9 -0.3 0 0.4 0.8])), [-0.9 -0.3 0 0.4 0.8], eps) -%!assert (erf (erfinv (single ([-0.9 -0.3 0 0.4 0.8]))), single ([-0.9 -0.3 0 0.4 0.8]), eps ("single")) +%!assert (erf (erfinv (single ([-0.9 -0.3 0 0.4 0.8]))), +%! single ([-0.9 -0.3 0 0.4 0.8]), eps ("single")) ## tail region -%!assert (erf (erfinv ([-0.999 -0.99 0.9999 0.99999])), [-0.999 -0.99 0.9999 0.99999], eps) -%!assert (erf (erfinv (single ([-0.999 -0.99 0.9999 0.99999]))), single ([-0.999 -0.99 0.9999 0.99999]), eps ("single")) +%!assert (erf (erfinv ([-0.999 -0.99 0.9999 0.99999])), +%! [-0.999 -0.99 0.9999 0.99999], eps) +%!assert (erf (erfinv (single ([-0.999 -0.99 0.9999 0.99999]))), +%! single ([-0.999 -0.99 0.9999 0.99999]), eps ("single")) ## backward - loss of accuracy -%!assert (erfinv (erf ([-3 -1 -0.4 0.7 1.3 2.8])), [-3 -1 -0.4 0.7 1.3 2.8], -1e-12) -%!assert (erfinv (erf (single ([-3 -1 -0.4 0.7 1.3 2.8]))), single ([-3 -1 -0.4 0.7 1.3 2.8]), -1e-4) +%!assert (erfinv (erf ([-3 -1 -0.4 0.7 1.3 2.8])), +%! [-3 -1 -0.4 0.7 1.3 2.8], -1e-12) +%!assert (erfinv (erf (single ([-3 -1 -0.4 0.7 1.3 2.8]))), +%! single ([-3 -1 -0.4 0.7 1.3 2.8]), -1e-4) ## exceptional %!assert (erfinv ([-1, 1, 1.1, -2.1]), [-Inf, Inf, NaN, NaN]) %!error erfinv (1+2i) @@ -769,13 +776,18 @@ /* ## middle region %!assert (erfc (erfcinv ([1.9 1.3 1 0.6 0.2])), [1.9 1.3 1 0.6 0.2], eps) -%!assert (erfc (erfcinv (single ([1.9 1.3 1 0.6 0.2]))), single ([1.9 1.3 1 0.6 0.2]), eps ("single")) +%!assert (erfc (erfcinv (single ([1.9 1.3 1 0.6 0.2]))), +%! single ([1.9 1.3 1 0.6 0.2]), eps ("single")) ## tail region -%!assert (erfc (erfcinv ([0.001 0.01 1.9999 1.99999])), [0.001 0.01 1.9999 1.99999], eps) -%!assert (erfc (erfcinv (single ([0.001 0.01 1.9999 1.99999]))), single ([0.001 0.01 1.9999 1.99999]), eps ("single")) +%!assert (erfc (erfcinv ([0.001 0.01 1.9999 1.99999])), +%! [0.001 0.01 1.9999 1.99999], eps) +%!assert (erfc (erfcinv (single ([0.001 0.01 1.9999 1.99999]))), +%! single ([0.001 0.01 1.9999 1.99999]), eps ("single")) ## backward - loss of accuracy -%!assert (erfcinv (erfc ([-3 -1 -0.4 0.7 1.3 2.8])), [-3 -1 -0.4 0.7 1.3 2.8], -1e-12) -%!assert (erfcinv (erfc (single ([-3 -1 -0.4 0.7 1.3 2.8]))), single ([-3 -1 -0.4 0.7 1.3 2.8]), -1e-4) +%!assert (erfcinv (erfc ([-3 -1 -0.4 0.7 1.3 2.8])), +%! [-3 -1 -0.4 0.7 1.3 2.8], -1e-12) +%!assert (erfcinv (erfc (single ([-3 -1 -0.4 0.7 1.3 2.8]))), +%! single ([-3 -1 -0.4 0.7 1.3 2.8]), -1e-4) ## exceptional %!assert (erfcinv ([2, 0, -0.1, 2.1]), [-Inf, Inf, NaN, NaN]) %!error erfcinv (1+2i) @@ -957,8 +969,10 @@ /* %!assert (exp ([0, 1, -1, -1000]), [1, e, 1/e, 0], sqrt (eps)) %!assert (exp (1+i), e * (cos (1) + sin (1) * i), sqrt (eps)) -%!assert (exp (single ([0, 1, -1, -1000])), single ([1, e, 1/e, 0]), sqrt (eps ("single"))) -%!assert (exp (single (1+i)), single (e * (cos (1) + sin (1) * i)), sqrt (eps ("single"))) +%!assert (exp (single ([0, 1, -1, -1000])), +%! single ([1, e, 1/e, 0]), sqrt (eps ("single"))) +%!assert (exp (single (1+i)), +%! single (e * (cos (1) + sin (1) * i)), sqrt (eps ("single"))) %!assert (exp ([Inf, -Inf, NaN]), [Inf 0 NaN]) %!assert (exp (single ([Inf, -Inf, NaN])), single ([Inf 0 NaN])) @@ -999,7 +1013,7 @@ DEFUN (isfinite, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} isfinite (@var{x}) +@deftypefn {} {@var{tf} =} isfinite (@var{x}) Return a logical array which is true where the elements of @var{x} are finite values and false where they are not. @@ -1061,7 +1075,8 @@ %!assert (fix ([1.1, 1, -1.1, -1]), [1, 1, -1, -1]) %!assert (fix ([1.1+1.1i, 1+i, -1.1-1.1i, -1-i]), [1+i, 1+i, -1-i, -1-i]) %!assert (fix (single ([1.1, 1, -1.1, -1])), single ([1, 1, -1, -1])) -%!assert (fix (single ([1.1+1.1i, 1+i, -1.1-1.1i, -1-i])), single ([1+i, 1+i, -1-i, -1-i])) +%!assert (fix (single ([1.1+1.1i, 1+i, -1.1-1.1i, -1-i])), +%! single ([1+i, 1+i, -1-i, -1-i])) %!error fix () %!error fix (1, 2) @@ -1094,7 +1109,8 @@ %!assert (floor ([2, 1.1, -1.1, -1]), [2, 1, -2, -1]) %!assert (floor ([2+2i, 1.1+1.1i, -1.1-1.1i, -1-i]), [2+2i, 1+i, -2-2i, -1-i]) %!assert (floor (single ([2, 1.1, -1.1, -1])), single ([2, 1, -2, -1])) -%!assert (floor (single ([2+2i, 1.1+1.1i, -1.1-1.1i, -1-i])), single ([2+2i, 1+i, -2-2i, -1-i])) +%!assert (floor (single ([2+2i, 1.1+1.1i, -1.1-1.1i, -1-i])), +%! single ([2+2i, 1+i, -2-2i, -1-i])) %!error floor () %!error floor (1, 2) @@ -1199,7 +1215,7 @@ DEFUNX ("isalnum", Fisalnum, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} isalnum (@var{s}) +@deftypefn {} {@var{tf} =} isalnum (@var{s}) Return a logical array which is true where the elements of @var{s} are letters or digits and false where they are not. @@ -1229,7 +1245,7 @@ DEFUNX ("isalpha", Fisalpha, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} isalpha (@var{s}) +@deftypefn {} {@var{tf} =} isalpha (@var{s}) Return a logical array which is true where the elements of @var{s} are letters and false where they are not. @@ -1258,7 +1274,7 @@ DEFUNX ("isascii", Fisascii, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} isascii (@var{s}) +@deftypefn {} {@var{tf} =} isascii (@var{s}) Return a logical array which is true where the elements of @var{s} are ASCII characters (in the range 0 to 127 decimal) and false where they are not. @@ -1282,7 +1298,7 @@ DEFUNX ("iscntrl", Fiscntrl, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} iscntrl (@var{s}) +@deftypefn {} {@var{tf} =} iscntrl (@var{s}) Return a logical array which is true where the elements of @var{s} are control characters and false where they are not. @seealso{ispunct, isspace, isalpha, isdigit} @@ -1308,7 +1324,7 @@ DEFUNX ("isdigit", Fisdigit, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} isdigit (@var{s}) +@deftypefn {} {@var{tf} =} isdigit (@var{s}) Return a logical array which is true where the elements of @var{s} are decimal digits (0-9) and false where they are not. @seealso{isxdigit, isalpha, isletter, ispunct, isspace, iscntrl} @@ -1334,7 +1350,7 @@ DEFUN (isinf, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} isinf (@var{x}) +@deftypefn {} {@var{tf} =} isinf (@var{x}) Return a logical array which is true where the elements of @var{x} are infinite and false where they are not. @@ -1360,13 +1376,15 @@ %!assert (! isinf (NaN)) %!assert (! isinf (NA)) %!assert (isinf (rand (1,10)), false (1,10)) -%!assert (isinf ([NaN -Inf -1 0 1 Inf NA]), [false, true, false, false, false, true, false]) +%!assert (isinf ([NaN -Inf -1 0 1 Inf NA]), +%! [false, true, false, false, false, true, false]) %!assert (isinf (single (Inf))) %!assert (! isinf (single (NaN))) %!assert (! isinf (single (NA))) %!assert (isinf (single (rand (1,10))), false (1,10)) -%!assert (isinf (single ([NaN -Inf -1 0 1 Inf NA])), [false, true, false, false, false, true, false]) +%!assert (isinf (single ([NaN -Inf -1 0 1 Inf NA])), +%! [false, true, false, false, false, true, false]) %!assert (! isinf ('a')) %!error isinf () @@ -1375,7 +1393,7 @@ DEFUNX ("isgraph", Fisgraph, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} isgraph (@var{s}) +@deftypefn {} {@var{tf} =} isgraph (@var{s}) Return a logical array which is true where the elements of @var{s} are printable characters (but not the space character) and false where they are not. @@ -1402,7 +1420,7 @@ DEFUNX ("islower", Fislower, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} islower (@var{s}) +@deftypefn {} {@var{tf} =} islower (@var{s}) Return a logical array which is true where the elements of @var{s} are lowercase letters and false where they are not. @seealso{isupper, isalpha, isletter, isalnum} @@ -1428,7 +1446,7 @@ DEFUN (isna, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} isna (@var{x}) +@deftypefn {} {@var{tf} =} isna (@var{x}) Return a logical array which is true where the elements of @var{x} are NA (missing) values and false where they are not. @@ -1454,13 +1472,15 @@ %!assert (! isna (NaN)) %!assert (isna (NA)) %!assert (isna (rand (1,10)), false (1,10)) -%!assert (isna ([NaN -Inf -1 0 1 Inf NA]), [false, false, false, false, false, false, true]) +%!assert (isna ([NaN -Inf -1 0 1 Inf NA]), +%! [false, false, false, false, false, false, true]) %!assert (! isna (single (Inf))) %!assert (! isna (single (NaN))) %!assert (isna (single (NA))) %!assert (isna (single (rand (1,10))), false (1,10)) -%!assert (isna (single ([NaN -Inf -1 0 1 Inf NA])), [false, false, false, false, false, false, true]) +%!assert (isna (single ([NaN -Inf -1 0 1 Inf NA])), +%! [false, false, false, false, false, false, true]) %!error isna () %!error isna (1, 2) @@ -1468,7 +1488,7 @@ DEFUN (isnan, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} isnan (@var{x}) +@deftypefn {} {@var{tf} =} isnan (@var{x}) Return a logical array which is true where the elements of @var{x} are NaN values and false where they are not. @@ -1494,13 +1514,15 @@ %!assert (isnan (NaN)) %!assert (isnan (NA)) %!assert (isnan (rand (1,10)), false (1,10)) -%!assert (isnan ([NaN -Inf -1 0 1 Inf NA]), [true, false, false, false, false, false, true]) +%!assert (isnan ([NaN -Inf -1 0 1 Inf NA]), +%! [true, false, false, false, false, false, true]) %!assert (! isnan (single (Inf))) %!assert (isnan (single (NaN))) %!assert (isnan (single (NA))) %!assert (isnan (single (rand (1,10))), false (1,10)) -%!assert (isnan (single ([NaN -Inf -1 0 1 Inf NA])), [true, false, false, false, false, false, true]) +%!assert (isnan (single ([NaN -Inf -1 0 1 Inf NA])), +%! [true, false, false, false, false, false, true]) %!assert (! isnan ('a')) %!error isnan () @@ -1509,7 +1531,7 @@ DEFUNX ("isprint", Fisprint, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} isprint (@var{s}) +@deftypefn {} {@var{tf} =} isprint (@var{s}) Return a logical array which is true where the elements of @var{s} are printable characters (including the space character) and false where they are not. @@ -1536,7 +1558,7 @@ DEFUNX ("ispunct", Fispunct, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} ispunct (@var{s}) +@deftypefn {} {@var{tf} =} ispunct (@var{s}) Return a logical array which is true where the elements of @var{s} are punctuation characters and false where they are not. @seealso{isalpha, isdigit, isspace, iscntrl} @@ -1565,7 +1587,7 @@ DEFUNX ("isspace", Fisspace, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} isspace (@var{s}) +@deftypefn {} {@var{tf} =} isspace (@var{s}) Return a logical array which is true where the elements of @var{s} are whitespace characters (space, formfeed, newline, carriage return, tab, and vertical tab) and false where they are not. @@ -1592,7 +1614,7 @@ DEFUNX ("isupper", Fisupper, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} isupper (@var{s}) +@deftypefn {} {@var{tf} =} isupper (@var{s}) Return a logical array which is true where the elements of @var{s} are uppercase letters and false where they are not. @seealso{islower, isalpha, isletter, isalnum} @@ -1618,7 +1640,7 @@ DEFUNX ("isxdigit", Fisxdigit, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} isxdigit (@var{s}) +@deftypefn {} {@var{tf} =} isxdigit (@var{s}) Return a logical array which is true where the elements of @var{s} are hexadecimal digits (0-9 and @nospell{a-fA-F}). @seealso{isdigit} @@ -1714,7 +1736,8 @@ %!assert (log ([-0.5, -1.5, -2.5]), log ([0.5, 1.5, 2.5]) + pi*1i, sqrt (eps)) %!assert (log (single ([1, e, e^2])), single ([0, 1, 2]), sqrt (eps ("single"))) -%!assert (log (single ([-0.5, -1.5, -2.5])), single (log ([0.5, 1.5, 2.5]) + pi*1i), 4*eps ("single")) +%!assert (log (single ([-0.5, -1.5, -2.5])), +%! single (log ([0.5, 1.5, 2.5]) + pi*1i), 4*eps ("single")) %!error log () %!error log (1, 2) @@ -1735,7 +1758,8 @@ /* %!assert (log10 ([0.01, 0.1, 1, 10, 100]), [-2, -1, 0, 1, 2], sqrt (eps)) -%!assert (log10 (single ([0.01, 0.1, 1, 10, 100])), single ([-2, -1, 0, 1, 2]), sqrt (eps ("single"))) +%!assert (log10 (single ([0.01, 0.1, 1, 10, 100])), +%! single ([-2, -1, 0, 1, 2]), sqrt (eps ("single"))) %!error log10 () %!error log10 (1, 2) @@ -2061,12 +2085,16 @@ %!assert (sqrt (4), 2) %!assert (sqrt (-1), i) %!assert (sqrt (1+i), exp (0.5 * log (1+i)), sqrt (eps)) -%!assert (sqrt ([4, -4; i, 1-i]), [2, 2i; exp(0.5 * log (i)), exp(0.5 * log (1-i))], sqrt (eps)) +%!assert (sqrt ([4, -4; i, 1-i]), +%! [2, 2i; exp(0.5 * log (i)), exp(0.5 * log (1-i))], sqrt (eps)) %!assert (sqrt (single (4)), single (2)) %!assert (sqrt (single (-1)), single (i)) -%!assert (sqrt (single (1+i)), single (exp (0.5 * log (1+i))), sqrt (eps ("single"))) -%!assert (sqrt (single ([4, -4; i, 1-i])), single ([2, 2i; exp(0.5 * log (i)), exp(0.5 * log (1-i))]), sqrt (eps ("single"))) +%!assert (sqrt (single (1+i)), +%! single (exp (0.5 * log (1+i))), sqrt (eps ("single"))) +%!assert (sqrt (single ([4, -4; i, 1-i])), +%! single ([2, 2i; exp(0.5 * log (i)), exp(0.5 * log (1-i))]), +%! sqrt (eps ("single"))) %!error sqrt () %!error sqrt (1, 2) @@ -2162,10 +2190,12 @@ /* %!assert (tolower ("OCTAVE"), "octave") %!assert (tolower ("123OCTave! _&"), "123octave! _&") -%!assert (tolower ({"ABC", "DEF", {"GHI", {"JKL"}}}), {"abc", "def", {"ghi", {"jkl"}}}) +%!assert (tolower ({"ABC", "DEF", {"GHI", {"JKL"}}}), +%! {"abc", "def", {"ghi", {"jkl"}}}) %!assert (tolower (["ABC"; "DEF"]), ["abc"; "def"]) %!assert (tolower ({["ABC"; "DEF"]}), {["abc";"def"]}) -%!assert (tolower (["ABCÄÖÜSS"; "abcäöüß"]), ["abcäöüss"; "abcäöüß"]) +%!assert (tolower (["ABCÄÖÜSS"; "abcäöüß"]), +%! ["abcäöüss"; "abcäöüß"]) %!assert (tolower (repmat ("ÄÖÜ", 2, 1, 3)), repmat ("äöü", 2, 1, 3)) %!assert (tolower (68), 68) %!assert (tolower ({[68, 68; 68, 68]}), {[68, 68; 68, 68]}) @@ -2228,10 +2258,12 @@ /* %!assert (toupper ("octave"), "OCTAVE") %!assert (toupper ("123OCTave! _&"), "123OCTAVE! _&") -%!assert (toupper ({"abc", "def", {"ghi", {"jkl"}}}), {"ABC", "DEF", {"GHI", {"JKL"}}}) +%!assert (toupper ({"abc", "def", {"ghi", {"jkl"}}}), +%! {"ABC", "DEF", {"GHI", {"JKL"}}}) %!assert (toupper (["abc"; "def"]), ["ABC"; "DEF"]) %!assert (toupper ({["abc"; "def"]}), {["ABC";"DEF"]}) -%!assert (toupper (["ABCÄÖÜSS"; "abcäöüß"]), ["ABCÄÖÜSS"; "ABCÄÖÜSS"]) +%!assert (toupper (["ABCÄÖÜSS"; "abcäöüß"]), +%! ["ABCÄÖÜSS"; "ABCÄÖÜSS"]) %!assert (toupper (repmat ("äöü", 2, 1, 3)), repmat ("ÄÖÜ", 2, 1, 3)) %!assert (toupper (100), 100) %!assert (toupper ({[100, 100; 100, 100]}), {[100, 100; 100, 100]}) diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/matrix_type.cc --- a/libinterp/corefcn/matrix_type.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/matrix_type.cc Thu Mar 03 13:37:10 2022 -0500 @@ -458,10 +458,13 @@ %!assert (matrix_type (speye (10,10)), "Diagonal") %!assert (matrix_type (speye (10,10)([2:10,1],:)), "Permuted Diagonal") -%!assert (matrix_type ([[speye(10,10);sparse(1,10)],[1;sparse(9,1);1]]), "Upper") -%!assert (matrix_type ([[speye(10,10);sparse(1,10)],[1;sparse(9,1);1]](:,[2,1,3:11])), "Permuted Upper") +%!assert (matrix_type ([[speye(10,10);sparse(1,10)],[1;sparse(9,1);1]]), +%! "Upper") +%!assert (matrix_type ([[speye(10,10);sparse(1,10)],[1;sparse(9,1);1]](:,[2,1,3:11])), +%! "Permuted Upper") %!assert (matrix_type ([speye(10,10),sparse(10,1);1,sparse(1,9),1]), "Lower") -%!assert (matrix_type ([speye(10,10),sparse(10,1);1,sparse(1,9),1]([2,1,3:11],:)), "Permuted Lower") +%!assert (matrix_type ([speye(10,10),sparse(10,1);1,sparse(1,9),1]([2,1,3:11],:)), +%! "Permuted Lower") %!test %! bnd = spparms ("bandden"); @@ -486,30 +489,40 @@ %!assert (matrix_type (speye (10,11)([2:10,1],:)), "Permuted Diagonal") %!assert (matrix_type (speye (11,10)), "Diagonal") %!assert (matrix_type (speye (11,10)([2:11,1],:)), "Permuted Diagonal") -%#!assert (matrix_type ([[speye(10,10);sparse(1,10)],[[1,1];sparse(9,2);[1,1]]]), "Upper") -%#!assert (matrix_type ([[speye(10,10);sparse(1,10)],[[1,1];sparse(9,2);[1,1]]](:,[2,1,3:12])), "Permuted Upper") +%!#assert (matrix_type ([[speye(10,10);sparse(1,10)],[[1,1];sparse(9,2);[1,1]]]), "Upper") +%!#assert (matrix_type ([[speye(10,10);sparse(1,10)],[[1,1];sparse(9,2);[1,1]]](:,[2,1,3:12])), "Permuted Upper") %!assert (matrix_type ([speye(11,9),[1;sparse(8,1);1;0]]), "Upper") -%!assert (matrix_type ([speye(11,9),[1;sparse(8,1);1;0]](:,[2,1,3:10])), "Permuted Upper") -%#!assert (matrix_type ([speye(10,10),sparse(10,1);[1;1],sparse(2,9),[1;1]]), "Lower") -%#!assert (matrix_type ([speye(10,10),sparse(10,1);[1;1],sparse(2,9),[1;1]]([2,1,3:12],:)), "Permuted Lower") +%!assert (matrix_type ([speye(11,9),[1;sparse(8,1);1;0]](:,[2,1,3:10])), +%! "Permuted Upper") + +%!#assert (matrix_type ([speye(10,10),sparse(10,1);[1;1],sparse(2,9),[1;1]]), +%! "Lower") +%!#assert (matrix_type ([speye(10,10),sparse(10,1);[1;1],sparse(2,9),[1;1]]([2,1,3:12],:)), +%! "Permuted Lower") %!assert (matrix_type ([speye(9,11);[1,sparse(1,8),1,0]]), "Lower") -%!assert (matrix_type ([speye(9,11);[1,sparse(1,8),1,0]]([2,1,3:10],:)), "Permuted Lower") +%!assert (matrix_type ([speye(9,11);[1,sparse(1,8),1,0]]([2,1,3:10],:)), +%! "Permuted Lower") %!assert (matrix_type (spdiags (randn (10,4),[-2:1],10,9)), "Rectangular") %!assert (matrix_type (1i*speye (10,10)), "Diagonal") %!assert (matrix_type (1i*speye (10,10)([2:10,1],:)), "Permuted Diagonal") -%!assert (matrix_type ([[speye(10,10);sparse(1,10)],[1i;sparse(9,1);1]]), "Upper") -%!assert (matrix_type ([[speye(10,10);sparse(1,10)],[1i;sparse(9,1);1]](:,[2,1,3:11])), "Permuted Upper") +%!assert (matrix_type ([[speye(10,10);sparse(1,10)],[1i;sparse(9,1);1]]), +%! "Upper") +%!assert (matrix_type ([[speye(10,10);sparse(1,10)],[1i;sparse(9,1);1]](:,[2,1,3:11])), +%! "Permuted Upper") %!assert (matrix_type ([speye(10,10),sparse(10,1);1i,sparse(1,9),1]), "Lower") -%!assert (matrix_type ([speye(10,10),sparse(10,1);1i,sparse(1,9),1]([2,1,3:11],:)), "Permuted Lower") +%!assert (matrix_type ([speye(10,10),sparse(10,1);1i,sparse(1,9),1]([2,1,3:11],:)), +%! "Permuted Lower") %!test %! bnd = spparms ("bandden"); %! spparms ("bandden", 0.5); -%! assert (matrix_type (spdiags (1i*randn (10,3),[-1,0,1],10,10)), "Tridiagonal"); +%! assert (matrix_type (spdiags (1i*randn (10,3),[-1,0,1],10,10)), +%! "Tridiagonal"); %! a = 1i*(rand (9,1)-0.5); %! a = [[a;0],ones(10,1),[0;-a]]; -%! assert (matrix_type (spdiags (a,[-1,0,1],10,10)), "Tridiagonal Positive Definite"); +%! assert (matrix_type (spdiags (a,[-1,0,1],10,10)), +%! "Tridiagonal Positive Definite"); %! spparms ("bandden", bnd); %!test %! bnd = spparms ("bandden"); @@ -528,14 +541,16 @@ %!assert (matrix_type (1i*speye (10,11)([2:10,1],:)), "Permuted Diagonal") %!assert (matrix_type (1i*speye (11,10)), "Diagonal") %!assert (matrix_type (1i*speye (11,10)([2:11,1],:)), "Permuted Diagonal") -%#!assert (matrix_type ([[speye(10,10);sparse(1,10)],[[1i,1i];sparse(9,2);[1i,1i]]]), "Upper") -%#!assert (matrix_type ([[speye(10,10);sparse(1,10)],[[1i,1i];sparse(9,2);[1i,1i]]](:,[2,1,3:12])), "Permuted Upper") +%!#assert (matrix_type ([[speye(10,10);sparse(1,10)],[[1i,1i];sparse(9,2);[1i,1i]]]), "Upper") +%!#assert (matrix_type ([[speye(10,10);sparse(1,10)],[[1i,1i];sparse(9,2);[1i,1i]]](:,[2,1,3:12])), "Permuted Upper") %!assert (matrix_type ([speye(11,9),[1i;sparse(8,1);1i;0]]), "Upper") -%!assert (matrix_type ([speye(11,9),[1i;sparse(8,1);1i;0]](:,[2,1,3:10])), "Permuted Upper") -%#!assert (matrix_type ([speye(10,10),sparse(10,1);[1i;1i],sparse(2,9),[1i;1i]]), "Lower") -%#!assert (matrix_type ([speye(10,10),sparse(10,1);[1i;1i],sparse(2,9),[1i;1i]]([2,1,3:12],:)), "Permuted Lower") +%!assert (matrix_type ([speye(11,9),[1i;sparse(8,1);1i;0]](:,[2,1,3:10])), +%! "Permuted Upper") +%!#assert (matrix_type ([speye(10,10),sparse(10,1);[1i;1i],sparse(2,9),[1i;1i]]), "Lower") +%!#assert (matrix_type ([speye(10,10),sparse(10,1);[1i;1i],sparse(2,9),[1i;1i]]([2,1,3:12],:)), "Permuted Lower") %!assert (matrix_type ([speye(9,11);[1i,sparse(1,8),1i,0]]), "Lower") -%!assert (matrix_type ([speye(9,11);[1i,sparse(1,8),1i,0]]([2,1,3:10],:)), "Permuted Lower") +%!assert (matrix_type ([speye(9,11);[1i,sparse(1,8),1i,0]]([2,1,3:10],:)), +%! "Permuted Lower") %!assert (matrix_type (1i*spdiags(randn(10,4),[-2:1],10,9)), "Rectangular") %!test diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/max.cc --- a/libinterp/corefcn/max.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/max.cc Thu Mar 03 13:37:10 2022 -0500 @@ -290,7 +290,8 @@ retval(0) = range.max (); if (nargout > 1) retval(1) = static_cast - (range.increment () >= 0 ? range.numel () : 1); + (range.increment () >= 0 ? range.numel () + : 1); } } else if (arg.issparse ()) diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/mex.cc --- a/libinterp/corefcn/mex.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/mex.cc Thu Mar 03 13:37:10 2022 -0500 @@ -489,7 +489,7 @@ mxArray *retval = m_val.as_mxArray (m_interleaved); // RETVAL is assumed to be an mxArray_matlab object. Should we - // assert that condition here? + // error_unless that condition here? if (retval) { @@ -799,9 +799,11 @@ GET_DATA_METHOD (mxUint64, get_uint64s, mxUINT64_CLASS, mxREAL); - GET_DATA_METHOD (mxComplexDouble, get_complex_doubles, mxDOUBLE_CLASS, mxCOMPLEX); - - GET_DATA_METHOD (mxComplexSingle, get_complex_singles, mxDOUBLE_CLASS, mxCOMPLEX); + GET_DATA_METHOD (mxComplexDouble, get_complex_doubles, + mxDOUBLE_CLASS, mxCOMPLEX); + + GET_DATA_METHOD (mxComplexSingle, get_complex_singles, + mxDOUBLE_CLASS, mxCOMPLEX); #if 0 /* We don't have these yet. */ @@ -1558,8 +1560,8 @@ protected: mxArray_matlab (bool interleaved, mxClassID id = mxUNKNOWN_CLASS) - : mxArray_base (interleaved), m_class_name (nullptr), m_id (id), m_ndims (0), - m_dims (nullptr) + : mxArray_base (interleaved), m_class_name (nullptr), m_id (id), + m_ndims (0), m_dims (nullptr) { } mxArray_matlab (bool interleaved, mxClassID id, mwSize ndims, @@ -1609,7 +1611,8 @@ } mxArray_matlab (bool interleaved, mxClassID id, mwSize m, mwSize n) - : mxArray_base (interleaved), m_class_name (nullptr), m_id (id), m_ndims (2), + : mxArray_base (interleaved), m_class_name (nullptr), m_id (id), + m_ndims (2), m_dims (static_cast (mxArray::malloc (m_ndims * sizeof (mwSize)))) { m_dims[0] = m; diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/module.mk --- a/libinterp/corefcn/module.mk Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/module.mk Thu Mar 03 13:37:10 2022 -0500 @@ -231,6 +231,7 @@ %reldir%/ordschur.cc \ %reldir%/pager.cc \ %reldir%/pinv.cc \ + %reldir%/pow2.cc \ %reldir%/pr-flt-fmt.cc \ %reldir%/pr-output.cc \ %reldir%/procstream.cc \ diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/mxarray.h --- a/libinterp/corefcn/mxarray.h Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/mxarray.h Thu Mar 03 13:37:10 2022 -0500 @@ -652,7 +652,8 @@ void set_field_by_number (mwIndex index, int key_num, mxArray *val) { DO_VOID_MUTABLE_METHOD (set_field_by_number (index, key_num, val)); } - int get_number_of_fields (void) const { return m_rep->get_number_of_fields (); } + int get_number_of_fields (void) const + { return m_rep->get_number_of_fields (); } const char * get_field_name_by_number (int key_num) const { DO_MUTABLE_METHOD (const char*, get_field_name_by_number (key_num)); } @@ -668,7 +669,8 @@ mwIndex calc_single_subscript (mwSize nsubs, mwIndex *subs) const { return m_rep->calc_single_subscript (nsubs, subs); } - std::size_t get_element_size (void) const { return m_rep->get_element_size (); } + std::size_t get_element_size (void) const + { return m_rep->get_element_size (); } bool mutation_needed (void) const { return m_rep->mutation_needed (); } diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/oct-errno.in.cc --- a/libinterp/corefcn/oct-errno.in.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/oct-errno.in.cc Thu Mar 03 13:37:10 2022 -0500 @@ -321,7 +321,8 @@ int octave_errno::do_lookup (const std::string& name) { - return (m_errno_tbl.find (name) != m_errno_tbl.end ()) ? m_errno_tbl[name] : -1; + return (m_errno_tbl.find (name) != m_errno_tbl.end ()) ? m_errno_tbl[name] + : -1; } octave_scalar_map diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/oct-hist.cc --- a/libinterp/corefcn/oct-hist.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/oct-hist.cc Thu Mar 03 13:37:10 2022 -0500 @@ -867,7 +867,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} history_timestamp_format_string () @deftypefnx {} {@var{old_val} =} history_timestamp_format_string (@var{new_val}) -@deftypefnx {} {} history_timestamp_format_string (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} history_timestamp_format_string (@var{new_val}, "local") Query or set the internal variable that specifies the format string for the comment line that is written to the history file when Octave exits. @@ -902,7 +902,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} history_save () @deftypefnx {} {@var{old_val} =} history_save (@var{new_val}) -@deftypefnx {} {} history_save (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} history_save (@var{new_val}, "local") Query or set the internal variable that controls whether commands entered on the command line are saved in the history file. diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/oct-map.cc --- a/libinterp/corefcn/oct-map.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/oct-map.cc Thu Mar 03 13:37:10 2022 -0500 @@ -498,8 +498,6 @@ octave_map octave_map::transpose (void) const { - assert (ndims () == 2); - octave_map retval (m_keys); retval.m_dimensions = dim_vector (m_dimensions (1), m_dimensions (0)); @@ -614,7 +612,7 @@ for (octave_idx_type j = 0; j < nf; j++) { retval.m_vals.push_back (Cell (rd)); - assert (retval.m_vals[j].numel () == n); + error_unless (retval.m_vals[j].numel () == n); for (octave_idx_type i = 0; i < n; i++) retval.m_vals[j].xelem (i) = map_list[i].m_vals[j]; } @@ -984,7 +982,8 @@ octave_map octave_map::page (octave_idx_type k) const { - static Array ia (dim_vector (3, 1), octave::idx_vector::colon); + static Array ia (dim_vector (3, 1), + octave::idx_vector::colon); ia(2) = k; return index (ia); @@ -1032,7 +1031,7 @@ error (ee, "incompatible fields in struct assignment"); } - assert (rhs1.m_keys.is_same (m_keys)); + error_unless (rhs1.m_keys.is_same (m_keys)); assign (i, rhs1); } } @@ -1080,7 +1079,7 @@ error (ee, "incompatible fields in struct assignment"); } - assert (rhs1.m_keys.is_same (m_keys)); + error_unless (rhs1.m_keys.is_same (m_keys)); assign (i, j, rhs1); } } @@ -1128,7 +1127,7 @@ error (ee, "incompatible fields in struct assignment"); } - assert (rhs1.m_keys.is_same (m_keys)); + error_unless (rhs1.m_keys.is_same (m_keys)); assign (ia, rhs1); } } diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/oct-stream.cc --- a/libinterp/corefcn/oct-stream.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/oct-stream.cc Thu Mar 03 13:37:10 2022 -0500 @@ -42,7 +42,6 @@ #include "Array.h" #include "Cell.h" #include "byte-swap.h" -#include "lo-cutils.h" #include "lo-ieee.h" #include "lo-mappers.h" #include "lo-utils.h" @@ -50,6 +49,7 @@ #include "octave-preserve-stream-state.h" #include "quit.h" #include "str-vec.h" +#include "strcase-wrappers.h" #include "error.h" #include "errwarn.h" @@ -348,9 +348,9 @@ void add_elt_to_list (int width, bool discard, char type, char modifier, const std::string& char_class = ""); - void process_conversion (const std::string& s, std::size_t& i, std::size_t n, - int& width, bool& discard, char& type, - char& modifier); + void process_conversion (const std::string& s, std::size_t& i, + std::size_t n, int& width, bool& discard, + char& type, char& modifier); int finish_conversion (const std::string& s, std::size_t& i, std::size_t n, int width, bool discard, char& type, @@ -1752,7 +1752,8 @@ int read_first_row (delimited_stream& is, textscan& ts); - std::list out_buf (void) const { return (m_output_container); } + std::list out_buf (void) const + { return (m_output_container); } private: @@ -2850,6 +2851,11 @@ if (i > 0) valid = true; // valid if at least one digit after '.' + else if (! valid) // if there was nothing before and after '.' + { + is.putback (ch); + ch = '.'; + } // skip remainder after '.', to field width, to look for exponent if (i == precision) @@ -2907,7 +2913,7 @@ // Check for +/- inf and NaN if (! valid && width_left >= 3) { - int i = lookahead (is, m_inf_nan, 3, false); // false -> case insensitive + int i = lookahead (is, m_inf_nan, 3, false); // false->case insensitive if (i == 0) { retval = numeric_limits::Inf (); @@ -6044,7 +6050,10 @@ { std::ostream& os = *osp; - os << s; + if (encoding ().compare ("utf-8")) + os << string::u8_to_encoding (who, s, encoding ()); + else + os << s; if (! os) error (who, "write error"); @@ -6592,9 +6601,6 @@ // consistent with the order of the elements in the data_type enum in the // oct_data_conv class. - // Expose this in a future version? - std::size_t char_count = 0; - std::ptrdiff_t tmp_count = 0; try @@ -6657,7 +6663,7 @@ std::ptrdiff_t input_buf_size = static_cast (input_buf_elts) * input_elt_size; - assert (input_buf_size >= 0); + error_if (input_buf_size < 0); // Must also work and return correct type object for 0 elements to read. std::istream *isp = input_stream (); @@ -6698,7 +6704,6 @@ std::size_t gcount = is.gcount (); - char_count += gcount; cur_pos += gcount; octave_idx_type nel = gcount / input_elt_size; diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/oct-stream.h --- a/libinterp/corefcn/oct-stream.h Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/oct-stream.h Thu Mar 03 13:37:10 2022 -0500 @@ -476,7 +476,8 @@ lookup (const octave_value& fid, const std::string& who = "") const; OCTINTERP_API int remove (int fid, const std::string& who = ""); - OCTINTERP_API int remove (const octave_value& fid, const std::string& who = ""); + OCTINTERP_API int remove (const octave_value& fid, + const std::string& who = ""); OCTINTERP_API void clear (bool flush = true); diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/pager.cc --- a/libinterp/corefcn/pager.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/pager.cc Thu Mar 03 13:37:10 2022 -0500 @@ -666,7 +666,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} page_output_immediately () @deftypefnx {} {@var{old_val} =} page_output_immediately (@var{new_val}) -@deftypefnx {} {} page_output_immediately (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} page_output_immediately (@var{new_val}, "local") Query or set the internal variable that controls whether Octave sends output to the pager as soon as it is available. @@ -690,7 +690,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} page_screen_output () @deftypefnx {} {@var{old_val} =} page_screen_output (@var{new_val}) -@deftypefnx {} {} page_screen_output (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} page_screen_output (@var{new_val}, "local") Query or set the internal variable that controls whether output intended for the terminal window that is longer than one page is sent through a pager. @@ -714,7 +714,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} PAGER () @deftypefnx {} {@var{old_val} =} PAGER (@var{new_val}) -@deftypefnx {} {} PAGER (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} PAGER (@var{new_val}, "local") Query or set the internal variable that specifies the program to use to display terminal output on your system. @@ -737,7 +737,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} PAGER_FLAGS () @deftypefnx {} {@var{old_val} =} PAGER_FLAGS (@var{new_val}) -@deftypefnx {} {} PAGER_FLAGS (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} PAGER_FLAGS (@var{new_val}, "local") Query or set the internal variable that specifies the options to pass to the pager. diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/pinv.cc --- a/libinterp/corefcn/pinv.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/pinv.cc Thu Mar 03 13:37:10 2022 -0500 @@ -64,6 +64,9 @@ octave_value arg = args(0); + if (! arg.isnumeric ()) + err_wrong_type_arg ("pinv", arg); + if (arg.isempty ()) return ovl (Matrix ()); @@ -197,6 +200,12 @@ %! y = pinv (x, 2); %! assert (diag (y), [1/3 1/2 0 0 0]'); +## Basic test for integer inputs +%!assert (pinv (int32 (2)), 0.5) +%!assert (pinv (uint32 (2)), 0.5) +%!assert (pinv (int64 (2)), 0.5) +%!assert (pinv (uint64 (2)), 0.5) + ## Test special case of 0 scalars and vectors %!assert (pinv (0), 0) %!assert (pinv ([0, 0, 0]), [0; 0; 0]) @@ -206,6 +215,12 @@ %!assert (pinv (complex ([0,0,0], [0,0,0])), [0; 0; 0]) %!assert (pinv (complex (single (0),0)), single (0)) %!assert (pinv (complex (single ([0,0,0]), [0,0,0])), single ([0; 0; 0])) + +## Test input validation +%!error pinv ("Hello World") +%!error pinv ({1}) +%!error pinv (true) + */ OCTAVE_NAMESPACE_END diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/pow2.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libinterp/corefcn/pow2.cc Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,325 @@ +//////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2022 The Octave Project Developers +// +// See the file COPYRIGHT.md in the top-level directory of this +// distribution or . +// +// 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 +// . +// +//////////////////////////////////////////////////////////////////////// + +#if defined (HAVE_CONFIG_H) +# include "config.h" +#endif + +#include + +#include "lo-array-errwarn.h" + +#include "defun.h" +#include "error.h" +#include "errwarn.h" + +// FIXME: According to cppreference.com the implementation of `ldexp (f, e)` +// might be less efficient that the corresponding `f * exp2 (e)`. Consider +// replacing our implementation with the latter. + +template +void +map_2_xldexp (Array& y, const Array& f, const Array& e) +{ + if (f.numel () == e.numel () || e.numel () == 1) + y = Array (f.dims ()); + else if (f.numel () == 1) + y = Array (e.dims ()); + else + octave::err_nonconformant ("pow2", f.dims (), e.dims ()); + + octave_idx_type f_inc = (f.numel () == 1) ? 0 : 1; + octave_idx_type e_inc = (e.numel () == 1) ? 0 : 1; + + for (octave_idx_type i = 0; i < y.numel (); i++) + y.xelem (i) = std::ldexp (f.xelem (i * f_inc), + static_cast (e.xelem (i * e_inc))); +} + +void +map_2_xldexp_sparse (SparseMatrix& y, const SparseMatrix& f, + const SparseMatrix& e) +{ + if (e.numel () == 1) + { + int ee = static_cast (e.data (0)); + for (octave_idx_type i = 0; i < y.nnz (); i++) + y.data (i) = std::ldexp (f.data (i), ee); + } + else if (f.numel () == e.numel ()) + { + octave_idx_type col = 1; + for (octave_idx_type i = 0; i < y.nnz (); i++) + { + // Determine current column. + while (i >= f.cidx (col)) + col++; + int ee = static_cast (e.xelem (f.ridx (i), col - 1)); + y.data (i) = std::ldexp (f.data (i), ee); + } + } + else + octave::err_nonconformant ("pow2", f.dims (), e.dims ()); +} + +OCTAVE_NAMESPACE_BEGIN + +DEFUN (pow2, args, , + doc: /* -*- texinfo -*- +@deftypefn {} {@var{y} =} pow2 (@var{x}) +@deftypefnx {} {@var{y} =} pow2 (@var{f}, @var{e}) +With one input argument, compute +@tex +$y = 2^x$ +@end tex +@ifnottex +y = 2 .^ x +@end ifnottex +for each element of @var{x}. + +With two input arguments, return +@tex +$y = f \cdot 2^e$, +@end tex +@ifnottex +y = f .* (2 .^ e). +@end ifnottex +where for complex inputs only the real part of both inputs is regarded +and from @var{e} only the real integer part. This calling form corresponds +to C/C++ standard function @code{ldexp()}. +@seealso{log2, nextpow2, power} +@end deftypefn */) +{ + if (args.length () < 1 || args.length () > 2) + print_usage (); + + if (! args(0).isfloat ()) + err_wrong_type_arg ("pow2", args(0)); + + // Call exp2(f) where possible for numerical more accurate results. + if (args.length () == 1) + { + if (args(0).iscomplex ()) + { + // The C++ standard does not define exp2 for complex arguments. + // Therefore call `2.^x`. + octave_value retval = octave::binary_op (octave_value::op_el_pow, + 2, args(0)); + + // Preserve sparse datatype, but even for sparse input fill-up + // is unavoidable `2^0 == 1` thus cast only. + if (args(0).issparse ()) + retval = octave_value (retval.sparse_complex_matrix_value ()); + + return ovl (retval); + } + else if (args(0).is_single_type ()) + { + FloatNDArray x = args(0).float_array_value (); + FloatNDArray y (x.dims ()); + for (octave_idx_type i = 0; i < y.numel (); i++) + y.xelem (i) = std::exp2 (x.xelem (i)); + return ovl (y); + } + else + { + NDArray x = args(0).array_value (); + NDArray y (x.dims ()); + for (octave_idx_type i = 0; i < y.numel (); i++) + y.xelem (i) = std::exp2 (x.xelem (i)); + + // Preserve sparse datatype, but even for sparse input fill-up + // is unavoidable `2^0 == 1` thus cast only. + if (args(0).issparse ()) + return ovl (SparseMatrix (y)); + else + return ovl (y); + } + } + + // For Matlab compatibility, the two argument call `y = pow2 (f, e)` + // corresponds to std::ldexp() (see bug #61968). The resulting y is + // computed quickly by adding the integer part of e to the floating-point + // exponent of f. + + if (! args(1).isfloat ()) + err_wrong_type_arg ("pow2", args(1)); + + if (args(0).iscomplex () || args(1).iscomplex ()) + warning_with_id ("Octave:pow2:imaginary-ignored", + "pow2: imaginary part is ignored"); + + // Note: Matlab R2021a errors on `pow2 (sparse (f), single (e))`, + // but sparsity in f determines output and can significantly + // reduce computation, e.g. `N=1e5; pow2(speye(N),sparse(N,N))`. + if (args(0).issparse ()) + { + SparseMatrix f = args(0).sparse_matrix_value (); + + // Special case: return a sparse zero matrix in size of e. + if ((f.numel () == 1) && (f.nnz () == 0)) + return ovl (SparseMatrix (args(1).rows (), args(1).columns ())); + + // Only do sparse computation, if it pays off. For scalar f fill-up + // is unavoidable even for sparse e because `f * 2^0 == f`. Use dense + // code below in this case. + if (f.numel () > 1) + { + SparseMatrix e = args(1).sparse_matrix_value (); + SparseMatrix y = SparseMatrix (f); + map_2_xldexp_sparse (y, f, e); + return ovl (y); + } + } + + if (args(0).is_single_type () || args(1).is_single_type ()) + { + FloatNDArray f = args(0).float_array_value (); + FloatNDArray e = args(1).float_array_value (); + FloatNDArray y; + map_2_xldexp (y, f, e); + return ovl (y); + } + else + { + NDArray f = args(0).array_value (); + NDArray e = args(1).array_value (); + NDArray y; + map_2_xldexp (y, f, e); + + // Preserve sparse datatype. + // Cases for efficient use of sparsity were treated above already. + if (args(0).issparse ()) + return ovl (SparseMatrix (y)); + else + return ovl (y); + } +} + +/* +## Call `y = pow2 (x)` + +%!test +%! fcns = {@double, @single, @complex}; +%! x = [3, 0, -3]; +%! v = [8, 1, .125]; +%! for i = 1:numel (fcns) +%! fcn = fcns{i}; +%! assert (pow2 (fcn (x)), fcn (v), sqrt (eps)); +%! endfor + +%!test +%! fcns = {@double, @single, @complex, @sparse}; +%! x = [3, 1, -3]; +%! v = [8, 2, .125]; +%! for i = 1:numel (fcns) +%! fcn = fcns{i}; +%! assert (pow2 (fcn (x)), fcn (v), sqrt (eps)); +%! endfor + +%!test +%! fcns = {@double, @single, @complex, @sparse}; +%! x = [1, 1+1i, 1i]; +%! for i = 1:numel (fcns) +%! fcn = fcns{i}; +%! assert (pow2 (fcn (x)), fcn (2) .^ fcn (x), sqrt (eps)); +%! endfor + +## Call `y = pow2 (f, e)` + +%!test +%! fcns = {@double, @single, @complex, @sparse}; +%! f = [2 2]; +%! e = [2 2]; +%! z = [8 8]; +%! warning ("off", "Octave:pow2:imaginary-ignored", "local"); +%! for i = 1:numel (fcns) +%! fcn = fcns{i}; +%! assert (pow2 (fcn (f), fcn (e)), real (fcn (z))); +%! endfor + +## Only integer part is taken into account. +%!test +%! f = 2; +%! e = [2, 2.1, 2.2, 2.4, 2.5, 2.8]; +%! z = 8 .* ones (1, length (e)); +%! assert (pow2 (f, e), z); + +## Only real part is taken into account. +%!test +%! f = [1+1i, 1]; +%! e = 2; +%! z = [4, 4]; +%! warning ("off", "Octave:pow2:imaginary-ignored", "local"); +%! assert (pow2 (f, e), z); + +%!test +%! f = 1; +%! e = [1+1i, 1]; +%! z = [2, 2]; +%! warning ("off", "Octave:pow2:imaginary-ignored", "local"); +%! assert (pow2 (f, e), z); + +%!test +%! f = [1/2, pi/4, -3/4, 1/2, 1-eps()/2, 1/2]; +%! e = [1, 2, 2, -51, 1024, -1021]; +%! z = [1, pi, -3, eps(), realmax(), realmin()]; +%! assert (pow2 (f, e), z); + +## Tests for sparsity. +%!assert (pow2 (sparse (0), ones (3)), sparse (3, 3)); +%!assert (pow2 (sparse (1), ones (3)), 2 .* sparse (ones (3))); +%!assert (pow2 (sparse (1), speye (3)), sparse (ones (3) + eye (3))); +%!assert (pow2 (sparse (3, 3), ones (3)), sparse (3, 3)); +%!assert (pow2 (speye (3), ones (3)), 2 .* speye (3)); +%!assert (pow2 (speye (3), 1), 2 .* speye (3)); + +%!test +%! f = speye (3); +%! e = sparse (3, 3); +%! e(1,1) = 1; +%! e(1,3) = 1; +%! z = f; +%! z(1,1) = 2; +%! assert (pow2 (f, e), z); + +## Large sparse matrix (only few real elements). +%!test +%! ## FIXME: `N = 1e5` would be a better test, but `assert` fills-up somehow. +%! N = 1e3; +%! assert (pow2 (speye (N), sparse (N,N)), speye (N)); +%! assert (pow2 (sparse (0), speye (N)), sparse(N,N)); + +%!error pow2 () +%!error pow2 (1,2,3) +%!error pow2 (int8 (1)) +%!error pow2 (2, int8 (1)) +%!warning pow2 (i, 2); +%!warning pow2 (2, i); +%!error pow2 ([1,2], [3,4,5]) +%!error pow2 (sparse ([1,2]), sparse ([3,4,5])) +*/ + +OCTAVE_NAMESPACE_END diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/pr-flt-fmt.cc --- a/libinterp/corefcn/pr-flt-fmt.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/pr-flt-fmt.cc Thu Mar 03 13:37:10 2022 -0500 @@ -54,7 +54,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} output_precision () @deftypefnx {} {@var{old_val} =} output_precision (@var{new_val}) -@deftypefnx {} {} output_precision (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} output_precision (@var{new_val}, "local") Query or set the internal variable that specifies the minimum number of significant figures to display for numeric output. diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/pr-output.cc --- a/libinterp/corefcn/pr-output.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/pr-output.cc Thu Mar 03 13:37:10 2022 -0500 @@ -300,7 +300,7 @@ pr_max_internal (const MArray& m) { // We expect a 2-d array. - assert (m.ndims () == 2); + error_unless (m.ndims () == 2); octave_idx_type nr = m.rows (); octave_idx_type nc = m.columns (); @@ -680,7 +680,7 @@ static inline float_display_format make_matrix_format (const MT& m) { - assert (m.ndims () == 2); + error_unless (m.ndims () == 2); if (free_format) return float_display_format (); @@ -1570,7 +1570,7 @@ print_empty_matrix (std::ostream& os, octave_idx_type nr, octave_idx_type nc, bool pr_as_read_syntax) { - assert (nr == 0 || nc == 0); + error_unless (nr == 0 || nc == 0); if (pr_as_read_syntax) { @@ -1592,7 +1592,7 @@ print_empty_nd_array (std::ostream& os, const dim_vector& dims, bool pr_as_read_syntax) { - assert (dims.any_zero ()); + error_unless (dims.any_zero ()); if (pr_as_read_syntax) os << "zeros (" << dims.str (',') << ')'; @@ -2558,7 +2558,8 @@ octave_idx_type col = 0; while (col < num_elem) { - octave_idx_type lim = (col + inc < num_elem ? col + inc : num_elem); + octave_idx_type lim = (col + inc < num_elem ? col + inc + : num_elem); pr_col_num_header (os, total_width, max_width, lim, col, extra_indent); @@ -2917,7 +2918,7 @@ } #define PRINT_INT_SCALAR_INTERNAL(TYPE) \ - OCTINTERP_API void \ + void \ octave_print_internal (std::ostream& os, \ const float_display_format& fmt, \ const octave_int& val, bool dummy) \ @@ -4059,7 +4060,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} fixed_point_format () @deftypefnx {} {@var{old_val} =} fixed_point_format (@var{new_val}) -@deftypefnx {} {} fixed_point_format (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} fixed_point_format (@var{new_val}, "local") Query or set the internal variable that controls whether Octave will use a scaled format to print matrix values. @@ -4102,7 +4103,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} print_empty_dimensions () @deftypefnx {} {@var{old_val} =} print_empty_dimensions (@var{new_val}) -@deftypefnx {} {} print_empty_dimensions (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} print_empty_dimensions (@var{new_val}, "local") Query or set the internal variable that controls whether the dimensions of empty matrices are printed along with the empty matrix symbol, @samp{[]}. @@ -4133,7 +4134,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} split_long_rows () @deftypefnx {} {@var{old_val} =} split_long_rows (@var{new_val}) -@deftypefnx {} {} split_long_rows (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} split_long_rows (@var{new_val}, "local") Query or set the internal variable that controls whether rows of a matrix may be split when displayed to a terminal window. diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/psi.cc --- a/libinterp/corefcn/psi.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/psi.cc Thu Mar 03 13:37:10 2022 -0500 @@ -179,7 +179,8 @@ ## Interesting identities of the digamma function, in section of 5.1.3 %!assert (psi (1/3), - em - (3/2) * log (3) - ((sqrt (3) / 6) * pi), eps*10) %!assert (psi (1/4), - em -3 * log (2) - pi/2, eps*10) -%!assert (psi (1/6), - em -2 * log (2) - (3/2) * log (3) - ((sqrt (3) / 2) * pi), eps*10) +%!assert (psi (1/6), +%! - em -2 * log (2) - (3/2) * log (3) - ((sqrt (3) / 2) * pi), eps*10) ## First 6 zeros of the digamma function, in section of 5.1.5 (and also on ## Abramowitz and Stegun, page 258, eq 6.3.19) diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/qr.cc --- a/libinterp/corefcn/qr.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/qr.cc Thu Mar 03 13:37:10 2022 -0500 @@ -1417,14 +1417,16 @@ %! [Q,R] = qrupdate (Q, R, single (u), single (v)); %! assert (norm (vec (Q'*Q - eye (5,"single")), Inf) < 1e1*eps ("single")); %! assert (norm (vec (triu (R)-R), Inf) == 0); -%! assert (norm (vec (Q*R - single (A) - single (u)*single (v)'), Inf) < norm (single (A))*1e1*eps ("single")); +%! assert (norm (vec (Q*R - single (A) - single (u)*single (v)'), Inf) +%! < norm (single (A))*1e1*eps ("single")); %! %!test %! [Q,R] = qr (single (Ac)); %! [Q,R] = qrupdate (Q, R, single (uc), single (vc)); %! assert (norm (vec (Q'*Q - eye (5,"single")), Inf) < 1e1*eps ("single")); %! assert (norm (vec (triu (R)-R), Inf) == 0); -%! assert (norm (vec (Q*R - single (Ac) - single (uc)*single (vc)'), Inf) < norm (single (Ac))*1e1*eps ("single")); +%! assert (norm (vec (Q*R - single (Ac) - single (uc)*single (vc)'), Inf) +%! < norm (single (Ac))*1e1*eps ("single")); */ DEFUN (qrinsert, args, , @@ -1599,13 +1601,15 @@ %! [Q,R] = qrinsert (Q, R, 3, single (u)); %! assert (norm (vec (Q'*Q - eye (5,"single")), Inf) < 1e1*eps ("single")); %! assert (norm (vec (triu (R) - R), Inf) == 0); -%! assert (norm (vec (Q*R - single ([A(:,1:2) u A(:,3)])), Inf) < norm (single (A))*1e1*eps ("single")); +%! assert (norm (vec (Q*R - single ([A(:,1:2) u A(:,3)])), Inf) +%! < norm (single (A))*1e1*eps ("single")); %!test %! [Q,R] = qr (single (Ac)); %! [Q,R] = qrinsert (Q, R, 3, single (uc)); %! assert (norm (vec (Q'*Q - eye (5,"single")), Inf) < 1e1*eps ("single")); %! assert (norm (vec (triu (R) - R), Inf) == 0); -%! assert (norm (vec (Q*R - single ([Ac(:,1:2) uc Ac(:,3)])), Inf) < norm (single (Ac))*1e1*eps ("single")); +%! assert (norm (vec (Q*R - single ([Ac(:,1:2) uc Ac(:,3)])), Inf) +%! < norm (single (Ac))*1e1*eps ("single")); %!test %! x = single ([0.85082 0.76426 0.42883 ]); %! @@ -1613,7 +1617,8 @@ %! [Q,R] = qrinsert (Q, R, 3, x, "row"); %! assert (norm (vec (Q'*Q - eye (6,"single")), Inf) < 1e1*eps ("single")); %! assert (norm (vec (triu (R) - R), Inf) == 0); -%! assert (norm (vec (Q*R - single ([A(1:2,:);x;A(3:5,:)])), Inf) < norm (single (A))*1e1*eps ("single")); +%! assert (norm (vec (Q*R - single ([A(1:2,:);x;A(3:5,:)])), Inf) +%! < norm (single (A))*1e1*eps ("single")); %!test %! x = single ([0.20351 + 0.05401i 0.13141 + 0.43708i 0.29808 + 0.08789i ]); %! @@ -1621,7 +1626,8 @@ %! [Q,R] = qrinsert (Q, R, 3, x, "row"); %! assert (norm (vec (Q'*Q - eye (6,"single")), Inf) < 1e1*eps ("single")); %! assert (norm (vec (triu (R) - R), Inf) == 0); -%! assert (norm (vec (Q*R - single ([Ac(1:2,:);x;Ac(3:5,:)])), Inf) < norm (single (Ac))*1e1*eps ("single")); +%! assert (norm (vec (Q*R - single ([Ac(1:2,:);x;Ac(3:5,:)])), Inf) +%! < norm (single (Ac))*1e1*eps ("single")); */ DEFUN (qrdelete, args, , @@ -1815,7 +1821,8 @@ %! [Q,R] = qrdelete (Q, R, 3); %! assert (norm (vec (Q'*Q - eye (5,"single")), Inf) < 1e1*eps ("single")); %! assert (norm (vec (triu (R) - R), Inf) == 0); -%! assert (norm (vec (Q*R - [AA(:,1:2) AA(:,4)]), Inf) < norm (AA)*1e1*eps ("single")); +%! assert (norm (vec (Q*R - [AA(:,1:2) AA(:,4)]), Inf) +%! < norm (AA)*1e1*eps ("single")); %! %!test %! AA = single ([0.364554 + 0.993117i 0.669818 + 0.510234i 0.426568 + 0.041337i 0.847051 + 0.233291i; @@ -1828,8 +1835,9 @@ %! [Q,R] = qrdelete (Q, R, 3); %! assert (norm (vec (Q'*Q - eye (5,"single")), Inf) < 1e1*eps ("single")); %! assert (norm (vec (triu (R) - R), Inf) == 0); -%! assert (norm (vec (Q*R - [AA(:,1:2) AA(:,4)]), Inf) < norm (AA)*1e1*eps ("single")); -%! +%! assert (norm (vec (Q*R - [AA(:,1:2) AA(:,4)]), Inf) +%! < norm (AA)*1e1*eps ("single")); + %!test %! AA = single ([0.091364 0.613038 0.027504 0.999083; %! 0.594638 0.425302 0.562834 0.603537; @@ -1841,7 +1849,8 @@ %! [Q,R] = qrdelete (Q, R, 3, "row"); %! assert (norm (vec (Q'*Q - eye (4,"single")), Inf) < 1.5e1*eps ("single")); %! assert (norm (vec (triu (R) - R), Inf) == 0); -%! assert (norm (vec (Q*R - [AA(1:2,:);AA(4:5,:)]), Inf) < norm (AA)*1e1*eps ("single")); +%! assert (norm (vec (Q*R - [AA(1:2,:);AA(4:5,:)]), Inf) +%! < norm (AA)*1e1*eps ("single")); %!testif HAVE_QRUPDATE %! ## Same test as above but with more precicision %! AA = single ([0.091364 0.613038 0.027504 0.999083; @@ -1854,7 +1863,8 @@ %! [Q,R] = qrdelete (Q, R, 3, "row"); %! assert (norm (vec (Q'*Q - eye (4,"single")), Inf) < 1e1*eps ("single")); %! assert (norm (vec (triu (R) - R), Inf) == 0); -%! assert (norm (vec (Q*R - [AA(1:2,:);AA(4:5,:)]), Inf) < norm (AA)*1e1*eps ("single")); +%! assert (norm (vec (Q*R - [AA(1:2,:);AA(4:5,:)]), Inf) +%! < norm (AA)*1e1*eps ("single")); %! %!test %! AA = single ([0.364554 + 0.993117i 0.669818 + 0.510234i 0.426568 + 0.041337i 0.847051 + 0.233291i; @@ -1867,7 +1877,8 @@ %! [Q,R] = qrdelete (Q, R, 3, "row"); %! assert (norm (vec (Q'*Q - eye (4,"single")), Inf) < 1e1*eps ("single")); %! assert (norm (vec (triu (R) - R), Inf) == 0); -%! assert (norm (vec (Q*R - [AA(1:2,:);AA(4:5,:)]), Inf) < norm (AA)*1e1*eps ("single")); +%! assert (norm (vec (Q*R - [AA(1:2,:);AA(4:5,:)]), Inf) +%! < norm (AA)*1e1*eps ("single")); */ DEFUN (qrshift, args, , diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/rand.cc --- a/libinterp/corefcn/rand.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/rand.cc Thu Mar 03 13:37:10 2022 -0500 @@ -797,7 +797,7 @@ /* %!test %! randg ("state", 12); -%! assert (randg ([-inf, -1, 0, inf, nan]), [nan, nan, nan, nan, nan]); # *** Please report +%! assert (randg ([-inf, -1, 0, inf, nan]), [nan, nan, nan, nan, nan]); %!test %! ## Test a known fixed state @@ -902,7 +902,7 @@ %! endif %!test %! randg ("seed", 12); -%!assert (randg ([-inf, -1, 0, inf, nan]), [nan, nan, nan, nan, nan]) # *** Please report +%! assert (randg ([-inf, -1, 0, inf, nan]), [nan, nan, nan, nan, nan]); %!test %! if (__random_statistical_tests__) %! ## statistical tests may fail occasionally. @@ -1022,7 +1022,7 @@ /* %!test %! randp ("state", 12); -%! assert (randp ([-inf, -1, 0, inf, nan]), [nan, nan, 0, nan, nan]); # *** Please report +%! assert (randp ([-inf, -1, 0, inf, nan]), [nan, nan, 0, nan, nan]); %!test %! ## Test a known fixed state %! randp ("state", 1); @@ -1034,7 +1034,9 @@ %!test %! ## Test a known fixed state %! randp ("state", 1); -%! assert (randp (1e9, 1, 6), [999915677 999976657 1000047684 1000019035 999985749 999977692], -1e-6); +%! assert (randp (1e9, 1, 6), +%! [999915677 999976657 1000047684 1000019035 999985749 999977692], +%! -1e-6); %!test %! ## Test a known fixed seed %! randp ("seed", 1); @@ -1047,7 +1049,9 @@ %!test %! ## Test a known fixed seed %! randp ("seed", 1); -%! assert (randp (1e9, 1, 6), [1000006208 1000012224 999981120 999963520 999963072 999981440], -1e-6); +%! assert (randp (1e9, 1, 6), +%! [1000006208 1000012224 999981120 999963520 999963072 999981440], +%! -1e-6); %!test %! if (__random_statistical_tests__) %! ## statistical tests may fail occasionally. @@ -1076,7 +1080,7 @@ %! endif %!test %! randp ("seed", 12); -%! assert (randp ([-inf, -1, 0, inf, nan]), [nan, nan, 0, nan, nan]); # *** Please report +%! assert (randp ([-inf, -1, 0, inf, nan]), [nan, nan, 0, nan, nan]); %!test %! if (__random_statistical_tests__) %! ## statistical tests may fail occasionally. diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/regexp.cc --- a/libinterp/corefcn/regexp.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/regexp.cc Thu Mar 03 13:37:10 2022 -0500 @@ -1127,8 +1127,10 @@ %! assert (isempty (fieldnames (nm))); %! assert (sp, { "", "", "A", "", "E", "" }); -%!assert (regexp ({'asdfg-dfd';'-dfd-dfd-';'qasfdfdaq'}, '-'), {6;[1,5,9];zeros(1,0)}) -%!assert (regexp ({'asdfg-dfd';'-dfd-dfd-';'qasfdfdaq'}, {'-';'f';'q'}), {6;[3,7];[1,9]}) +%!assert (regexp ({'asdfg-dfd';'-dfd-dfd-';'qasfdfdaq'}, '-'), +%! {6;[1,5,9];zeros(1,0)}) +%!assert (regexp ({'asdfg-dfd';'-dfd-dfd-';'qasfdfdaq'}, {'-';'f';'q'}), +%! {6;[3,7];[1,9]}) %!assert (regexp ('Strings', {'t','s'}), {2, 7}) ## Test case for lookaround operators @@ -1351,9 +1353,12 @@ %!error regexpi ('string', 'tri', 'BadArg') %!error regexpi ('string') -%!assert (regexpi ({'asdfg-dfd';'-dfd-dfd-';'qasfdfdaq'}, '-'), {6;[1,5,9];zeros(1, 0)}) -%!assert (regexpi ({'asdfg-dfd', '-dfd-dfd-', 'qasfdfdaq'}, '-'), {6, [1,5,9], zeros(1,0)}) -%!assert (regexpi ({'asdfg-dfd';'-dfd-dfd-';'qasfdfdaq'}, {'-';'f';'q'}), {6;[3,7];[1,9]}) +%!assert (regexpi ({'asdfg-dfd';'-dfd-dfd-';'qasfdfdaq'}, '-'), +%! {6;[1,5,9];zeros(1, 0)}) +%!assert (regexpi ({'asdfg-dfd', '-dfd-dfd-', 'qasfdfdaq'}, '-'), +%! {6, [1,5,9], zeros(1,0)}) +%!assert (regexpi ({'asdfg-dfd';'-dfd-dfd-';'qasfdfdaq'}, {'-';'f';'q'}), +%! {6;[3,7];[1,9]}) %!assert (regexpi ('Strings', {'t', 's'}), {2, [1, 7]}) %!assert (regexpi ("\n", '\n'), 1) @@ -1588,7 +1593,8 @@ ## Empty matches were broken on ARM architecture %!test <*52810> -%! assert (strcmp (regexprep ("\nabc", "^(\t*)(abc)$", "$1$2", "lineanchors"), "\nabc")) +%! assert (strcmp (regexprep ("\nabc", "^(\t*)(abc)$", "$1$2", "lineanchors"), +%! "\nabc")); */ OCTAVE_NAMESPACE_END diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/schur.cc --- a/libinterp/corefcn/schur.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/schur.cc Thu Mar 03 13:37:10 2022 -0500 @@ -46,7 +46,7 @@ octave_value retval = a; octave_idx_type n = a.rows (); - assert (a.columns () == n); + error_unless (a.columns () == n); const typename Matrix::element_type zero = typename Matrix::element_type (); diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/sighandlers.cc --- a/libinterp/corefcn/sighandlers.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/sighandlers.cc Thu Mar 03 13:37:10 2022 -0500 @@ -517,7 +517,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} debug_on_interrupt () @deftypefnx {} {@var{old_val} =} debug_on_interrupt (@var{new_val}) -@deftypefnx {} {} debug_on_interrupt (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} debug_on_interrupt (@var{new_val}, "local") Query or set the internal variable that controls whether Octave will try to enter debugging mode when it receives an interrupt signal (typically generated with @kbd{C-c}). @@ -551,7 +551,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} sighup_dumps_octave_core () @deftypefnx {} {@var{old_val} =} sighup_dumps_octave_core (@var{new_val}) -@deftypefnx {} {} sighup_dumps_octave_core (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} sighup_dumps_octave_core (@var{new_val}, "local") Query or set the internal variable that controls whether Octave tries to save all current variables to the file @file{octave-workspace} if it receives a hangup signal. @@ -582,7 +582,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} sigquit_dumps_octave_core () @deftypefnx {} {@var{old_val} =} sigquit_dumps_octave_core (@var{new_val}) -@deftypefnx {} {} sigquit_dumps_octave_core (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} sigquit_dumps_octave_core (@var{new_val}, "local") Query or set the internal variable that controls whether Octave tries to save all current variables to the file @file{octave-workspace} if it receives a quit signal. @@ -613,7 +613,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} sigterm_dumps_octave_core () @deftypefnx {} {@var{old_val} =} sigterm_dumps_octave_core (@var{new_val}) -@deftypefnx {} {} sigterm_dumps_octave_core (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} sigterm_dumps_octave_core (@var{new_val}, "local") Query or set the internal variable that controls whether Octave tries to save all current variables to the file @file{octave-workspace} if it receives a terminate signal. diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/sparse-xdiv.h --- a/libinterp/corefcn/sparse-xdiv.h Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/sparse-xdiv.h Thu Mar 03 13:37:10 2022 -0500 @@ -157,7 +157,8 @@ OCTAVE_DEPRECATED (7, "use 'octave::xdiv' instead") inline SparseComplexMatrix -xdiv (const SparseComplexMatrix& a, const SparseComplexMatrix& b, MatrixType& typ) +xdiv (const SparseComplexMatrix& a, const SparseComplexMatrix& b, + MatrixType& typ) { return octave::xdiv (a, b, typ); } @@ -269,7 +270,8 @@ OCTAVE_DEPRECATED (7, "use 'octave::xleftdiv' instead") inline SparseComplexMatrix -xleftdiv (const SparseComplexMatrix& a, const SparseComplexMatrix& b, MatrixType& typ) +xleftdiv (const SparseComplexMatrix& a, const SparseComplexMatrix& b, + MatrixType& typ) { return octave::xleftdiv (a, b, typ); } @@ -297,7 +299,8 @@ OCTAVE_DEPRECATED (7, "use 'octave::xleftdiv' instead") inline SparseComplexMatrix -xleftdiv (const ComplexDiagMatrix& a, const SparseComplexMatrix& b, MatrixType& typ) +xleftdiv (const ComplexDiagMatrix& a, const SparseComplexMatrix& b, + MatrixType& typ) { return octave::xleftdiv (a, b, typ); } diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/sparse.cc --- a/libinterp/corefcn/sparse.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/sparse.cc Thu Mar 03 13:37:10 2022 -0500 @@ -46,7 +46,7 @@ DEFUN (issparse, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} issparse (@var{x}) +@deftypefn {} {@var{tf} =} issparse (@var{x}) Return true if @var{x} is a sparse matrix. @seealso{ismatrix} @end deftypefn */) @@ -155,9 +155,6 @@ octave_value retval; - // Temporarily disable sparse_auto_mutate if set (it's obsolete anyway). - unwind_protect_var restore_var (Vsparse_auto_mutate, false); - if (nargin == 1) { octave_value arg = args(0); diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/stack-frame.cc --- a/libinterp/corefcn/stack-frame.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/stack-frame.cc Thu Mar 03 13:37:10 2022 -0500 @@ -31,6 +31,7 @@ #include "str-vec.h" #include "defun.h" +#include "error.h" #include "interpreter.h" #include "interpreter-private.h" #include "oct-map.h" @@ -1041,7 +1042,8 @@ const std::shared_ptr& parent_link, const std::shared_ptr& static_link) { - return new compiled_fcn_stack_frame (tw, fcn, index, parent_link, static_link); + return new compiled_fcn_stack_frame (tw, fcn, index, + parent_link, static_link); } stack_frame * stack_frame::create (tree_evaluator& tw, @@ -1059,7 +1061,8 @@ const std::shared_ptr& static_link, const std::shared_ptr& access_link) { - return new user_fcn_stack_frame (tw, fcn, index, parent_link, static_link, access_link); + return new user_fcn_stack_frame (tw, fcn, index, + parent_link, static_link, access_link); } stack_frame * stack_frame::create (tree_evaluator& tw, @@ -1069,7 +1072,9 @@ const local_vars_map& local_vars, const std::shared_ptr& access_link) { - return new user_fcn_stack_frame (tw, fcn, index, parent_link, static_link, local_vars, access_link); + return new user_fcn_stack_frame (tw, fcn, index, + parent_link, static_link, local_vars, + access_link); } stack_frame * stack_frame::create (tree_evaluator& tw, @@ -1599,7 +1604,7 @@ // scope. If the symbol wasn't present before, it should be outside // the range so we need to resize then update offsets. - assert (data_offset >= size ()); + panic_unless (data_offset >= size ()); resize (data_offset+1); @@ -1650,7 +1655,7 @@ if (sym) { - assert (sym.frame_offset () == 0); + panic_unless (sym.frame_offset () == 0); return sym; } @@ -1679,7 +1684,7 @@ // All symbol records in a script scope should have zero offset, // which means we redirect our lookup using // lexical_frame_offsets and values_offets. - assert (sym.frame_offset () == 0); + panic_unless (sym.frame_offset () == 0); return sym; } @@ -1689,7 +1694,7 @@ sym = scope.find_symbol (name); - assert (sym); + panic_unless (sym.is_valid ()); resize_and_update_script_offsets (sym); @@ -2100,7 +2105,7 @@ { // FIXME: do we need to ensure that the called // function is a child of the caller? Does it hurt - // to assert this condition, at least for now? + // to panic_unless this condition, at least for now? alink = static_link; } @@ -2108,7 +2113,7 @@ { // FIXME: do we need to check that the parent of the // called function is also a parent of the caller? - // Does it hurt to assert this condition, at least + // Does it hurt to panic_unless this condition, at least // for now? int links_to_follow = caller_nesting_depth - nesting_depth + 1; @@ -2221,7 +2226,7 @@ sym = scope.find_symbol (name); - assert (sym); + panic_unless (sym.is_valid ()); return sym; } @@ -2388,7 +2393,7 @@ sym = m_scope.find_symbol (name); - assert (sym); + panic_unless (sym.is_valid ()); return sym; } diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/strfind.cc --- a/libinterp/corefcn/strfind.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/strfind.cc Thu Mar 03 13:37:10 2022 -0500 @@ -299,8 +299,10 @@ %!assert (strfind ("abababa", "aba", "forcecelloutput", false), [1, 3, 5]) %!assert (strfind ("abababa", "aba", "forcecelloutput", true), {[1, 3, 5]}) %!assert (strfind ({"abababa", "bla", "bla"}, "a"), {[1, 3, 5, 7], 3, 3}) -%!assert (strfind ({"abababa", "bla", "bla"}, "a", "forcecelloutput", false), {[1, 3, 5, 7], 3, 3}) -%!assert (strfind ({"abababa", "bla", "bla"}, "a", "forcecelloutput", true), {[1, 3, 5, 7], 3, 3}) +%!assert (strfind ({"abababa", "bla", "bla"}, "a", "forcecelloutput", false), +%! {[1, 3, 5, 7], 3, 3}) +%!assert (strfind ({"abababa", "bla", "bla"}, "a", "forcecelloutput", true), +%! {[1, 3, 5, 7], 3, 3}) %!assert (strfind ("Linux _is_ user-friendly. It just isn't ignorant-friendly or idiot-friendly.", "friendly"), [17, 50, 68]) %!assert (strfind ("abc", ""), []) %!assert (strfind ("abc", {"", "b", ""}), {[], 2, []}) diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/strfns.cc --- a/libinterp/corefcn/strfns.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/strfns.cc Thu Mar 03 13:37:10 2022 -0500 @@ -290,7 +290,7 @@ DEFUN (ischar, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} ischar (@var{x}) +@deftypefn {} {@var{tf} =} ischar (@var{x}) Return true if @var{x} is a character array. @seealso{isfloat, isinteger, islogical, isnumeric, isstring, iscellstr, isa} @end deftypefn */) @@ -665,7 +665,8 @@ %!assert (strncmp ("abce", {"abcd", "bca", "abc"}, 3), logical ([1, 0, 1])) %!assert (strncmp ("abc", {"abcd", "bca", "abc"}, 4), logical ([0, 0, 1])) %!assert (strncmp ({"abcd", "bca", "abc"},"abce", 3), logical ([1, 0, 1])) -%!assert (strncmp ({"abcd", "bca", "abc"},{"abcd", "bca", "abe"}, 3), logical ([1, 1, 0])) +%!assert (strncmp ({"abcd", "bca", "abc"},{"abcd", "bca", "abe"}, 3), +%! logical ([1, 1, 0])) %!assert (strncmp ("abc", {"abcd", 10}, 2), logical ([1, 0])) %!assert <*54373> (strncmp ("abc", "abc", 100)) diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/svd.cc --- a/libinterp/corefcn/svd.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/svd.cc Thu Mar 03 13:37:10 2022 -0500 @@ -400,7 +400,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} svd_driver () @deftypefnx {} {@var{old_val} =} svd_driver (@var{new_val}) -@deftypefnx {} {} svd_driver (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} svd_driver (@var{new_val}, "local") Query or set the underlying @sc{lapack} driver used by @code{svd}. Currently recognized values are @qcode{"gesdd"}, @qcode{"gesvd"}, and diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/sylvester.cc --- a/libinterp/corefcn/sylvester.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/sylvester.cc Thu Mar 03 13:37:10 2022 -0500 @@ -158,8 +158,10 @@ } /* -%!assert (sylvester ([1, 2; 3, 4], [5, 6; 7, 8], [9, 10; 11, 12]), [1/2, 2/3; 2/3, 1/2], sqrt (eps)) -%!assert (sylvester (single ([1, 2; 3, 4]), single ([5, 6; 7, 8]), single ([9, 10; 11, 12])), single ([1/2, 2/3; 2/3, 1/2]), sqrt (eps ("single"))) +%!assert (sylvester ([1, 2; 3, 4], [5, 6; 7, 8], [9, 10; 11, 12]), +%! [1/2, 2/3; 2/3, 1/2], sqrt (eps)) +%!assert (sylvester (single ([1, 2; 3, 4]), single ([5, 6; 7, 8]), single ([9, 10; 11, 12])), +%! single ([1/2, 2/3; 2/3, 1/2]), sqrt (eps ("single"))) ## Test input validation %!error sylvester () diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/symbfact.cc --- a/libinterp/corefcn/symbfact.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/symbfact.cc Thu Mar 03 13:37:10 2022 -0500 @@ -427,7 +427,8 @@ %! fail ("symbfact (sparse (1), {1})", "TYP must be a string"); %! fail ("symbfact (sparse (1), 'foobar')", 'unrecognized TYP "foobar"'); %! fail ("symbfact (sparse (1), 'sym', {'L'})", "MODE must be a string"); -%! fail ('symbfact (sparse (1), "sym", "foobar")', 'unrecognized MODE "foobar"'); +%! fail ('symbfact (sparse (1), "sym", "foobar")', +%! 'unrecognized MODE "foobar"'); %! fail ("symbfact (sparse ([1, 2; 3, 4; 5, 6]))", "S must be a square matrix"); */ diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/symrec.h --- a/libinterp/corefcn/symrec.h Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/symrec.h Thu Mar 03 13:37:10 2022 -0500 @@ -194,11 +194,13 @@ explicit operator bool () const { return is_valid (); } - void set_frame_offset (std::size_t offset) { m_rep->set_frame_offset (offset); } + void set_frame_offset (std::size_t offset) + { m_rep->set_frame_offset (offset); } std::size_t frame_offset (void) const { return m_rep->frame_offset (); } - void set_data_offset (std::size_t offset) { m_rep->set_data_offset (offset); } + void set_data_offset (std::size_t offset) + { m_rep->set_data_offset (offset); } std::size_t data_offset (void) const { return m_rep->data_offset (); } diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/symscope.cc --- a/libinterp/corefcn/symscope.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/symscope.cc Thu Mar 03 13:37:10 2022 -0500 @@ -335,7 +335,8 @@ } bool symbol_scope_rep::look_nonlocal (const std::string& name, - std::size_t offset, symbol_record& result) + std::size_t offset, + symbol_record& result) { offset++; diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/symtab.cc --- a/libinterp/corefcn/symtab.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/symtab.cc Thu Mar 03 13:37:10 2022 -0500 @@ -722,98 +722,6 @@ return octave_value (info_map); } - // Remove when corresponding public deprecated function is removed. - bool symbol_table::at_top_level_deprecated (void) - { - return m_interpreter.at_top_level (); - } - - // Remove when corresponding public deprecated function is removed. - octave_value symbol_table::varval_deprecated (const std::string& name) const - { - return m_interpreter.varval (name); - } - - // Remove when corresponding public deprecated function is removed. - octave_value symbol_table::global_varval_deprecated (const std::string& name) const - { - return m_interpreter.global_varval (name); - } - - // Remove when corresponding public deprecated function is removed. - octave_value symbol_table::top_level_varval_deprecated (const std::string& name) const - { - return m_interpreter.top_level_varval (name); - } - - // Remove when corresponding public deprecated function is removed. - std::list symbol_table::global_variable_names_deprecated (void) - { - return m_interpreter.global_variable_names (); - } - - // Remove when corresponding public deprecated function is removed. - std::list symbol_table::top_level_variable_names_deprecated (void) - { - return m_interpreter.top_level_variable_names (); - } - - // Remove when corresponding public deprecated function is removed. - std::list symbol_table::variable_names_deprecated (void) - { - return m_interpreter.variable_names (); - } - - // Remove when corresponding public deprecated function is removed. - void symbol_table::assign_deprecated (const std::string& name, const octave_value& value) - { - return m_interpreter.assign (name, value); - } - - // Remove when corresponding public deprecated function is removed. - void symbol_table::clear_all_deprecated (bool force) - { - return m_interpreter.clear_all (force); - } - - // Remove when corresponding public deprecated function is removed. - void symbol_table::clear_global_deprecated (const std::string& name) - { - return m_interpreter.clear_global_variable (name); - } - - // Remove when corresponding public deprecated function is removed. - void symbol_table::clear_global_pattern_deprecated (const std::string& pattern) - { - return m_interpreter.clear_global_variable_pattern (pattern); - } - - // Remove when corresponding public deprecated function is removed. - void symbol_table::clear_symbol_deprecated (const std::string& name) - { - return m_interpreter.clear_symbol (name); - } - - // Remove when corresponding public deprecated function is removed. - void symbol_table::clear_symbol_pattern_deprecated (const std::string& pattern) - { - return m_interpreter.clear_symbol_pattern (pattern); - } - - // Remove when corresponding public deprecated function is removed. - void symbol_table::global_assign_deprecated (const std::string& name, - const octave_value& value) - { - return m_interpreter.global_assign (name, value); - } - - // Remove when corresponding public deprecated function is removed. - void symbol_table::top_level_assign_deprecated (const std::string& name, - const octave_value& value) - { - return m_interpreter.top_level_assign (name, value); - } - DEFMETHOD (__dump_symtab_info__, interp, args, , doc: /* -*- texinfo -*- @deftypefn {} {} __dump_symtab_info__ () diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/symtab.h --- a/libinterp/corefcn/symtab.h Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/symtab.h Thu Mar 03 13:37:10 2022 -0500 @@ -185,170 +185,6 @@ fcn_info * get_fcn_info (const std::string& name); - // The remaining functions are all provided for backward - // compatibility. New code should use the functions provided by the - // interpreter class. - - private: - - // Remove when corresponding public deprecated function is removed. - bool at_top_level_deprecated (void); - - // Remove when corresponding public deprecated function is removed. - octave_value varval_deprecated (const std::string& name) const; - - // Remove when corresponding public deprecated function is removed. - octave_value global_varval_deprecated (const std::string& name) const; - - // Remove when corresponding public deprecated function is removed. - octave_value top_level_varval_deprecated (const std::string& name) const; - - // Remove when corresponding public deprecated function is removed. - std::list global_variable_names_deprecated (void); - - // Remove when corresponding public deprecated function is removed. - std::list top_level_variable_names_deprecated (void); - - // Remove when corresponding public deprecated function is removed. - std::list variable_names_deprecated (void); - - // Remove when corresponding public deprecated function is removed. - void assign_deprecated (const std::string& name, - const octave_value& value = octave_value ()); - - // Remove when corresponding public deprecated function is removed. - // Note, FORCE_ADD no longer has any meaning. - void assign_deprecated (const std::string& name, const octave_value& value, - bool /*force_add*/); - - // Remove when corresponding public deprecated function is removed. - void clear_all_deprecated (bool force = false); - - // Remove when corresponding public deprecated function is removed. - void clear_global_deprecated (const std::string& name); - - // Remove when corresponding public deprecated function is removed. - void clear_global_pattern_deprecated (const std::string& pattern); - - // Remove when corresponding public deprecated function is removed. - void clear_symbol_deprecated (const std::string& name); - - // Remove when corresponding public deprecated function is removed. - void clear_symbol_pattern_deprecated (const std::string& pattern); - - // Remove when corresponding public deprecated function is removed. - void global_assign_deprecated (const std::string& name, - const octave_value& value = octave_value ()); - - // Remove when corresponding public deprecated function is removed. - void top_level_assign_deprecated (const std::string& name, - const octave_value& value = octave_value ()); - - public: - -#if defined (OCTAVE_PROVIDE_DEPRECATED_SYMBOLS) - OCTAVE_DEPRECATED (6, "use 'interpreter::at_top_level' instead") - bool at_top_level (void) - { - return at_top_level_deprecated (); - } - - OCTAVE_DEPRECATED (6, "use 'interpreter::varval' instead") - octave_value varval (const std::string& name) const - { - return varval_deprecated (name); - } - - OCTAVE_DEPRECATED (6, "use 'interpreter::global_varval' instead") - octave_value global_varval (const std::string& name) const - { - return global_varval_deprecated (name); - } - - OCTAVE_DEPRECATED (6, "use 'interpreter::top_level_varval' instead") - octave_value top_level_varval (const std::string& name) const - { - return top_level_varval_deprecated (name); - } - - OCTAVE_DEPRECATED (6, "use 'interpreter::global_variable_names' instead") - std::list global_variable_names (void) - { - return global_variable_names_deprecated (); - } - - OCTAVE_DEPRECATED (6, "use 'interpreter::top_level_variable_names' instead") - std::list top_level_variable_names (void) - { - return top_level_variable_names_deprecated (); - } - - OCTAVE_DEPRECATED (6, "use 'interpreter::variable_names' instead") - std::list variable_names (void) - { - return variable_names_deprecated (); - } - - OCTAVE_DEPRECATED (6, "use 'interpreter::assign' instead") - void assign (const std::string& name, - const octave_value& value = octave_value ()) - { - assign_deprecated (name, value); - } - - // Note, FORCE_ADD no longer has any meaning. - OCTAVE_DEPRECATED (6, "use 'interpreter::assign' instead") - void assign (const std::string& name, const octave_value& value, - bool /*force_add*/) - { - assign_deprecated (name, value); - } - - OCTAVE_DEPRECATED (6, "use 'interpreter::clear_all' instead") - void clear_all (bool force = false) - { - clear_all_deprecated (force); - } - - OCTAVE_DEPRECATED (6, "use 'interpreter::clear_global' instead") - void clear_global (const std::string& name) - { - clear_global_deprecated (name); - } - - OCTAVE_DEPRECATED (6, "use 'interpreter::clear_global_pattern' instead") - void clear_global_pattern (const std::string& pattern) - { - clear_global_pattern_deprecated (pattern); - } - - OCTAVE_DEPRECATED (6, "use 'interpreter::clear_symbol' instead") - void clear_symbol (const std::string& name) - { - clear_symbol_deprecated (name); - } - - OCTAVE_DEPRECATED (6, "use 'interpreter::clear_symbol_pattern' instead") - void clear_symbol_pattern (const std::string& pattern) - { - clear_symbol_pattern_deprecated (pattern); - } - - OCTAVE_DEPRECATED (6, "use 'interpreter::global_assign' instead") - void global_assign (const std::string& name, - const octave_value& value = octave_value ()) - { - global_assign_deprecated (name, value); - } - - OCTAVE_DEPRECATED (6, "use 'interpreter::top_level_assign' instead") - void top_level_assign (const std::string& name, - const octave_value& value = octave_value ()) - { - top_level_assign_deprecated (name, value); - } -#endif - private: interpreter& m_interpreter; diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/sysdep.cc --- a/libinterp/corefcn/sysdep.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/sysdep.cc Thu Mar 03 13:37:10 2022 -0500 @@ -1362,7 +1362,7 @@ DEFUN (isieee, , , doc: /* -*- texinfo -*- -@deftypefn {} {} isieee () +@deftypefn {} {@var{tf} =} isieee () Return true if your computer @emph{claims} to conform to the IEEE standard for floating point calculations. diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/toplev.cc --- a/libinterp/corefcn/toplev.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/toplev.cc Thu Mar 03 13:37:10 2022 -0500 @@ -54,7 +54,6 @@ #include "defaults.h" #include "defun.h" #include "error.h" -#include "file-io.h" #include "help.h" #include "interpreter-private.h" #include "octave.h" diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/typecast.cc --- a/libinterp/corefcn/typecast.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/typecast.cc Thu Mar 03 13:37:10 2022 -0500 @@ -206,8 +206,6 @@ else if (array.is_uint64_type ()) get_data_and_bytesize (array.uint64_array_value (), data, byte_size, old_dims, frame); - else - assert (0); } else if (array.iscomplex ()) { @@ -239,8 +237,8 @@ ; else if (numclass == "char") retval = octave_value (reinterpret_copy - (data, byte_size, old_dims), array.is_dq_string () ? '"' - : '\''); + (data, byte_size, old_dims), + array.is_dq_string () ? '"' : '\''); else if (numclass[0] == 'i') { if (numclass == "int8") @@ -548,8 +546,6 @@ retval = do_bitunpack (array.uint32_array_value ()); else if (array.is_uint64_type ()) retval = do_bitunpack (array.uint64_array_value ()); - else - assert (0); } else if (array.iscomplex ()) { diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/utils.cc --- a/libinterp/corefcn/utils.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/utils.cc Thu Mar 03 13:37:10 2022 -0500 @@ -48,6 +48,7 @@ #include "pathsearch.h" #include "quit.h" #include "str-vec.h" +#include "strcase-wrappers.h" #include "vasprintf-wrapper.h" #include "Cell.h" @@ -93,7 +94,7 @@ DEFUN (isvarname, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} isvarname (@var{name}) +@deftypefn {} {@var{tf} =} isvarname (@var{name}) Return true if @var{name} is a valid variable name. A valid variable name is composed of letters, digits, and underscores ("_"), @@ -1099,7 +1100,7 @@ DEFUN (is_absolute_filename, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} is_absolute_filename (@var{file}) +@deftypefn {} {@var{tf} =} is_absolute_filename (@var{file}) Return true if @var{file} is an absolute filename. @seealso{is_rooted_relative_filename, make_absolute_filename, isfolder} @end deftypefn */) @@ -1120,7 +1121,7 @@ DEFUN (is_rooted_relative_filename, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} is_rooted_relative_filename (@var{file}) +@deftypefn {} {@var{tf} =} is_rooted_relative_filename (@var{file}) Return true if @var{file} is a rooted-relative filename. @seealso{is_absolute_filename, make_absolute_filename, isfolder} @end deftypefn */) @@ -1491,7 +1492,8 @@ return s.length (); } - std::size_t format (std::ostream& os, const std::string& enc, const char *fmt, ...) + std::size_t format (std::ostream& os, const std::string& enc, + const char *fmt, ...) { std::size_t retval; @@ -1505,8 +1507,8 @@ return retval; } - std::size_t vformat (std::ostream& os, const std::string& enc, const char *fmt, - va_list args) + std::size_t vformat (std::ostream& os, const std::string& enc, + const char *fmt, va_list args) { std::string s = vasprintf (fmt, args); @@ -1628,8 +1630,8 @@ DEFMETHOD (isindex, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} isindex (@var{ind}) -@deftypefnx {} {} isindex (@var{ind}, @var{n}) +@deftypefn {} {@var{tf} =} isindex (@var{ind}) +@deftypefnx {} {@var{tf} =} isindex (@var{ind}, @var{n}) Return true if @var{ind} is a valid index. Valid indices are either positive integers (although possibly of real data @@ -1768,7 +1770,7 @@ DEFUN (isstudent, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} isstudent () +@deftypefn {} {@var{tf} =} isstudent () Return true if running in the student edition of @sc{matlab}. @code{isstudent} always returns false in Octave. diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/variables.cc --- a/libinterp/corefcn/variables.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/variables.cc Thu Mar 03 13:37:10 2022 -0500 @@ -124,7 +124,7 @@ DEFMETHOD (isglobal, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} isglobal (@var{name}) +@deftypefn {} {@var{tf} =} isglobal (@var{name}) Return true if @var{name} is a globally visible variable. For example: @@ -772,7 +772,7 @@ int nargin = args.length (); - assert (var < nchoices); + error_unless (var < nchoices); if (nargout > 0 || nargin == 0) retval = choices[var]; @@ -1395,7 +1395,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} missing_function_hook () @deftypefnx {} {@var{old_val} =} missing_function_hook (@var{new_val}) -@deftypefnx {} {} missing_function_hook (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} missing_function_hook (@var{new_val}, "local") Query or set the internal variable that specifies the function to call to provide extra information when an unknown identifier is referenced. @@ -1496,7 +1496,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} missing_component_hook () @deftypefnx {} {@var{old_val} =} missing_component_hook (@var{new_val}) -@deftypefnx {} {} missing_component_hook (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} missing_component_hook (@var{new_val}, "local") Query or set the internal variable that specifies the function to call when a component of Octave is missing. @@ -1525,45 +1525,3 @@ } OCTAVE_NAMESPACE_END - -// DEPRECATED in Octave 6 - -octave_function * -extract_function (const octave_value& arg, const std::string& warn_for, - const std::string& fname, const std::string& header, - const std::string& trailer) -{ - octave_function *retval = is_valid_function (arg, warn_for, 0); - - if (! retval) - { - std::string s = arg.xstring_value ("%s: argument must be a string", - warn_for.c_str ()); - - std::string cmd = header; - cmd.append (s); - cmd.append (trailer); - - int parse_status; - - octave::interpreter& interp - = octave::__get_interpreter__ ("extract_function"); - - interp.eval_string (cmd, true, parse_status, 0); - - if (parse_status != 0) - error ("%s: '%s' is not valid as a function", - warn_for.c_str (), fname.c_str ()); - - retval = is_valid_function (fname, warn_for, 0); - - if (! retval) - error ("%s: '%s' is not valid as a function", - warn_for.c_str (), fname.c_str ()); - - warning ("%s: passing function body as a string is obsolete; please use anonymous functions", - warn_for.c_str ()); - } - - return retval; -} diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/variables.h --- a/libinterp/corefcn/variables.h Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/variables.h Thu Mar 03 13:37:10 2022 -0500 @@ -124,29 +124,34 @@ OCTAVE_DEPRECATED (7, "use 'octave::set_internal_variable' instead") inline octave_value -set_internal_variable (bool& var, const octave_value_list& args, int nargout, const char *nm) +set_internal_variable (bool& var, const octave_value_list& args, int nargout, + const char *nm) { return octave::set_internal_variable (var, args, nargout, nm); } OCTAVE_DEPRECATED (7, "use 'octave::set_internal_variable' instead") inline octave_value -set_internal_variable (char& var, const octave_value_list& args, int nargout, const char *nm) +set_internal_variable (char& var, const octave_value_list& args, int nargout, + const char *nm) { return octave::set_internal_variable (var, args, nargout, nm); } OCTAVE_DEPRECATED (7, "use 'octave::set_internal_variable' instead") inline octave_value -set_internal_variable (int& var, const octave_value_list& args, int nargout, const char *nm, - int minval = std::numeric_limits::min (), int maxval = std::numeric_limits::max ()) +set_internal_variable (int& var, const octave_value_list& args, int nargout, + const char *nm, + int minval = std::numeric_limits::min (), + int maxval = std::numeric_limits::max ()) { return octave::set_internal_variable (var, args, nargout, nm, minval, maxval); } OCTAVE_DEPRECATED (7, "use 'octave::set_internal_variable' instead") inline octave_value -set_internal_variable (double& var, const octave_value_list& args, int nargout, const char *nm, +set_internal_variable (double& var, const octave_value_list& args, int nargout, + const char *nm, double minval = -octave::numeric_limits::Inf (), double maxval = octave::numeric_limits::Inf ()) { @@ -155,24 +160,24 @@ OCTAVE_DEPRECATED (7, "use 'octave::set_internal_variable' instead") inline octave_value -set_internal_variable (std::string& var, const octave_value_list& args, int nargout, const char *nm, - bool empty_ok = true) +set_internal_variable (std::string& var, const octave_value_list& args, + int nargout, const char *nm, bool empty_ok = true) { return octave::set_internal_variable (var, args, nargout, nm, empty_ok); } OCTAVE_DEPRECATED (7, "use 'octave::set_internal_variable' instead") inline octave_value -set_internal_variable (std::string& var, const octave_value_list& args, int nargout, const char *nm, - const char **choices) +set_internal_variable (std::string& var, const octave_value_list& args, + int nargout, const char *nm, const char **choices) { return octave::set_internal_variable (var, args, nargout, nm, choices); } OCTAVE_DEPRECATED (7, "use 'octave::set_internal_variable' instead") inline octave_value -set_internal_variable (int& var, const octave_value_list& args, int nargout, const char *nm, - const char **choices) +set_internal_variable (int& var, const octave_value_list& args, int nargout, + const char *nm, const char **choices) { return octave::set_internal_variable (var, args, nargout, nm, choices); } @@ -184,12 +189,6 @@ return octave::maybe_missing_function_hook (name); } -OCTAVE_DEPRECATED (6, "use 'octave::get_function_handle' instead") -extern OCTINTERP_API octave_function * -extract_function (const octave_value& arg, const std::string& warn_for, - const std::string& fname, const std::string& header, - const std::string& trailer); - #endif // The following macros should also be considered obsolete. diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/xdiv.h --- a/libinterp/corefcn/xdiv.h Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/xdiv.h Thu Mar 03 13:37:10 2022 -0500 @@ -77,7 +77,8 @@ extern FloatMatrix elem_xdiv (float a, const FloatMatrix& b); extern FloatComplexMatrix elem_xdiv (float a, const FloatComplexMatrix& b); -extern FloatComplexMatrix elem_xdiv (const FloatComplex a, const FloatMatrix& b); +extern FloatComplexMatrix elem_xdiv (const FloatComplex a, + const FloatMatrix& b); extern FloatComplexMatrix elem_xdiv (const FloatComplex a, const FloatComplexMatrix& b); @@ -243,31 +244,32 @@ OCTAVE_DEPRECATED (7, "use 'octave::xleftdiv' instead") inline Matrix -xleftdiv (const Matrix& a, const Matrix& b, MatrixType& typ, blas_trans_type transt = blas_no_trans) +xleftdiv (const Matrix& a, const Matrix& b, + MatrixType& typ, blas_trans_type transt = blas_no_trans) { return octave::xleftdiv (a, b, typ, transt); } OCTAVE_DEPRECATED (7, "use 'octave::xleftdiv' instead") inline ComplexMatrix -xleftdiv (const Matrix& a, const ComplexMatrix& b, MatrixType& typ, - blas_trans_type transt = blas_no_trans) +xleftdiv (const Matrix& a, const ComplexMatrix& b, + MatrixType& typ, blas_trans_type transt = blas_no_trans) { return octave::xleftdiv (a, b, typ, transt); } OCTAVE_DEPRECATED (7, "use 'octave::xleftdiv' instead") inline ComplexMatrix -xleftdiv (const ComplexMatrix& a, const Matrix& b, MatrixType& typ, - blas_trans_type transt = blas_no_trans) +xleftdiv (const ComplexMatrix& a, const Matrix& b, + MatrixType& typ, blas_trans_type transt = blas_no_trans) { return octave::xleftdiv (a, b, typ, transt); } OCTAVE_DEPRECATED (7, "use 'octave::xleftdiv' instead") inline ComplexMatrix -xleftdiv (const ComplexMatrix& a, const ComplexMatrix& b, MatrixType& typ, - blas_trans_type transt = blas_no_trans) +xleftdiv (const ComplexMatrix& a, const ComplexMatrix& b, + MatrixType& typ, blas_trans_type transt = blas_no_trans) { return octave::xleftdiv (a, b, typ, transt); } diff -r 103efb7e1600 -r 4392386b5ecb libinterp/corefcn/xpow.h --- a/libinterp/corefcn/xpow.h Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/corefcn/xpow.h Thu Mar 03 13:37:10 2022 -0500 @@ -77,7 +77,8 @@ extern OCTINTERP_API octave_value elem_xpow (double a, const Matrix& b); extern OCTINTERP_API octave_value elem_xpow (double a, const ComplexMatrix& b); -extern OCTINTERP_API octave_value elem_xpow (double a, const octave::range& r); +extern OCTINTERP_API octave_value elem_xpow (double a, + const octave::range& r); extern OCTINTERP_API octave_value elem_xpow (const Matrix& a, double b); extern OCTINTERP_API octave_value elem_xpow (const Matrix& a, const Matrix& b); @@ -88,7 +89,8 @@ extern OCTINTERP_API octave_value elem_xpow (const Complex& a, const Matrix& b); extern OCTINTERP_API octave_value elem_xpow (const Complex& a, const ComplexMatrix& b); -extern OCTINTERP_API octave_value elem_xpow (const Complex& a, const octave::range& r); +extern OCTINTERP_API octave_value elem_xpow (const Complex& a, + const octave::range& r); extern OCTINTERP_API octave_value elem_xpow (const ComplexMatrix& a, double b); extern OCTINTERP_API octave_value elem_xpow (const ComplexMatrix& a, diff -r 103efb7e1600 -r 4392386b5ecb libinterp/dldfcn/__init_fltk__.cc --- a/libinterp/dldfcn/__init_fltk__.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/dldfcn/__init_fltk__.cc Thu Mar 03 13:37:10 2022 -0500 @@ -1340,7 +1340,8 @@ return 0; } - octave_scalar_map format_key_event (int e_key, const char *e_text, int e_state) + octave_scalar_map format_key_event (int e_key, const char *e_text, + int e_state) { octave_scalar_map evt; @@ -1798,7 +1799,8 @@ case FL_RELEASE: if (! m_fp.get_windowbuttonupfcn ().isempty ()) { - set_currentpoint (Fl::event_x (), Fl::event_y () - menu_dy ()); + set_currentpoint (Fl::event_x (), + Fl::event_y () - menu_dy ()); m_fp.execute_windowbuttonupfcn (); } diff -r 103efb7e1600 -r 4392386b5ecb libinterp/dldfcn/__ode15__.cc --- a/libinterp/dldfcn/__ode15__.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/dldfcn/__ode15__.cc Thu Mar 03 13:37:10 2022 -0500 @@ -863,7 +863,8 @@ } else if (index.numel () > 0) - // Not first step: register all events and test if stop integration or not + // Not first step: register all events and test + // if stop integration or not { te.resize (temp + index.numel ()); ye.resize (temp + index.numel (), m_num); diff -r 103efb7e1600 -r 4392386b5ecb libinterp/dldfcn/audiodevinfo.cc --- a/libinterp/dldfcn/audiodevinfo.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/dldfcn/audiodevinfo.cc Thu Mar 03 13:37:10 2022 -0500 @@ -499,7 +499,8 @@ %! devinfo = audiodevinfo; %! nout = audiodevinfo (0); %! nin = audiodevinfo (1); -%! ## There might be multiple devices with the same name (e.g. on Windows WDM-KS) +%! ## There might be multiple devices with the same name +%! ## (e.g., on Windows WDM-KS) %! ## Check only the first of each unique device name. %! [unq_out_name, idx_unique] = unique ({devinfo.output(:).Name}); %! unq_out_id = [devinfo.output(idx_unique).ID]; @@ -563,8 +564,8 @@ octave_value get_userdata (void); PaStream * get_stream (void); + void play (void); void playblocking (void); - void play (void); void pause (void); void resume (void); void stop (void); @@ -884,7 +885,7 @@ if (isplaying ()) { warning_with_id ("Octave:audio-interrupt", - "interrupting playing audioplayer"); + "interrupting audioplayer during playback"); stop (); } } @@ -1556,7 +1557,7 @@ if (isrecording ()) { warning_with_id ("Octave:audio-interrupt", - "interrupting recording audiorecorder"); + "interrupting audiorecorder during recording"); stop (); } } @@ -1655,7 +1656,9 @@ void audiorecorder::set_channels (int channels_arg) { - assert (channels_arg == 1 || channels_arg == 2); + if (channels_arg != 1 && channels_arg != 2) + error ("audiorecorder: number of channels must be 1 or 2"); + channels = channels_arg; } @@ -1931,7 +1934,7 @@ || args(0).is_inline_function ()); if (is_function) - error ("audiorecorder: callbacks not yet implemented"); + error ("audiorecorder: callback functions are not yet implemented"); } if (nargin >= 3) @@ -2343,7 +2346,7 @@ || args(0).is_inline_function ()); if (is_function) - error ("audioplayer: callbacks not yet implemented"); + error ("audioplayer: callback functions are not yet implemented"); recorder->set_y (args(0)); recorder->set_fs (args(1).int_value ()); diff -r 103efb7e1600 -r 4392386b5ecb libinterp/dldfcn/audioread.cc --- a/libinterp/dldfcn/audioread.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/dldfcn/audioread.cc Thu Mar 03 13:37:10 2022 -0500 @@ -545,17 +545,26 @@ ## Test input validation %!testif HAVE_SNDFILE %! fail ("audiowrite (1, 1, 8e3)", "FILENAME must be a string"); -%! fail ("audiowrite ('foo', int64 (1), 8e3)", "wrong type argument 'int64 scalar'"); -%! fail ("audiowrite ('foo', [0 1], [8e3, 8e3])", "FS must be a positive scalar"); +%! fail ("audiowrite ('foo', int64 (1), 8e3)", +%! "wrong type argument 'int64 scalar'"); +%! fail ("audiowrite ('foo', [0 1], [8e3, 8e3])", +%! "FS must be a positive scalar"); %! fail ("audiowrite ('foo', 1, {8e3})", "FS must be a .* integer"); %! fail ("audiowrite ('foo', 1, -8e3)", "FS must be a positive"); -%! fail ("audiowrite ('foo', 1, 8e3, 'bitspersample')", "invalid number of arguments"); -%! fail ("audiowrite ('foo', 1, 8e3, 'bitspersample', 48)", "wrong number of bits specified"); -%! fail ("audiowrite ('foo', 1, 8e3, 'quality', [2 3 4])", "Quality value must be a scalar"); -%! fail ("audiowrite ('foo', 1, 8e3, 'quality', NaN)", "Quality value must be .* between 0 and 100"); -%! fail ("audiowrite ('foo', 1, 8e3, 'quality', -1)", "Quality value must be .* between 0 and 100"); -%! fail ("audiowrite ('foo', 1, 8e3, 'quality', 101)", "Quality value must be .* between 0 and 100"); -%! fail ("audiowrite ('foo', 1, 8e3, 'foo', 'bar')", "unrecognized option: 'foo'"); +%! fail ("audiowrite ('foo', 1, 8e3, 'bitspersample')", +%! "invalid number of arguments"); +%! fail ("audiowrite ('foo', 1, 8e3, 'bitspersample', 48)", +%! "wrong number of bits specified"); +%! fail ("audiowrite ('foo', 1, 8e3, 'quality', [2 3 4])", +%! "Quality value must be a scalar"); +%! fail ("audiowrite ('foo', 1, 8e3, 'quality', NaN)", +%! "Quality value must be .* between 0 and 100"); +%! fail ("audiowrite ('foo', 1, 8e3, 'quality', -1)", +%! "Quality value must be .* between 0 and 100"); +%! fail ("audiowrite ('foo', 1, 8e3, 'quality', 101)", +%! "Quality value must be .* between 0 and 100"); +%! fail ("audiowrite ('foo', 1, 8e3, 'foo', 'bar')", +%! "unrecognized option: 'foo'"); */ DEFUN_DLD (audioinfo, args, , diff -r 103efb7e1600 -r 4392386b5ecb libinterp/dldfcn/convhulln.cc --- a/libinterp/dldfcn/convhulln.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/dldfcn/convhulln.cc Thu Mar 03 13:37:10 2022 -0500 @@ -304,7 +304,8 @@ %! [h, v] = convhulln (cube, "Qt"); %! assert (size (h), [12 3]); %! h = sortrows (sort (h, 2), [1:3]); -%! assert (h, [1 2 4; 1 2 6; 1 4 8; 1 5 6; 1 5 8; 2 3 4; 2 3 7; 2 6 7; 3 4 7; 4 7 8; 5 6 7; 5 7 8]); +%! assert (h, +%! [1 2 4; 1 2 6; 1 4 8; 1 5 6; 1 5 8; 2 3 4; 2 3 7; 2 6 7; 3 4 7; 4 7 8; 5 6 7; 5 7 8]); %! assert (v, 1, 10*eps); %! [h2, v2] = convhulln (cube); # Test default option = "Qt" %! assert (size (h2), size (h)); @@ -316,7 +317,8 @@ %! cube = [0 0 0;1 0 0;1 1 0;0 1 0;0 0 1;1 0 1;1 1 1;0 1 1]; %! [h, v] = convhulln (cube, "QJ"); %! assert (size (h), [12 3]); -%! assert (sortrows (sort (h, 2), [1:3]), [1 2 4; 1 2 5; 1 4 5; 2 3 4; 2 3 6; 2 5 6; 3 4 8; 3 6 7; 3 7 8; 4 5 8; 5 6 8; 6 7 8]); +%! assert (sortrows (sort (h, 2), [1:3]), +%! [1 2 4; 1 2 5; 1 4 5; 2 3 4; 2 3 6; 2 5 6; 3 4 8; 3 6 7; 3 7 8; 4 5 8; 5 6 8; 6 7 8]); %! assert (v, 1.0, 1e6*eps); %!testif HAVE_QHULL diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/cdef-class.cc --- a/libinterp/octave-value/cdef-class.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave-value/cdef-class.cc Thu Mar 03 13:37:10 2022 -0500 @@ -312,7 +312,8 @@ } void - cdef_class::cdef_class_rep::find_methods (std::map& meths, + cdef_class::cdef_class_rep::find_methods (std::map& meths, bool only_inherited, bool include_ctor) { @@ -1020,9 +1021,9 @@ // Look for all external methods visible on octave path at the // time of loading of the class. // - // FIXME: This is an "extension" to Matlab behavior, which only looks - // in the @-folder containing the original classdef file. However, - // this is easier to implement it that way at the moment. + // FIXME: This is an "extension" to Matlab behavior, which only + // looks in the @-folder containing the original classdef file. + // However, this is easier to implement it that way at the moment. std::list external_methods = lp.methods (full_class_name); @@ -1052,9 +1053,9 @@ // Property blocks // FIXME: default property expression should be able to call static - // methods of the class being constructed. A restricted CLASSNAME - // symbol should be added to the scope before evaluating default - // value expressions. + // methods of the class being constructed. A restricted + // CLASSNAME symbol should be added to the scope before + // evaluating default value expressions. std::list pb_list = b->properties_list (); @@ -1127,17 +1128,17 @@ // list of all valid properties that can be used to // validate the attribute list (see bug #60593). - // Install property attributes. This is done before assigning - // the property accessors so we can do validation by using - // cdef_property methods. + // Install property attributes. This is done before + // assigning the property accessors so we can do validation + // by using cdef_property methods. for (auto& attrnm_val : amap) prop.put (attrnm_val.first, attrnm_val.second); // Install property access methods, if any. Remove the - // accessor methods from the temporary storage map, so we can - // detect which ones are invalid and do not correspond to a - // defined property. + // accessor methods from the temporary storage map, so we + // can detect which ones are invalid and do not correspond + // to a defined property. auto git = get_methods.find (prop_name); diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/cdef-class.h --- a/libinterp/octave-value/cdef-class.h Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave-value/cdef-class.h Thu Mar 03 13:37:10 2022 -0500 @@ -214,7 +214,7 @@ bool m_handle_class; // The list of super-class constructors that are called implicitly by the - // the classdef engine when creating an object. These constructors are not + // classdef engine when creating an object. These constructors are not // called explicitly by the class constructor. std::list m_implicit_ctor_list; @@ -239,7 +239,8 @@ cdef_class (void) : cdef_meta_object () { } - cdef_class (const std::string& nm, const std::list& superclasses) + cdef_class (const std::string& nm, + const std::list& superclasses) : cdef_meta_object (new cdef_class_rep (superclasses)) { get_rep ()->set_name (nm); diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/cdef-manager.cc --- a/libinterp/octave-value/cdef-manager.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave-value/cdef-manager.cc Thu Mar 03 13:37:10 2022 -0500 @@ -281,7 +281,8 @@ static octave_value_list package_getAllPackages (interpreter& interp, - const octave_value_list& /* args */, int /* nargout */) + const octave_value_list& /* args */, + int /* nargout */) { std::map toplevel_packages; diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/cdef-method.cc --- a/libinterp/octave-value/cdef-method.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave-value/cdef-method.cc Thu Mar 03 13:37:10 2022 -0500 @@ -218,7 +218,8 @@ switch (type[0]) { case '(': - retval = (execute (idx.front (), type.length () > 1 ? 1 : nargout, true)); + retval = (execute (idx.front (), + type.length () > 1 ? 1 : nargout, true)); break; default: diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/cdef-object.cc diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/cdef-object.h --- a/libinterp/octave-value/cdef-object.h Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave-value/cdef-object.h Thu Mar 03 13:37:10 2022 -0500 @@ -207,7 +207,8 @@ // FIXME: use a null object? cdef_object (void) : m_rep (new cdef_object_rep ()) { } - cdef_object (const cdef_object& obj) : m_rep (obj.m_rep) { m_rep->m_count++; } + cdef_object (const cdef_object& obj) : m_rep (obj.m_rep) + { m_rep->m_count++; } cdef_object (cdef_object_rep *r) : m_rep (r) { } @@ -256,7 +257,8 @@ bool is_meta_object (void) const { return m_rep->is_meta_object (); } - Array array_value (void) const { return m_rep->array_value (); } + Array array_value (void) const + { return m_rep->array_value (); } void put (const std::string& pname, const octave_value& val) { diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/cdef-package.h --- a/libinterp/octave-value/cdef-package.h Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave-value/cdef-package.h Thu Mar 03 13:37:10 2022 -0500 @@ -61,7 +61,8 @@ ~cdef_package_rep (void) = default; - cdef_object_rep * copy (void) const { return new cdef_package_rep (*this); } + cdef_object_rep * copy (void) const + { return new cdef_package_rep (*this); } bool is_package (void) const { return true; } diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/cdef-utils.cc --- a/libinterp/octave-value/cdef-utils.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave-value/cdef-utils.cc Thu Mar 03 13:37:10 2022 -0500 @@ -318,16 +318,17 @@ return true; else if (is_strict_superclass (ctx, cls)) { - // Calling a protected method or property in a derived class. - // This is only allowed if the context class knows about it - // and has access to it. + // Calling a protected method or property in a derived + // class. This is only allowed if the context class knows + // about it and has access to it. if (! meth_name.empty ()) { cdef_method m = ctx.find_method (meth_name); if (m.ok ()) - return check_access (ctx, m.get ("Access"), meth_name); + return check_access (ctx, + m.get ("Access"), meth_name); return false; } diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/ov-base-diag.cc --- a/libinterp/octave-value/ov-base-diag.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave-value/ov-base-diag.cc Thu Mar 03 13:37:10 2022 -0500 @@ -299,7 +299,8 @@ // FIXME: We really need some traits so that ad hoc hooks like this // are not necessary. template inline T helper_iscomplex (T) { return false; } -template inline T helper_iscomplex (std::complex) { return true; } +template inline T helper_iscomplex (std::complex) +{ return true; } template double diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/ov-base-int.cc --- a/libinterp/octave-value/ov-base-int.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave-value/ov-base-int.cc Thu Mar 03 13:37:10 2022 -0500 @@ -453,7 +453,8 @@ if (space_hid < 0) return false; #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (loc_id, name, save_type_hid, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (loc_id, name, save_type_hid, space_hid, octave_H5P_DEFAULT); @@ -742,7 +743,8 @@ #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (loc_id, name, save_type_hid, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (loc_id, name, save_type_hid, space_hid, octave_H5P_DEFAULT); diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/ov-base.cc --- a/libinterp/octave-value/ov-base.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave-value/ov-base.cc Thu Mar 03 13:37:10 2022 -0500 @@ -98,8 +98,7 @@ DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_base_value, "", "unknown"); -// TRUE means to perform automatic sparse to real mutation if there -// is memory to be saved +// DEPRECATED in Octave 8. bool Vsparse_auto_mutate = false; octave_base_value * @@ -1355,7 +1354,7 @@ void octave_base_value::indent (std::ostream& os) const { - assert (s_curr_print_indent_level >= 0); + panic_unless (s_curr_print_indent_level >= 0); if (s_beginning_of_line) { @@ -1547,49 +1546,4 @@ INSTALL_WIDENOP_TI (ti, octave_base_value, octave_cell, cell_conv); } -DEFUN (sparse_auto_mutate, args, nargout, - doc: /* -*- texinfo -*- -@deftypefn {} {@var{val} =} sparse_auto_mutate () -@deftypefnx {} {@var{old_val} =} sparse_auto_mutate (@var{new_val}) -@deftypefnx {} {} sparse_auto_mutate (@var{new_val}, "local") -Query or set the internal variable that controls whether Octave will -automatically mutate sparse matrices to full matrices to save memory. - -For example: - -@example -@group -s = speye (3); -sparse_auto_mutate (false); -s(:, 1) = 1; -typeinfo (s) -@result{} sparse matrix -sparse_auto_mutate (true); -s(1, :) = 1; -typeinfo (s) -@result{} matrix -@end group -@end example - -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 */) -{ - return set_internal_variable (Vsparse_auto_mutate, args, nargout, - "sparse_auto_mutate"); -} - -/* -%!test -%! s = speye (3); -%! sparse_auto_mutate (false); -%! s(:, 1) = 1; -%! assert (typeinfo (s), "sparse matrix"); -%! sparse_auto_mutate (true); -%! s(1, :) = 1; -%! assert (typeinfo (s), "matrix"); -%! sparse_auto_mutate (false); -*/ - OCTAVE_NAMESPACE_END diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/ov-base.h --- a/libinterp/octave-value/ov-base.h Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave-value/ov-base.h Thu Mar 03 13:37:10 2022 -0500 @@ -302,7 +302,8 @@ virtual octave_value as_uint32 (void) const; virtual octave_value as_uint64 (void) const; - virtual octave_base_value * try_narrowing_conversion (void) { return nullptr; } + virtual octave_base_value * try_narrowing_conversion (void) + { return nullptr; } virtual void maybe_economize (void) { } @@ -934,8 +935,7 @@ octave::auto_shlib m_containing_dynamic_library; }; -// TRUE means to perform automatic sparse to real mutation if there -// is memory to be saved +OCTAVE_DEPRECATED (8, "Vsparse_auto_mutate is obsolete and is now always false") extern OCTINTERP_API bool Vsparse_auto_mutate; // Utility function to convert C++ arguments used in subsref/subsasgn into an diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/ov-bool-mat.cc --- a/libinterp/octave-value/ov-bool-mat.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave-value/ov-bool-mat.cc Thu Mar 03 13:37:10 2022 -0500 @@ -456,7 +456,8 @@ if (space_hid < 0) return false; #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (loc_id, name, H5T_NATIVE_HBOOL, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (loc_id, name, H5T_NATIVE_HBOOL, space_hid, octave_H5P_DEFAULT); diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/ov-bool-sparse.cc --- a/libinterp/octave-value/ov-bool-sparse.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave-value/ov-bool-sparse.cc Thu Mar 03 13:37:10 2022 -0500 @@ -73,32 +73,6 @@ octave_sparse_matrix::static_type_id ()); } -octave_base_value * -octave_sparse_bool_matrix::try_narrowing_conversion (void) -{ - octave_base_value *retval = nullptr; - - if (Vsparse_auto_mutate) - { - // Don't use numel, since it can overflow for very large matrices - // Note that for the second test, this means it becomes approximative - // since it involves a cast to double to avoid issues of overflow - if (matrix.rows () == 1 && matrix.cols () == 1) - { - // Const copy of the matrix, so the right version of () operator used - const SparseBoolMatrix tmp (matrix); - - retval = new octave_bool (tmp (0)); - } - else if (matrix.cols () > 0 && matrix.rows () > 0 - && (double (matrix.byte_size ()) > double (matrix.rows ()) - * double (matrix.cols ()) * sizeof (bool))) - retval = new octave_bool_matrix (matrix.matrix_value ()); - } - - return retval; -} - double octave_sparse_bool_matrix::double_value (bool) const { diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/ov-bool-sparse.h --- a/libinterp/octave-value/ov-bool-sparse.h Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave-value/ov-bool-sparse.h Thu Mar 03 13:37:10 2022 -0500 @@ -84,8 +84,6 @@ type_conv_info numeric_conversion_function (void) const; - octave_base_value * try_narrowing_conversion (void); - // FIXME: Adapt idx_vector to allow sparse logical indexing without overflow! octave::idx_vector index_vector (bool /* require_integers */ = false) const { diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/ov-bool.cc --- a/libinterp/octave-value/ov-bool.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave-value/ov-bool.cc Thu Mar 03 13:37:10 2022 -0500 @@ -241,7 +241,8 @@ if (space_hid < 0) return false; #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (loc_id, name, H5T_NATIVE_DOUBLE, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (loc_id, name, H5T_NATIVE_DOUBLE, space_hid, octave_H5P_DEFAULT); @@ -253,8 +254,8 @@ } double tmp = double_value (); - retval = H5Dwrite (data_hid, H5T_NATIVE_DOUBLE, octave_H5S_ALL, octave_H5S_ALL, - octave_H5P_DEFAULT, &tmp) >= 0; + retval = H5Dwrite (data_hid, H5T_NATIVE_DOUBLE, octave_H5S_ALL, + octave_H5S_ALL, octave_H5P_DEFAULT, &tmp) >= 0; H5Dclose (data_hid); H5Sclose (space_hid); diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/ov-cell.cc --- a/libinterp/octave-value/ov-cell.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave-value/ov-cell.cc Thu Mar 03 13:37:10 2022 -0500 @@ -1045,7 +1045,8 @@ #if defined (HAVE_HDF5_18) size_hid = H5Dcreate (data_hid, "dims", H5T_NATIVE_IDX, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else size_hid = H5Dcreate (data_hid, "dims", H5T_NATIVE_IDX, space_hid, octave_H5P_DEFAULT); @@ -1223,7 +1224,7 @@ DEFUN (iscell, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} iscell (@var{x}) +@deftypefn {} {@var{tf} =} iscell (@var{x}) Return true if @var{x} is a cell array object. @seealso{ismatrix, isstruct, iscellstr, isa} @end deftypefn */) @@ -1289,7 +1290,7 @@ DEFUN (iscellstr, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} iscellstr (@var{cell}) +@deftypefn {} {@var{tf} =} iscellstr (@var{cell}) Return true if every element of the cell array @var{cell} is a character string. @seealso{ischar, isstring} diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/ov-ch-mat.cc --- a/libinterp/octave-value/ov-ch-mat.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave-value/ov-ch-mat.cc Thu Mar 03 13:37:10 2022 -0500 @@ -320,12 +320,12 @@ p(1) = 0; \ in_m = matrix.permute (p); \ } \ - std::size_t output_length = in_m.numel (); \ + std::size_t output_length = in_m.numel (); \ charNDArray ch_array = charNDArray (in_m.dims ()); \ const uint8_t *in = reinterpret_cast (in_m.data ()); \ uint8_t *buf = reinterpret_cast (ch_array.fortran_vec ()); \ U8_FCN (in, matrix.numel (), nullptr, buf, &output_length); \ - if (output_length != static_cast (matrix.numel ())) \ + if (output_length != static_cast (matrix.numel ())) \ { \ warning_with_id ("Octave:multi_byte_char_length", \ "UMAP: Possible multi-byte error."); \ diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/ov-class.cc --- a/libinterp/octave-value/ov-class.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave-value/ov-class.cc Thu Mar 03 13:37:10 2022 -0500 @@ -281,7 +281,7 @@ Cell octave_class::dotref (const octave_value_list& idx) { - assert (idx.length () == 1); + panic_if (idx.length () != 1); std::string method_class = get_current_method_class (); @@ -654,7 +654,7 @@ octave_value_list key_idx = *++p; - assert (key_idx.length () == 1); + panic_if (key_idx.length () != 1); std::string key = key_idx(0).xstring_value ("invalid index for class assignment"); @@ -692,7 +692,7 @@ { octave_value_list key_idx = idx.front (); - assert (key_idx.length () == 1); + panic_if (key_idx.length () != 1); std::string key = key_idx(0).string_value (); @@ -747,7 +747,7 @@ auto p = idx.begin (); octave_value_list key_idx = *++p; - assert (key_idx.length () == 1); + panic_if (key_idx.length () != 1); std::string key = key_idx(0).xstring_value ("assignment to class element failed"); @@ -785,7 +785,7 @@ { octave_value_list key_idx = idx.front (); - assert (key_idx.length () == 1); + panic_if (key_idx.length () != 1); std::string key = key_idx(0).string_value (); @@ -1068,7 +1068,7 @@ // Something has gone terribly wrong if // symbol_table::find_method (c_name, c_name) does not return // a class constructor for the class c_name... - assert (have_ctor); + panic_unless (have_ctor); } if (have_ctor) @@ -1802,7 +1802,7 @@ DEFUN (isa, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} isa (@var{obj}, @var{classname}) +@deftypefn {} {@var{tf} =} isa (@var{obj}, @var{classname}) Return true if @var{obj} is an object from the class @var{classname}. @var{classname} may also be one of the following class categories: @@ -1928,7 +1928,7 @@ DEFUN (isobject, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} isobject (@var{x}) +@deftypefn {} {@var{tf} =} isobject (@var{x}) Return true if @var{x} is a class object. @seealso{class, typeinfo, isa, ismethod, isprop} @end deftypefn */) diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/ov-class.h --- a/libinterp/octave-value/ov-class.h Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave-value/ov-class.h Thu Mar 03 13:37:10 2022 -0500 @@ -188,7 +188,8 @@ OCTINTERP_API void print (std::ostream& os, bool pr_as_read_syntax = false); - OCTINTERP_API void print_raw (std::ostream& os, bool pr_as_read_syntax = false) const; + OCTINTERP_API void print_raw (std::ostream& os, + bool pr_as_read_syntax = false) const; OCTINTERP_API bool reconstruct_exemplar (void); diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/ov-classdef.cc --- a/libinterp/octave-value/ov-classdef.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave-value/ov-classdef.cc Thu Mar 03 13:37:10 2022 -0500 @@ -140,7 +140,8 @@ } } - retval = m_object.subsref (type, idx, 1, skip, octave::cdef_class (), auto_add); + retval = m_object.subsref (type, idx, 1, skip, + octave::cdef_class (), auto_add); if (type.length () > skip && idx.size () > skip) retval = retval(0).next_subsref (1, type, idx, skip); diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/ov-colon.h --- a/libinterp/octave-value/ov-colon.h Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave-value/ov-colon.h Thu Mar 03 13:37:10 2022 -0500 @@ -73,7 +73,8 @@ OCTINTERP_API void print (std::ostream& os, bool pr_as_read_syntax = false); - OCTINTERP_API void print_raw (std::ostream& os, bool pr_as_read_syntax = false) const; + OCTINTERP_API void print_raw (std::ostream& os, + bool pr_as_read_syntax = false) const; private: diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/ov-complex.cc --- a/libinterp/octave-value/ov-complex.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave-value/ov-complex.cc Thu Mar 03 13:37:10 2022 -0500 @@ -385,7 +385,8 @@ } #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (loc_id, name, type_hid, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (loc_id, name, type_hid, space_hid, octave_H5P_DEFAULT); #endif diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/ov-cx-mat.cc --- a/libinterp/octave-value/ov-cx-mat.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave-value/ov-cx-mat.cc Thu Mar 03 13:37:10 2022 -0500 @@ -596,7 +596,8 @@ } #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (loc_id, name, type_hid, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (loc_id, name, type_hid, space_hid, octave_H5P_DEFAULT); #endif diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/ov-cx-sparse.cc --- a/libinterp/octave-value/ov-cx-sparse.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave-value/ov-cx-sparse.cc Thu Mar 03 13:37:10 2022 -0500 @@ -60,49 +60,8 @@ octave_base_value * octave_sparse_complex_matrix::try_narrowing_conversion (void) { - octave_base_value *retval = nullptr; - - if (Vsparse_auto_mutate) - { - int nr = matrix.rows (); - int nc = matrix.cols (); - - // Don't use numel, since it can overflow for very large matrices - // Note that for the tests on matrix size, they become approximative - // since they involves a cast to double to avoid issues of overflow - if (matrix.rows () == 1 && matrix.cols () == 1) - { - // Const copy of the matrix, so the right version of () operator used - const SparseComplexMatrix tmp (matrix); - - Complex c = tmp (0, 0); - - if (c.imag () == 0.0) - retval = new octave_scalar (c.real ()); - else - retval = new octave_complex (c); - } - else if (nr == 0 || nc == 0) - retval = new octave_matrix (Matrix (nr, nc)); - else if (matrix.all_elements_are_real ()) - if (matrix.cols () > 0 && matrix.rows () > 0 - && (double (matrix.byte_size ()) > double (matrix.rows ()) - * double (matrix.cols ()) * sizeof (double))) - retval = new octave_matrix (::real (matrix.matrix_value ())); - else - retval = new octave_sparse_matrix (::real (matrix)); - else if (matrix.cols () > 0 && matrix.rows () > 0 - && (double (matrix.byte_size ()) > double (matrix.rows ()) - * double (matrix.cols ()) * sizeof (Complex))) - retval = new octave_complex_matrix (matrix.matrix_value ()); - } - else - { - if (matrix.all_elements_are_real ()) - retval = new octave_sparse_matrix (::real (matrix)); - } - - return retval; + return (matrix.all_elements_are_real () + ? new octave_sparse_matrix (::real (matrix)) : nullptr); } double @@ -400,7 +359,8 @@ #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (group_hid, "nr", H5T_NATIVE_IDX, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (group_hid, "nr", H5T_NATIVE_IDX, space_hid, octave_H5P_DEFAULT); @@ -425,7 +385,8 @@ #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (group_hid, "nc", H5T_NATIVE_IDX, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (group_hid, "nc", H5T_NATIVE_IDX, space_hid, octave_H5P_DEFAULT); @@ -450,7 +411,8 @@ #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (group_hid, "nz", H5T_NATIVE_IDX, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (group_hid, "nz", H5T_NATIVE_IDX, space_hid, octave_H5P_DEFAULT); @@ -488,7 +450,8 @@ #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (group_hid, "cidx", H5T_NATIVE_IDX, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (group_hid, "cidx", H5T_NATIVE_IDX, space_hid, octave_H5P_DEFAULT); @@ -526,7 +489,8 @@ #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (group_hid, "ridx", H5T_NATIVE_IDX, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (group_hid, "ridx", H5T_NATIVE_IDX, space_hid, octave_H5P_DEFAULT); @@ -582,7 +546,8 @@ } #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (group_hid, "data", type_hid, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (group_hid, "data", type_hid, space_hid, octave_H5P_DEFAULT); @@ -601,8 +566,8 @@ { Complex *ctmp = m.xdata (); - retval = H5Dwrite (data_hid, complex_type_hid, octave_H5S_ALL, octave_H5S_ALL, - octave_H5P_DEFAULT, ctmp) >= 0; + retval = H5Dwrite (data_hid, complex_type_hid, octave_H5S_ALL, + octave_H5S_ALL, octave_H5P_DEFAULT, ctmp) >= 0; } H5Dclose (data_hid); diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/ov-dld-fcn.h --- a/libinterp/octave-value/ov-dld-fcn.h Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave-value/ov-dld-fcn.h Thu Mar 03 13:37:10 2022 -0500 @@ -69,7 +69,8 @@ ~octave_dld_function (void); - void mark_fcn_file_up_to_date (const octave::sys::time& t) { m_t_checked = t; } + void mark_fcn_file_up_to_date (const octave::sys::time& t) + { m_t_checked = t; } std::string fcn_file_name (void) const; diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/ov-fcn-handle.cc --- a/libinterp/octave-value/ov-fcn-handle.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave-value/ov-fcn-handle.cc Thu Mar 03 13:37:10 2022 -0500 @@ -217,7 +217,8 @@ bool load_binary (std::istream& is, bool swap, mach_info::float_format fmt); - bool save_hdf5 (octave_hdf5_id loc_hid, const char *name, bool save_as_floats); + bool save_hdf5 (octave_hdf5_id loc_hid, const char *name, + bool save_as_floats); bool load_hdf5 (octave_hdf5_id& group_hid, octave_hdf5_id& space_hid, octave_hdf5_id& type_hid); @@ -289,7 +290,8 @@ bool load_binary (std::istream& is, bool swap, mach_info::float_format fmt); - bool save_hdf5 (octave_hdf5_id loc_id, const char *name, bool save_as_floats); + bool save_hdf5 (octave_hdf5_id loc_id, const char *name, + bool save_as_floats); bool load_hdf5 (octave_hdf5_id& group_hid, octave_hdf5_id& space_hid, octave_hdf5_id& type_hid); @@ -362,7 +364,8 @@ bool load_binary (std::istream& is, bool swap, mach_info::float_format fmt); - bool save_hdf5 (octave_hdf5_id loc_id, const char *name, bool save_as_floats); + bool save_hdf5 (octave_hdf5_id loc_id, const char *name, + bool save_as_floats); bool load_hdf5 (octave_hdf5_id& group_hid, octave_hdf5_id& space_hid, octave_hdf5_id& type_hid); @@ -552,7 +555,8 @@ bool load_binary (std::istream& is, bool swap, mach_info::float_format fmt); - bool save_hdf5 (octave_hdf5_id loc_id, const char *name, bool save_as_floats); + bool save_hdf5 (octave_hdf5_id loc_id, const char *name, + bool save_as_floats); bool load_hdf5 (octave_hdf5_id& group_hid, octave_hdf5_id& space_hid, octave_hdf5_id& type_hid); @@ -656,7 +660,8 @@ bool load_binary (std::istream& is, bool swap, mach_info::float_format fmt); - bool save_hdf5 (octave_hdf5_id loc_id, const char *name, bool save_as_floats); + bool save_hdf5 (octave_hdf5_id loc_id, const char *name, + bool save_as_floats); bool load_hdf5 (octave_hdf5_id& group_hid, octave_hdf5_id& space_hid, octave_hdf5_id& type_hid); @@ -1359,7 +1364,8 @@ a_id = H5Acreate (group_hid, "FILE", type_hid, space_hid, octave_H5P_DEFAULT, octave_H5P_DEFAULT); #else - a_id = H5Acreate (group_hid, "FILE", type_hid, space_hid, octave_H5P_DEFAULT); + a_id = H5Acreate (group_hid, "FILE", type_hid, space_hid, + octave_H5P_DEFAULT); #endif if (a_id >= 0) @@ -2389,7 +2395,8 @@ retval = false; #if defined (HAVE_HDF5_18) data_hid = H5Gcreate (group_hid, "symbol table", - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Gcreate (group_hid, "symbol table", 0); #endif @@ -2621,14 +2628,14 @@ tree_statement_list *b = f->body (); - assert (b->length () == 1); + panic_if (b->length () != 1); tree_statement *s = b->front (); if (! s) error ("invalid anonymous function handle"); - assert (s->is_expression ()); + panic_unless (s->is_expression ()); tree_expression *e = s->expression (); @@ -2954,14 +2961,16 @@ std::string name; is >> name; - new_rep.reset (new octave::simple_fcn_handle (name, fpath, octaveroot)); + new_rep.reset (new octave::simple_fcn_handle (name, fpath, + octaveroot)); } else if (subtype == "scopedfunction") { std::string name; is >> name; - new_rep.reset (new octave::scoped_fcn_handle (name, fpath, octaveroot)); + new_rep.reset (new octave::scoped_fcn_handle (name, fpath, + octaveroot)); } else if (subtype == "anonymous") new_rep.reset (new octave::anonymous_fcn_handle ()); @@ -2970,14 +2979,16 @@ std::string name; is >> name; - new_rep.reset (new octave::nested_fcn_handle (name, fpath, octaveroot)); + new_rep.reset (new octave::nested_fcn_handle (name, fpath, + octaveroot)); } else if (subtype == "classsimple") { std::string name; is >> name; - new_rep.reset (new octave::class_simple_fcn_handle (name, fpath, octaveroot)); + new_rep.reset (new octave::class_simple_fcn_handle (name, fpath, + octaveroot)); } } @@ -3077,7 +3088,8 @@ else if (subtype == "nested") new_rep.reset (new octave::nested_fcn_handle (name, fpath, octaveroot)); else if (subtype == "classsimple") - new_rep.reset (new octave::class_simple_fcn_handle (name, fpath, octaveroot)); + new_rep.reset (new octave::class_simple_fcn_handle (name, fpath, + octaveroot)); } if (! new_rep) @@ -3230,7 +3242,8 @@ else if (subtype == "nested") new_rep.reset (new octave::nested_fcn_handle (name, fpath, octaveroot)); else if (subtype == "classsimple") - new_rep.reset (new octave::class_simple_fcn_handle (name, fpath, octaveroot)); + new_rep.reset (new octave::class_simple_fcn_handle (name, fpath, + octaveroot)); } bool status = false; @@ -3397,16 +3410,6 @@ OCTAVE_NAMESPACE_BEGIN - // DEPRECATED in Octave 6. - - octave_value - make_fcn_handle (interpreter& interp, const std::string& nm) - { - tree_evaluator& tw = interp.get_evaluator (); - - return tw.make_fcn_handle (nm); - } - DEFUN (functions, args, , doc: /* -*- texinfo -*- @deftypefn {} {@var{s} =} functions (@var{fcn_handle}) @@ -3590,7 +3593,7 @@ DEFUN (is_function_handle, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} is_function_handle (@var{x}) +@deftypefn {} {@var{tf} =} is_function_handle (@var{x}) Return true if @var{x} is a function handle. @seealso{isa, typeinfo, class, functions} @end deftypefn */) diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/ov-fcn-handle.h --- a/libinterp/octave-value/ov-fcn-handle.h Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave-value/ov-fcn-handle.h Thu Mar 03 13:37:10 2022 -0500 @@ -373,14 +373,4 @@ extern bool is_equal_to (const octave_fcn_handle& fh1, const octave_fcn_handle& fh2); -OCTAVE_NAMESPACE_BEGIN - -#if defined (OCTAVE_PROVIDE_DEPRECATED_SYMBOLS) - OCTAVE_DEPRECATED (6, "use 'tree_evaluator::make_fcn_handle' instead") - extern octave_value - make_fcn_handle (interpreter& interp, const std::string& name); #endif - -OCTAVE_NAMESPACE_END - -#endif diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/ov-float.cc --- a/libinterp/octave-value/ov-float.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave-value/ov-float.cc Thu Mar 03 13:37:10 2022 -0500 @@ -262,7 +262,8 @@ if (space_hid < 0) return false; #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (loc_id, name, H5T_NATIVE_FLOAT, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (loc_id, name, H5T_NATIVE_FLOAT, space_hid, octave_H5P_DEFAULT); diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/ov-flt-complex.cc --- a/libinterp/octave-value/ov-flt-complex.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave-value/ov-flt-complex.cc Thu Mar 03 13:37:10 2022 -0500 @@ -326,7 +326,8 @@ } #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (loc_id, name, type_hid, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (loc_id, name, type_hid, space_hid, octave_H5P_DEFAULT); #endif diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/ov-flt-cx-diag.cc --- a/libinterp/octave-value/ov-flt-cx-diag.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave-value/ov-flt-cx-diag.cc Thu Mar 03 13:37:10 2022 -0500 @@ -148,8 +148,7 @@ return ::imag (m_matrix); case umap_sqrt: { - FloatComplexColumnVector tmp = m_matrix.extract_diag ().map - (std::sqrt); + FloatComplexColumnVector tmp = m_matrix.extract_diag ().map (std::sqrt); FloatComplexDiagMatrix retval (tmp); retval.resize (m_matrix.rows (), m_matrix.columns ()); return retval; diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/ov-flt-cx-mat.cc --- a/libinterp/octave-value/ov-flt-cx-mat.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave-value/ov-flt-cx-mat.cc Thu Mar 03 13:37:10 2022 -0500 @@ -552,7 +552,8 @@ } #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (loc_id, name, type_hid, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (loc_id, name, type_hid, space_hid, octave_H5P_DEFAULT); #endif diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/ov-flt-re-diag.cc --- a/libinterp/octave-value/ov-flt-re-diag.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave-value/ov-flt-re-diag.cc Thu Mar 03 13:37:10 2022 -0500 @@ -166,8 +166,7 @@ return DiagMatrix (m_matrix.rows (), m_matrix.cols (), 0.0); case umap_sqrt: { - FloatComplexColumnVector tmp = m_matrix.extract_diag ().map - (octave::math::rc_sqrt); + FloatComplexColumnVector tmp = m_matrix.extract_diag ().map (octave::math::rc_sqrt); FloatComplexDiagMatrix retval (tmp); retval.resize (m_matrix.rows (), m_matrix.columns ()); return retval; diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/ov-flt-re-mat.cc --- a/libinterp/octave-value/ov-flt-re-mat.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave-value/ov-flt-re-mat.cc Thu Mar 03 13:37:10 2022 -0500 @@ -619,7 +619,8 @@ #endif #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (loc_id, name, save_type_hid, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (loc_id, name, save_type_hid, space_hid, octave_H5P_DEFAULT); diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/ov-java.cc --- a/libinterp/octave-value/ov-java.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave-value/ov-java.cc Thu Mar 03 13:37:10 2022 -0500 @@ -1265,7 +1265,8 @@ } static octave_value -convert_to_string (JNIEnv *jni_env, jobject m_java_object, bool force, char type) +convert_to_string (JNIEnv *jni_env, jobject m_java_object, bool force, + char type) { octave_value retval; @@ -1274,7 +1275,8 @@ jclass_ref cls (jni_env, jni_env->FindClass ("java/lang/String")); if (jni_env->IsInstanceOf (m_java_object, cls)) - retval = octave_value (jstring_to_string (jni_env, m_java_object), type); + retval = octave_value (jstring_to_string (jni_env, m_java_object), + type); else if (force) { cls = jni_env->FindClass ("[Ljava/lang/String;"); @@ -2366,7 +2368,8 @@ JNIEnv *current_env = thread_jni_env (); if (current_env) - return convert_to_string (current_env, TO_JOBJECT (to_java ()), force, type); + return convert_to_string (current_env, TO_JOBJECT (to_java ()), force, + type); else return octave_value (""); @@ -3372,7 +3375,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} java_matrix_autoconversion () @deftypefnx {} {@var{old_val} =} java_matrix_autoconversion (@var{new_val}) -@deftypefnx {} {} java_matrix_autoconversion (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} java_matrix_autoconversion (@var{new_val}, "local") Query or set the internal variable that controls whether Java arrays are automatically converted to Octave matrices. @@ -3403,7 +3406,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} java_unsigned_autoconversion () @deftypefnx {} {@var{old_val} =} java_unsigned_autoconversion (@var{new_val}) -@deftypefnx {} {} java_unsigned_autoconversion (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} java_unsigned_autoconversion (@var{new_val}, "local") Query or set the internal variable that controls how integer classes are converted when @code{java_matrix_autoconversion} is enabled. @@ -3435,7 +3438,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} debug_java () @deftypefnx {} {@var{old_val} =} debug_java (@var{new_val}) -@deftypefnx {} {} debug_java (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} debug_java (@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. @@ -3466,7 +3469,7 @@ DEFUN (isjava, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} isjava (@var{x}) +@deftypefn {} {@var{tf} =} isjava (@var{x}) Return true if @var{x} is a Java object. @seealso{class, typeinfo, isa, javaObject} @end deftypefn */) @@ -3494,14 +3497,22 @@ ## Check we can create objects that wrap java literals %!testif HAVE_JAVA; usejava ("jvm") <*38821> -%! assert (class (javaObject ("java.lang.Byte", uint8 (1))), "java.lang.Byte"); -%! assert (class (javaObject ("java.lang.Byte", int8 (1))), "java.lang.Byte"); -%! assert (class (javaObject ("java.lang.Short", uint16 (1))), "java.lang.Short"); -%! assert (class (javaObject ("java.lang.Short", int16 (1))), "java.lang.Short"); -%! assert (class (javaObject ("java.lang.Integer", uint32 (1))), "java.lang.Integer"); -%! assert (class (javaObject ("java.lang.Integer", int32 (1))), "java.lang.Integer"); -%! assert (class (javaObject ("java.lang.Long", uint64 (1))), "java.lang.Long"); -%! assert (class (javaObject ("java.lang.Long", int64 (1))), "java.lang.Long"); +%! assert (class (javaObject ("java.lang.Byte", uint8 (1))), +%! "java.lang.Byte"); +%! assert (class (javaObject ("java.lang.Byte", int8 (1))), +%! "java.lang.Byte"); +%! assert (class (javaObject ("java.lang.Short", uint16 (1))), +%! "java.lang.Short"); +%! assert (class (javaObject ("java.lang.Short", int16 (1))), +%! "java.lang.Short"); +%! assert (class (javaObject ("java.lang.Integer", uint32 (1))), +%! "java.lang.Integer"); +%! assert (class (javaObject ("java.lang.Integer", int32 (1))), +%! "java.lang.Integer"); +%! assert (class (javaObject ("java.lang.Long", uint64 (1))), +%! "java.lang.Long"); +%! assert (class (javaObject ("java.lang.Long", int64 (1))), +%! "java.lang.Long"); ## More checks of java numeric and boolean class instances %!testif HAVE_JAVA; usejava ("jvm") @@ -3559,8 +3570,10 @@ %! assert (javaMethod ("valueOf", "java.lang.Long", int64 (1)), 1) %! assert (javaMethod ("valueOf", "java.lang.Float", single (1)), 1) %! assert (javaMethod ("valueOf", "java.lang.Double", double (1)), 1) -%! assert (class (javaMethod ("valueOf", "java.math.BigDecimal", double (1))), "java.math.BigDecimal") -%! assert (class (javaMethod ("valueOf", "java.math.BigInteger", int64 (1))), "java.math.BigInteger") +%! assert (class (javaMethod ("valueOf", "java.math.BigDecimal", double (1))), +%! "java.math.BigDecimal") +%! assert (class (javaMethod ("valueOf", "java.math.BigInteger", int64 (1))), +%! "java.math.BigInteger") ## Automatic conversion from string cell array into String[] %!testif HAVE_JAVA; usejava ("jvm") <*45290> diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/ov-lazy-idx.cc --- a/libinterp/octave-value/ov-lazy-idx.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave-value/ov-lazy-idx.cc Thu Mar 03 13:37:10 2022 -0500 @@ -99,7 +99,8 @@ octave_value octave_lazy_index::squeeze (void) const { - return octave::idx_vector (m_index.as_array ().squeeze (), m_index.extent (0)); + return octave::idx_vector (m_index.as_array ().squeeze (), + m_index.extent (0)); } octave_value diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/ov-lazy-idx.h --- a/libinterp/octave-value/ov-lazy-idx.h Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave-value/ov-lazy-idx.h Thu Mar 03 13:37:10 2022 -0500 @@ -60,7 +60,8 @@ octave_value fast_elem_extract (octave_idx_type n) const; - std::size_t byte_size (void) const { return numel () * sizeof (octave_idx_type); } + std::size_t byte_size (void) const + { return numel () * sizeof (octave_idx_type); } octave_value squeeze (void) const; diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/ov-null-mat.cc --- a/libinterp/octave-value/ov-null-mat.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave-value/ov-null-mat.cc Thu Mar 03 13:37:10 2022 -0500 @@ -100,7 +100,7 @@ DEFUN (isnull, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} isnull (@var{x}) +@deftypefn {} {@var{tf} =} isnull (@var{x}) Return true if @var{x} is a special null matrix, string, or single quoted string. diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/ov-range.cc --- a/libinterp/octave-value/ov-range.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave-value/ov-range.cc Thu Mar 03 13:37:10 2022 -0500 @@ -1042,7 +1042,8 @@ } # if defined (HAVE_HDF5_18) data_hid = H5Dcreate (loc_id, name, type_hid, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); # else data_hid = H5Dcreate (loc_id, name, type_hid, space_hid, octave_H5P_DEFAULT); # endif diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/ov-re-mat.cc --- a/libinterp/octave-value/ov-re-mat.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave-value/ov-re-mat.cc Thu Mar 03 13:37:10 2022 -0500 @@ -745,7 +745,8 @@ #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (loc_id, name, save_type_hid, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (loc_id, name, save_type_hid, space_hid, octave_H5P_DEFAULT); @@ -757,8 +758,8 @@ } double *mtmp = m.fortran_vec (); - retval = H5Dwrite (data_hid, H5T_NATIVE_DOUBLE, octave_H5S_ALL, octave_H5S_ALL, - octave_H5P_DEFAULT, mtmp) >= 0; + retval = H5Dwrite (data_hid, H5T_NATIVE_DOUBLE, octave_H5S_ALL, + octave_H5S_ALL, octave_H5P_DEFAULT, mtmp) >= 0; H5Dclose (data_hid); H5Sclose (space_hid); diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/ov-re-mat.h --- a/libinterp/octave-value/ov-re-mat.h Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave-value/ov-re-mat.h Thu Mar 03 13:37:10 2022 -0500 @@ -106,7 +106,10 @@ octave_base_value * try_narrowing_conversion (void); octave::idx_vector index_vector (bool /* require_integers */ = false) const - { return idx_cache ? *idx_cache : set_idx_cache (octave::idx_vector (matrix)); } + { + return idx_cache ? *idx_cache + : set_idx_cache (octave::idx_vector (matrix)); + } builtin_type_t builtin_type (void) const { return btyp_double; } diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/ov-re-sparse.cc --- a/libinterp/octave-value/ov-re-sparse.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave-value/ov-re-sparse.cc Thu Mar 03 13:37:10 2022 -0500 @@ -69,32 +69,6 @@ } } -octave_base_value * -octave_sparse_matrix::try_narrowing_conversion (void) -{ - octave_base_value *retval = nullptr; - - if (Vsparse_auto_mutate) - { - // Don't use numel, since it can overflow for very large matrices - // Note that for the second test, this means it becomes approximative - // since it involves a cast to double to avoid issues of overflow - if (matrix.rows () == 1 && matrix.cols () == 1) - { - // Const copy of the matrix, so the right version of () operator used - const SparseMatrix tmp (matrix); - - retval = new octave_scalar (tmp (0)); - } - else if (matrix.cols () > 0 && matrix.rows () > 0 - && (double (matrix.byte_size ()) > double (matrix.rows ()) - * double (matrix.cols ()) * sizeof (double))) - retval = new octave_matrix (matrix.matrix_value ()); - } - - return retval; -} - double octave_sparse_matrix::double_value (bool) const { @@ -421,7 +395,8 @@ } #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (group_hid, "nr", H5T_NATIVE_IDX, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (group_hid, "nr", H5T_NATIVE_IDX, space_hid, octave_H5P_DEFAULT); @@ -445,7 +420,8 @@ } #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (group_hid, "nc", H5T_NATIVE_IDX, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (group_hid, "nc", H5T_NATIVE_IDX, space_hid, octave_H5P_DEFAULT); @@ -470,7 +446,8 @@ #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (group_hid, "nz", H5T_NATIVE_IDX, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (group_hid, "nz", H5T_NATIVE_IDX, space_hid, octave_H5P_DEFAULT); @@ -508,7 +485,8 @@ #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (group_hid, "cidx", H5T_NATIVE_IDX, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (group_hid, "cidx", H5T_NATIVE_IDX, space_hid, octave_H5P_DEFAULT); @@ -545,7 +523,8 @@ } #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (group_hid, "ridx", H5T_NATIVE_IDX, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (group_hid, "ridx", H5T_NATIVE_IDX, space_hid, octave_H5P_DEFAULT); @@ -594,7 +573,8 @@ #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (group_hid, "data", save_type_hid, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (group_hid, "data", save_type_hid, space_hid, octave_H5P_DEFAULT); @@ -607,8 +587,8 @@ } double *dtmp = m.xdata (); - retval = H5Dwrite (data_hid, H5T_NATIVE_DOUBLE, octave_H5S_ALL, octave_H5S_ALL, - octave_H5P_DEFAULT, dtmp) >= 0; + retval = H5Dwrite (data_hid, H5T_NATIVE_DOUBLE, octave_H5S_ALL, + octave_H5S_ALL, octave_H5P_DEFAULT, dtmp) >= 0; H5Dclose (data_hid); H5Sclose (space_hid); H5Gclose (group_hid); diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/ov-re-sparse.h --- a/libinterp/octave-value/ov-re-sparse.h Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave-value/ov-re-sparse.h Thu Mar 03 13:37:10 2022 -0500 @@ -91,8 +91,6 @@ octave_base_value * empty_clone (void) const { return new octave_sparse_matrix (); } - octave_base_value * try_narrowing_conversion (void); - octave::idx_vector index_vector (bool require_integers = false) const; builtin_type_t builtin_type (void) const { return btyp_double; } diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/ov-scalar.cc --- a/libinterp/octave-value/ov-scalar.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave-value/ov-scalar.cc Thu Mar 03 13:37:10 2022 -0500 @@ -283,7 +283,8 @@ #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (loc_id, name, H5T_NATIVE_DOUBLE, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (loc_id, name, H5T_NATIVE_DOUBLE, space_hid, octave_H5P_DEFAULT); @@ -295,8 +296,8 @@ } double tmp = double_value (); - retval = H5Dwrite (data_hid, H5T_NATIVE_DOUBLE, octave_H5S_ALL, octave_H5S_ALL, - octave_H5P_DEFAULT, &tmp) >= 0; + retval = H5Dwrite (data_hid, H5T_NATIVE_DOUBLE, octave_H5S_ALL, + octave_H5S_ALL, octave_H5P_DEFAULT, &tmp) >= 0; H5Dclose (data_hid); H5Sclose (space_hid); diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/ov-str-mat.cc --- a/libinterp/octave-value/ov-str-mat.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave-value/ov-str-mat.cc Thu Mar 03 13:37:10 2022 -0500 @@ -593,7 +593,8 @@ return false; #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (loc_id, name, H5T_NATIVE_CHAR, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (loc_id, name, H5T_NATIVE_CHAR, space_hid, octave_H5P_DEFAULT); diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/ov-struct.cc --- a/libinterp/octave-value/ov-struct.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave-value/ov-struct.cc Thu Mar 03 13:37:10 2022 -0500 @@ -91,7 +91,7 @@ { Cell retval; - assert (idx.length () == 1); + panic_if (idx.length () != 1); std::string nm = idx(0).string_value (); @@ -321,7 +321,7 @@ octave_value_list key_idx = *++p; - assert (key_idx.length () == 1); + panic_if (key_idx.length () != 1); std::string key = key_idx(0).string_value (); @@ -377,7 +377,7 @@ { octave_value_list key_idx = idx.front (); - assert (key_idx.length () == 1); + panic_if (key_idx.length () != 1); std::string key = key_idx(0).string_value (); @@ -443,7 +443,7 @@ octave_value_list key_idx = *++p; octave_value_list idxf = idx.front (); - assert (key_idx.length () == 1); + panic_if (key_idx.length () != 1); std::string key = key_idx(0).string_value (); @@ -514,7 +514,7 @@ { octave_value_list key_idx = idx.front (); - assert (key_idx.length () == 1); + panic_if (key_idx.length () != 1); std::string key = key_idx(0).string_value (); @@ -1107,7 +1107,7 @@ { octave_value retval; - assert (idx.length () == 1); + panic_if (idx.length () != 1); std::string nm = idx(0).string_value (); @@ -1228,7 +1228,7 @@ octave_value_list key_idx = idx.front (); - assert (key_idx.length () == 1); + panic_if (key_idx.length () != 1); std::string key = key_idx(0).string_value (); @@ -1885,14 +1885,16 @@ %!assert (size (x), [0,0]) %!assert (isstruct (x)) %!assert (isempty (fieldnames (x))) -%!fail ('struct ("a",{1,2},"b",{1,2,3})', 'dimensions of parameter 2 do not match those of parameter 4') +%!fail ('struct ("a",{1,2},"b",{1,2,3})', +%! 'dimensions of parameter 2 do not match those of parameter 4') %!error struct (1,2,3,4) -%!fail ('struct ("1",2,"3")', 'struct: additional arguments must occur as "field", VALUE pairs') +%!fail ('struct ("1",2,"3")', +%! 'struct: additional arguments must occur as "field", VALUE pairs') */ DEFUN (isstruct, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} isstruct (@var{x}) +@deftypefn {} {@var{tf} =} isstruct (@var{x}) Return true if @var{x} is a structure or a structure array. @seealso{ismatrix, iscell, isa} @end deftypefn */) @@ -1932,8 +1934,8 @@ DEFUN (isfield, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} isfield (@var{x}, "@var{name}") -@deftypefnx {} {} isfield (@var{x}, @var{name}) +@deftypefn {} {@var{tf} =} isfield (@var{x}, "@var{name}") +@deftypefnx {} {@var{tf} =} isfield (@var{x}, @var{name}) Return true if the @var{x} is a structure and it includes an element named @var{name}. @@ -2112,7 +2114,7 @@ // result dimensions. dim_vector rdv = vals.dims ().redim (nd); - assert (ext == rdv(dim)); + panic_unless (ext == rdv(dim)); if (nd == 2) { rdv(0) = rdv(1-dim); @@ -2213,7 +2215,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} struct_levels_to_print () @deftypefnx {} {@var{old_val} =} struct_levels_to_print (@var{new_val}) -@deftypefnx {} {} struct_levels_to_print (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} struct_levels_to_print (@var{new_val}, "local") Query or set the internal variable that specifies the number of structure levels to display. @@ -2232,7 +2234,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} print_struct_array_contents () @deftypefnx {} {@var{old_val} =} print_struct_array_contents (@var{new_val}) -@deftypefnx {} {} print_struct_array_contents (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} print_struct_array_contents (@var{new_val}, "local") Query or set the internal variable that specifies whether to print struct array contents. diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/ov-typeinfo.cc --- a/libinterp/octave-value/ov-typeinfo.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave-value/ov-typeinfo.cc Thu Mar 03 13:37:10 2022 -0500 @@ -645,7 +645,8 @@ { octave_scalar_map retval; - int len = std::min (static_cast (m_binary_ops.columns ()), m_num_types); + int len = std::min (static_cast (m_binary_ops.columns ()), + m_num_types); dim_vector tab_dims (len, len); @@ -697,7 +698,8 @@ { octave_scalar_map retval; - int len = std::min (static_cast (m_assign_ops.columns ()), m_num_types); + int len = std::min (static_cast (m_assign_ops.columns ()), + m_num_types); dim_vector tab_dims (len, len); @@ -722,7 +724,8 @@ { octave_scalar_map retval; - int len = std::min (static_cast (m_assignany_ops.columns ()), m_num_types); + int len = std::min (static_cast (m_assignany_ops.columns ()), + m_num_types); dim_vector tab_dims (1, len); diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/ov-usr-fcn.cc --- a/libinterp/octave-value/ov-usr-fcn.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave-value/ov-usr-fcn.cc Thu Mar 03 13:37:10 2022 -0500 @@ -504,8 +504,8 @@ octave::tree_expression * octave_user_function::special_expr (void) { - assert (is_special_expr ()); - assert (m_cmd_list->length () == 1); + panic_unless (is_special_expr ()); + panic_if (m_cmd_list->length () != 1); octave::tree_statement *stmt = m_cmd_list->front (); return stmt->expression (); @@ -869,7 +869,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} optimize_subsasgn_calls () @deftypefnx {} {@var{old_val} =} optimize_subsasgn_calls (@var{new_val}) -@deftypefnx {} {} optimize_subsasgn_calls (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} optimize_subsasgn_calls (@var{new_val}, "local") Query or set the internal flag for @code{subsasgn} method call optimizations. @@ -905,7 +905,7 @@ DEFMETHOD (isargout, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} isargout (@var{k}) +@deftypefn {} {@var{tf} =} isargout (@var{k}) Within a function, return a logical value indicating whether the argument @var{k} will be assigned to a variable on output. diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/ov.cc --- a/libinterp/octave-value/ov.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave-value/ov.cc Thu Mar 03 13:37:10 2022 -0500 @@ -3179,28 +3179,36 @@ return make_range (base, increment, limit, is_for_cmd_expr); case btyp_int8: - return make_range (base, increment, limit, is_for_cmd_expr); + return make_range (base, increment, limit, + is_for_cmd_expr); case btyp_int16: - return make_range (base, increment, limit, is_for_cmd_expr); + return make_range (base, increment, limit, + is_for_cmd_expr); case btyp_int32: - return make_range (base, increment, limit, is_for_cmd_expr); + return make_range (base, increment, limit, + is_for_cmd_expr); case btyp_int64: - return make_range (base, increment, limit, is_for_cmd_expr); + return make_range (base, increment, limit, + is_for_cmd_expr); case btyp_uint8: - return make_range (base, increment, limit, is_for_cmd_expr); + return make_range (base, increment, limit, + is_for_cmd_expr); case btyp_uint16: - return make_range (base, increment, limit, is_for_cmd_expr); + return make_range (base, increment, limit, + is_for_cmd_expr); case btyp_uint32: - return make_range (base, increment, limit, is_for_cmd_expr); + return make_range (base, increment, limit, + is_for_cmd_expr); case btyp_uint64: - return make_range (base, increment, limit, is_for_cmd_expr); + return make_range (base, increment, limit, + is_for_cmd_expr); case btyp_char: return make_range (base, increment, limit, is_for_cmd_expr); @@ -3617,7 +3625,7 @@ DEFUN (is_sq_string, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} is_sq_string (@var{x}) +@deftypefn {} {@var{tf} =} is_sq_string (@var{x}) Return true if @var{x} is a single-quoted character string. @seealso{is_dq_string, ischar} @end deftypefn */) @@ -3640,7 +3648,7 @@ DEFUN (is_dq_string, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} is_dq_string (@var{x}) +@deftypefn {} {@var{tf} =} is_dq_string (@var{x}) Return true if @var{x} is a double-quoted character string. @seealso{is_sq_string, ischar} @end deftypefn */) @@ -3665,7 +3673,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} optimize_permutation_matrix () @deftypefnx {} {@var{old_val} =} optimize_permutation_matrix (@var{new_val}) -@deftypefnx {} {} optimize_permutation_matrix (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} optimize_permutation_matrix (@var{new_val}, "local") Query or set whether a special space-efficient format is used for storing permutation matrices. @@ -3696,7 +3704,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} optimize_diagonal_matrix () @deftypefnx {} {@var{old_val} =} optimize_diagonal_matrix (@var{new_val}) -@deftypefnx {} {} optimize_diagonal_matrix (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} optimize_diagonal_matrix (@var{new_val}, "local") Query or set whether a special space-efficient format is used for storing diagonal matrices. @@ -3741,7 +3749,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} optimize_range () @deftypefnx {} {@var{old_val} =} optimize_range (@var{new_val}) -@deftypefnx {} {} optimize_range (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} optimize_range (@var{new_val}, "local") Query or set whether a special space-efficient format is used for storing ranges. diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/ov.h --- a/libinterp/octave-value/ov.h Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave-value/ov.h Thu Mar 03 13:37:10 2022 -0500 @@ -1872,6 +1872,8 @@ extern OCTINTERP_API void install_types (octave::type_info&); // Templated value extractors. +// FIXME: would be more consistent to use panic_impossible(), rather than +// assert(), but including "error.h" leads to compilation errors. template inline Value octave_value_extract (const octave_value&) { assert (false); } diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave-value/ovl.cc --- a/libinterp/octave-value/ovl.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave-value/ovl.cc Thu Mar 03 13:37:10 2022 -0500 @@ -71,7 +71,7 @@ m_data[k++] = ovl(i); } - assert (k == nel); + panic_unless (k == nel); } } diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave.cc --- a/libinterp/octave.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave.cc Thu Mar 03 13:37:10 2022 -0500 @@ -242,7 +242,7 @@ octave_scalar_map m; m.assign ("sys_argc", sys_argc ()); - m.assign ("sys_argv", string_vector (sys_argv ())); + m.assign ("sys_argv", Cell (string_vector (sys_argv ()))); m.assign ("echo_commands", echo_commands ()); m.assign ("forced_interactive", forced_interactive ()); m.assign ("forced_line_editing", forced_line_editing ()); @@ -267,8 +267,8 @@ m.assign ("info_file", info_file ()); m.assign ("info_program", info_program ()); m.assign ("texi_macros_file", texi_macros_file ()); - m.assign ("all_args", all_args ()); - m.assign ("remaining_args", remaining_args ()); + m.assign ("all_args", Cell (all_args ())); + m.assign ("remaining_args", Cell (remaining_args ())); return m; } @@ -429,7 +429,7 @@ DEFUN (isguirunning, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} isguirunning () +@deftypefn {} {@var{tf} =} isguirunning () Return true if Octave is running in GUI mode and false otherwise. @seealso{have_window_system} @end deftypefn */) diff -r 103efb7e1600 -r 4392386b5ecb libinterp/octave.h --- a/libinterp/octave.h Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/octave.h Thu Mar 03 13:37:10 2022 -0500 @@ -57,11 +57,13 @@ bool echo_commands (void) const { return m_echo_commands; } - bool experimental_terminal_widget (void) const { return m_experimental_terminal_widget; } + bool experimental_terminal_widget (void) const + { return m_experimental_terminal_widget; } bool forced_interactive (void) const { return m_forced_interactive; } bool forced_line_editing (void) const { return m_forced_line_editing; } bool gui (void) const { return m_gui; } - bool inhibit_startup_message (void) const { return m_inhibit_startup_message; } + bool inhibit_startup_message (void) const + { return m_inhibit_startup_message; } bool line_editing (void) const { return m_line_editing; } bool no_window_system (void) const { return m_no_window_system; } @@ -74,7 +76,8 @@ bool traditional (void) const { return m_traditional; } bool verbose_flag (void) const { return m_verbose_flag; } std::string code_to_eval (void) const { return m_code_to_eval; } - std::list command_line_path (void) const { return m_command_line_path; } + std::list command_line_path (void) const + { return m_command_line_path; } std::string docstrings_file (void) const { return m_docstrings_file; } std::string doc_cache_file (void) const { return m_doc_cache_file; } std::string exec_path (void) const { return m_exec_path; } @@ -87,7 +90,8 @@ void echo_commands (bool arg) { m_echo_commands = arg; } - void experimental_terminal_widget (bool arg) { m_experimental_terminal_widget = arg; } + void experimental_terminal_widget (bool arg) + { m_experimental_terminal_widget = arg; } void forced_line_editing (bool arg) { m_forced_line_editing = arg; } void forced_interactive (bool arg) { m_forced_interactive = arg; } void gui (bool arg) { m_gui = arg; } @@ -104,7 +108,8 @@ void traditional (bool arg) { m_traditional = arg; } void verbose_flag (bool arg) { m_verbose_flag = arg; } void code_to_eval (const std::string& arg) { m_code_to_eval = arg; } - void command_line_path (const std::list& arg) { m_command_line_path = arg; } + void command_line_path (const std::list& arg) + { m_command_line_path = arg; } void docstrings_file (const std::string& arg) { m_docstrings_file = arg; } void doc_cache_file (const std::string& arg) { m_doc_cache_file = arg; } void exec_path (const std::string& arg) { m_exec_path = arg; } @@ -282,7 +287,8 @@ virtual bool gui_running (void) const { return false; } virtual void gui_running (bool) { } - void program_invocation_name (const std::string& nm) { m_program_invocation_name = nm; } + void program_invocation_name (const std::string& nm) + { m_program_invocation_name = nm; } void program_name (const std::string& nm) { m_program_name = nm; } diff -r 103efb7e1600 -r 4392386b5ecb libinterp/operators/ops.h --- a/libinterp/operators/ops.h Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/operators/ops.h Thu Mar 03 13:37:10 2022 -0500 @@ -29,6 +29,7 @@ #include "octave-config.h" #include "Array-util.h" +#include "error.h" namespace octave { @@ -130,7 +131,7 @@ CONCAT2 (octave_, t1)& v1 = dynamic_cast (a1); \ const CONCAT2 (octave_, t2)& v2 = dynamic_cast (a2); \ \ - assert (idx.empty ()); \ + error_unless (idx.empty ()); \ v1.matrix_ref () op v2.CONCAT2 (f, _value) (); \ \ return octave_value (); \ @@ -145,7 +146,7 @@ CONCAT2 (octave_, t1)& v1 = dynamic_cast (a1); \ const CONCAT2 (octave_, t2)& v2 = dynamic_cast (a2); \ \ - assert (idx.empty ()); \ + error_unless (idx.empty ()); \ fnop (v1.matrix_ref (), v2.CONCAT2 (f, _value) ()); \ \ return octave_value (); \ diff -r 103efb7e1600 -r 4392386b5ecb libinterp/parse-tree/bp-table.cc --- a/libinterp/parse-tree/bp-table.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/parse-tree/bp-table.cc Thu Mar 03 13:37:10 2022 -0500 @@ -176,7 +176,7 @@ { Array W = U.index (0); if (W.isempty () || W(0).isempty ()) - es.debug_on_caught (true); // like "dbstop if caught error" with no ID + es.debug_on_caught (true); // like "dbstop if caught error" with no ID else if (! W(0).iscell ()) fail = true; else @@ -670,7 +670,8 @@ // a breakpoint there. Put the system into debug_mode. int bp_table::add_breakpoint_in_function (const std::string& fname, const std::string& class_name, - int line, const std::string& condition) + int line, + const std::string& condition) { bp_lines line_info; line_info.insert (line); diff -r 103efb7e1600 -r 4392386b5ecb libinterp/parse-tree/bp-table.h --- a/libinterp/parse-tree/bp-table.h Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/parse-tree/bp-table.h Thu Mar 03 13:37:10 2022 -0500 @@ -208,9 +208,12 @@ bool condition_valid (const std::string& cond); - void parse_dbfunction_params (const char *who, const octave_value_list& args, - std::string& func_name, std::string& class_name, - bp_table::bp_lines& lines, std::string& cond); + void parse_dbfunction_params (const char *who, + const octave_value_list& args, + std::string& func_name, + std::string& class_name, + bp_table::bp_lines& lines, + std::string& cond); private: diff -r 103efb7e1600 -r 4392386b5ecb libinterp/parse-tree/lex.h --- a/libinterp/parse-tree/lex.h Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/parse-tree/lex.h Thu Mar 03 13:37:10 2022 -0500 @@ -777,7 +777,8 @@ { } lexer (FILE *file, interpreter& interp, const std::string& encoding) - : base_lexer (interp), m_reader (interp, file, encoding), m_initial_input (true) + : base_lexer (interp), m_reader (interp, file, encoding), + m_initial_input (true) { } lexer (const std::string& eval_string, interpreter& interp) diff -r 103efb7e1600 -r 4392386b5ecb libinterp/parse-tree/oct-lvalue.h --- a/libinterp/parse-tree/oct-lvalue.h Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/parse-tree/oct-lvalue.h Thu Mar 03 13:37:10 2022 -0500 @@ -68,7 +68,8 @@ octave_idx_type numel (void) const; - void set_index (const std::string& t, const std::list& i); + void set_index (const std::string& t, + const std::list& i); void clear_index (void) { m_type = ""; m_idx.clear (); } @@ -105,8 +106,6 @@ std::string m_type; std::list m_idx; - - octave_idx_type m_nel; }; } diff -r 103efb7e1600 -r 4392386b5ecb libinterp/parse-tree/profiler.cc --- a/libinterp/parse-tree/profiler.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/parse-tree/profiler.cc Thu Mar 03 13:37:10 2022 -0500 @@ -52,8 +52,6 @@ for (const auto& nm : list) retval(i++) = nm; - assert (i == n); - return retval; } @@ -88,10 +86,10 @@ profiler::tree_node* profiler::tree_node::exit (octave_idx_type /* fcn */) { - // FIXME: These assert statements don't make sense if profile() is called - // from within a function hierarchy to begin with. See bug #39587. - // assert (m_parent); - // assert (m_fcn_id == fcn); + // FIXME: These panic_unless statements don't make sense if profile() is + // called from within a function hierarchy to begin with. See bug #39587. + // panic_unless (m_parent); + // panic_unless (m_fcn_id == fcn); return m_parent; } @@ -99,7 +97,8 @@ void profiler::tree_node::build_flat (flat_profile& data) const { - // If this is not the top-level node, update profile entry for this function. + // If this is not the top-level node, + // update profile entry for this function. if (m_fcn_id != 0) { stats& entry = data[m_fcn_id - 1]; @@ -107,7 +106,7 @@ entry.m_time += m_time; entry.m_calls += m_calls; - assert (m_parent); + panic_unless (m_parent); if (m_parent->m_fcn_id != 0) { entry.m_parents.insert (m_parent->m_fcn_id); @@ -161,7 +160,6 @@ ++i; } - assert (i == n); octave_map retval; @@ -195,8 +193,8 @@ profiler::enter_function (const std::string& fcn) { // The enter class will check and only call us if the profiler is active. - assert (enabled ()); - assert (m_call_tree); + panic_unless (enabled ()); + panic_unless (m_call_tree); // If there is already an active function, add to its time before // pushing the new one. @@ -229,21 +227,23 @@ { if (m_active_fcn) { - assert (m_call_tree); - // FIXME: This assert statements doesn't make sense if profile() is called - // from within a function hierarchy to begin with. See bug #39587. - //assert (m_active_fcn != m_call_tree); + panic_unless (m_call_tree); + // FIXME: This panic_unless statements doesn't make sense if profile() + // is called from within a function hierarchy to begin with. + // See bug #39587. + // panic_unless (m_active_fcn != m_call_tree); - // Usually, if we are disabled this function is not even called. But the - // call disabling the profiler is an exception. So also check here + // Usually, if we are disabled this function is not even called. But + // the call disabling the profiler is an exception. So also check here // and only record the time if enabled. if (enabled ()) add_current_time (); fcn_index_map::iterator pos = m_fcn_index.find (fcn); - // FIXME: This assert statements doesn't make sense if profile() is called - // from within a function hierarchy to begin with. See bug #39587. - //assert (pos != m_fcn_index.end ()); + // FIXME: This panic_unless statements doesn't make sense if profile() + // is called from within a function hierarchy to begin with. + // See bug #39587. + // panic_unless (pos != m_fcn_index.end ()); m_active_fcn = m_active_fcn->exit (pos->second); // If this was an "inner call", we resume executing the parent function diff -r 103efb7e1600 -r 4392386b5ecb libinterp/parse-tree/profiler.h --- a/libinterp/parse-tree/profiler.h Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/parse-tree/profiler.h Thu Mar 03 13:37:10 2022 -0500 @@ -185,7 +185,8 @@ // Each function we see in the profiler is given a unique index (which // simply counts starting from 1). We thus have to map profiler-names to - // those indices. For all other stuff, we identify functions by their index. + // those indices. For all other stuff, we identify functions by their + // index. typedef std::vector function_set; typedef std::map fcn_index_map; @@ -198,7 +199,8 @@ tree_node *m_call_tree; tree_node *m_active_fcn; - // Store last timestamp we had, when the currently active function was called. + // Store last timestamp we had, when the currently active function was + // called. double m_last_time; // These are private as only the unwind-protecting inner class enter diff -r 103efb7e1600 -r 4392386b5ecb libinterp/parse-tree/pt-binop.h --- a/libinterp/parse-tree/pt-binop.h Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/parse-tree/pt-binop.h Thu Mar 03 13:37:10 2022 -0500 @@ -76,7 +76,8 @@ void mark_braindead_shortcircuit (void) { - if (m_etype == octave_value::op_el_and || m_etype == octave_value::op_el_or) + if (m_etype == octave_value::op_el_and + || m_etype == octave_value::op_el_or) { m_eligible_for_braindead_shortcircuit = true; diff -r 103efb7e1600 -r 4392386b5ecb libinterp/parse-tree/pt-classdef.cc --- a/libinterp/parse-tree/pt-classdef.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/parse-tree/pt-classdef.cc Thu Mar 03 13:37:10 2022 -0500 @@ -61,10 +61,9 @@ // part of an index expression. It is also not an identifier in // the syntax tree but we need to handle it as if it were. So // call the function here. - octave_function *f = tmp.function_value (true); - assert (f); + panic_unless (f); return f->call (tw, nargout); } diff -r 103efb7e1600 -r 4392386b5ecb libinterp/parse-tree/pt-colon.cc --- a/libinterp/parse-tree/pt-colon.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/parse-tree/pt-colon.cc Thu Mar 03 13:37:10 2022 -0500 @@ -42,7 +42,8 @@ tree_colon_expression *new_ce = new tree_colon_expression (m_base ? m_base->dup (scope) : nullptr, m_limit ? m_limit->dup (scope) : nullptr, - m_increment ? m_increment->dup (scope) : nullptr, + m_increment ? m_increment->dup (scope) + : nullptr, line (), column ()); new_ce->copy_base (*this); diff -r 103efb7e1600 -r 4392386b5ecb libinterp/parse-tree/pt-eval.cc --- a/libinterp/parse-tree/pt-eval.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/parse-tree/pt-eval.cc Thu Mar 03 13:37:10 2022 -0500 @@ -107,7 +107,7 @@ }; debugger (interpreter& interp, std::size_t level) - : m_interpreter (interp), m_level (level), m_debug_frame (0), + : m_interpreter (interp), m_level (level), m_execution_mode (EX_NORMAL), m_in_debug_repl (false) { } @@ -134,7 +134,6 @@ interpreter& m_interpreter; std::size_t m_level; - std::size_t m_debug_frame; execution_mode m_execution_mode; bool m_in_debug_repl; }; @@ -3491,7 +3490,7 @@ if (user_function.is_special_expr ()) { - assert (cmd_list->length () == 1); + panic_if (cmd_list->length () != 1); tree_statement *stmt = cmd_list->front (); @@ -4305,11 +4304,11 @@ { if (m_dbstep_flag == 1 || is_end_of_fcn_or_script) { - // We get here if we are doing a "dbstep" or a "dbstep N" and the - // count has reached 1 so that we must stop and return to debug - // prompt. Alternatively, "dbstep N" has been used but the end - // of the frame has been reached so we stop at the last line and - // return to prompt. + // We get here if we are doing a "dbstep" or a "dbstep N" and + // the count has reached 1 so that we must stop and return to + // debug prompt. Alternatively, "dbstep N" has been used but + // the end of the frame has been reached so we stop at the last + // line and return to prompt. break_on_this_statement = true; } @@ -5116,7 +5115,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} max_recursion_depth () @deftypefnx {} {@var{old_val} =} max_recursion_depth (@var{new_val}) -@deftypefnx {} {} max_recursion_depth (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} max_recursion_depth (@var{new_val}, "local") Query or set the internal limit on the number of times a function may be called recursively. @@ -5151,7 +5150,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} whos_line_format () @deftypefnx {} {@var{old_val} =} whos_line_format (@var{new_val}) -@deftypefnx {} {} whos_line_format (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} whos_line_format (@var{new_val}, "local") Query or set the format string used by the command @code{whos}. A full format string is: @@ -5232,7 +5231,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} silent_functions () @deftypefnx {} {@var{old_val} =} silent_functions (@var{new_val}) -@deftypefnx {} {} silent_functions (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} silent_functions (@var{new_val}, "local") Query or set the internal variable that controls whether internal output from a function is suppressed. @@ -5266,7 +5265,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} string_fill_char () @deftypefnx {} {@var{old_val} =} string_fill_char (@var{new_val}) -@deftypefnx {} {} string_fill_char (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} string_fill_char (@var{new_val}, "local") Query or set the internal variable used to pad all rows of a character matrix to the same length. @@ -5315,7 +5314,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} PS4 () @deftypefnx {} {@var{old_val} =} PS4 (@var{new_val}) -@deftypefnx {} {} PS4 (@var{new_val}, "local") +@deftypefnx {} {@var{old_val} =} PS4 (@var{new_val}, "local") Query or set the character string used to prefix output produced when echoing commands is enabled. diff -r 103efb7e1600 -r 4392386b5ecb libinterp/parse-tree/pt-exp.h --- a/libinterp/parse-tree/pt-exp.h Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/parse-tree/pt-exp.h Thu Mar 03 13:37:10 2022 -0500 @@ -89,7 +89,8 @@ int paren_count (void) const { return m_num_parens; } - bool is_postfix_indexed (void) const { return (m_postfix_index_type != '\0'); } + bool is_postfix_indexed (void) const + { return (m_postfix_index_type != '\0'); } char postfix_index (void) const { return m_postfix_index_type; } diff -r 103efb7e1600 -r 4392386b5ecb libinterp/parse-tree/pt-idx.cc --- a/libinterp/parse-tree/pt-idx.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/parse-tree/pt-idx.cc Thu Mar 03 13:37:10 2022 -0500 @@ -346,7 +346,7 @@ { octave_value_list retval; - assert (! m_args.empty ()); + panic_if (m_args.empty ()); auto p_args = m_args.begin (); auto p_arg_nm = m_arg_nm.begin (); diff -r 103efb7e1600 -r 4392386b5ecb libinterp/parse-tree/pt-pr-code.cc --- a/libinterp/parse-tree/pt-pr-code.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/parse-tree/pt-pr-code.cc Thu Mar 03 13:37:10 2022 -0500 @@ -1203,7 +1203,7 @@ void tree_print_code::indent (void) { - assert (m_curr_print_indent_level >= 0); + panic_unless (m_curr_print_indent_level >= 0); if (m_beginning_of_line) { diff -r 103efb7e1600 -r 4392386b5ecb libinterp/parse-tree/pt-select.h --- a/libinterp/parse-tree/pt-select.h Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/parse-tree/pt-select.h Thu Mar 03 13:37:10 2022 -0500 @@ -45,7 +45,8 @@ public: tree_if_clause (int l = -1, int c = -1) - : tree (l, c), m_expr (nullptr), m_list (nullptr), m_lead_comm (nullptr) { } + : tree (l, c), m_expr (nullptr), m_list (nullptr), m_lead_comm (nullptr) + { } tree_if_clause (tree_statement_list *sl, comment_list *lc = nullptr, int l = -1, int c = -1) @@ -130,7 +131,8 @@ tree_if_command (tree_if_command_list *lst, comment_list *lc, comment_list *tc, int l = -1, int c = -1) - : tree_command (l, c), m_list (lst), m_lead_comm (lc), m_trail_comm (tc) { } + : tree_command (l, c), m_list (lst), m_lead_comm (lc), m_trail_comm (tc) + { } // No copying! @@ -170,7 +172,8 @@ public: tree_switch_case (int l = -1, int c = -1) - : tree (l, c), m_label (nullptr), m_list (nullptr), m_lead_comm (nullptr) { } + : tree (l, c), m_label (nullptr), m_list (nullptr), m_lead_comm (nullptr) + { } tree_switch_case (tree_statement_list *sl, comment_list *lc = nullptr, int l = -1, int c = -1) diff -r 103efb7e1600 -r 4392386b5ecb libinterp/parse-tree/pt-tm-const.cc --- a/libinterp/parse-tree/pt-tm-const.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/parse-tree/pt-tm-const.cc Thu Mar 03 13:37:10 2022 -0500 @@ -608,7 +608,8 @@ { // Optimize all scalars case. TYPE result (m_dv); - assert (static_cast (result.numel ()) == row.length ()); + panic_unless (static_cast (result.numel ()) + == row.length ()); octave_idx_type i = 0; for (const auto& elt : row) result(i++) = octave_value_extract (elt); diff -r 103efb7e1600 -r 4392386b5ecb libinterp/parse-tree/token.cc --- a/libinterp/parse-tree/token.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/libinterp/parse-tree/token.cc Thu Mar 03 13:37:10 2022 -0500 @@ -29,6 +29,7 @@ #include +#include "error.h" #include "token.h" namespace octave @@ -95,14 +96,14 @@ std::string token::text (void) const { - assert (m_type_tag == string_token); + panic_if (m_type_tag != string_token); return *m_tok_info.m_str; } octave_value token::number (void) const { - assert (m_type_tag == numeric_token); + panic_if (m_type_tag != numeric_token); return *m_tok_info.m_num; } @@ -115,21 +116,21 @@ token::end_tok_type token::ettype (void) const { - assert (m_type_tag == ettype_token); + panic_if (m_type_tag != ettype_token); return m_tok_info.m_et; } std::string token::superclass_method_name (void) const { - assert (m_type_tag == scls_name_token); + panic_if (m_type_tag != scls_name_token); return m_tok_info.m_superclass_info->m_method_name; } std::string token::superclass_class_name (void) const { - assert (m_type_tag == scls_name_token); + panic_if (m_type_tag != scls_name_token); return m_tok_info.m_superclass_info->m_class_name; } diff -r 103efb7e1600 -r 4392386b5ecb liboctave/system/lo-sysdep.cc --- a/liboctave/system/lo-sysdep.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/liboctave/system/lo-sysdep.cc Thu Mar 03 13:37:10 2022 -0500 @@ -699,17 +699,19 @@ = (oct_ascii_dir + file_ops::dir_sep_str () + crypto::hash ("SHA1", orig_file_name)); + // FIXME: This is just to check if the file exists. Use a more efficient + // method. std::string abs_filename_hash = canonicalize_file_name (filename_hash); if (! abs_filename_hash.empty ()) sys::unlink (filename_hash); - wchar_t w_filename_hash[filename_hash.length ()+1] = {0}; + // At this point, we know that we have only ASCII characters. + // So instead of converting, just copy the characters to std::wstring. + std::wstring w_filename_hash (filename_hash.begin (), + filename_hash.end ()); - for (std::size_t i=0; i < filename_hash.length (); i++) - w_filename_hash[i] = filename_hash.at (i); - - if (CreateHardLinkW (w_filename_hash, w_orig_file_name, nullptr)) + if (CreateHardLinkW (w_filename_hash.c_str (), w_orig_file_name, nullptr)) return filename_hash; #else diff -r 103efb7e1600 -r 4392386b5ecb liboctave/util/f2c-main.c --- a/liboctave/util/f2c-main.c Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -//////////////////////////////////////////////////////////////////////// -// -// Copyright (C) 1996-2022 The Octave Project Developers -// -// See the file COPYRIGHT.md in the top-level directory of this -// distribution or . -// -// 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 -// . -// -//////////////////////////////////////////////////////////////////////// - -#if defined (HAVE_CONFIG_H) -# include "config.h" -#endif - -#include - -/* Dummy Fortran main declaration, needed in order to link to some - Fortran libraries. See the AC_F77_DUMMY_MAIN macro documentation. - This function should never be called. */ - -#if defined (F77_DUMMY_MAIN) -# if defined (__cplusplus) -extern "C" -# endif -int F77_DUMMY_MAIN () { assert (0); return 1; } -#endif diff -r 103efb7e1600 -r 4392386b5ecb liboctave/util/f77-dummy-main.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/liboctave/util/f77-dummy-main.cc Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,47 @@ +//////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 1996-2022 The Octave Project Developers +// +// See the file COPYRIGHT.md in the top-level directory of this +// distribution or . +// +// 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 +// . +// +//////////////////////////////////////////////////////////////////////// + +#if defined (HAVE_CONFIG_H) +# include "config.h" +#endif + +#include + +// Dummy Fortran main declaration, needed in order to link to some +// Fortran libraries. See the AC_F77_DUMMY_MAIN macro documentation. +// This function should never be called. + +#if defined (F77_DUMMY_MAIN) + +extern "C" +int +F77_DUMMY_MAIN (void) +{ + assert (0); + + return 1; +} + +#endif diff -r 103efb7e1600 -r 4392386b5ecb liboctave/util/lo-array-errwarn.cc --- a/liboctave/util/lo-array-errwarn.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/liboctave/util/lo-array-errwarn.cc Thu Mar 03 13:37:10 2022 -0500 @@ -301,21 +301,6 @@ "matrix singular to machine precision, rcond = %g", rcond); } } - - // DEPRECATED in Octave 6. - - // Complain of an index that is out of range, but we don't know matrix size - void - err_index_out_of_range (int nd, int dim, octave_idx_type idx, - octave_idx_type ext) - { - // The dim_vector setting here doesn't really make sense. However, - // this function has been deprecated and will be removed in version - // 8, so there's no need to attempt to fix it. - - throw out_of_range (std::to_string (idx), nd, dim, ext, - dim_vector (1, 1, 1, 1, 1, 1, 1)); - } } /* Tests in test/index.tst */ diff -r 103efb7e1600 -r 4392386b5ecb liboctave/util/lo-array-errwarn.h --- a/liboctave/util/lo-array-errwarn.h Thu Mar 03 13:31:24 2022 -0500 +++ b/liboctave/util/lo-array-errwarn.h Thu Mar 03 13:37:10 2022 -0500 @@ -131,13 +131,6 @@ err_index_out_of_range (int ndims, int dim, octave_idx_type idx, octave_idx_type ext, const dim_vector& dv); -#if defined (OCTAVE_PROVIDE_DEPRECATED_SYMBOLS) - OCTAVE_DEPRECATED (6, "use err_index_out_of_range (int, int, octave_idx_type, octave_idx_type, const dim_vector&) instead") - OCTAVE_NORETURN extern OCTAVE_API void - err_index_out_of_range (int ndims, int dim, octave_idx_type idx, - octave_idx_type ext); -#endif - OCTAVE_NORETURN extern OCTAVE_API void err_del_index_out_of_range (bool is1d, octave_idx_type iext, octave_idx_type ext); diff -r 103efb7e1600 -r 4392386b5ecb liboctave/util/lo-cutils.c --- a/liboctave/util/lo-cutils.c Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -//////////////////////////////////////////////////////////////////////// -// -// Copyright (C) 2000-2022 The Octave Project Developers -// -// See the file COPYRIGHT.md in the top-level directory of this -// distribution or . -// -// 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 -// . -// -//////////////////////////////////////////////////////////////////////// - -#if defined (HAVE_CONFIG_H) -# include "config.h" -#endif - -#include -#include - -#include "lo-cutils.h" - -OCTAVE_API void -octave_qsort (void *base, size_t n, size_t size, - int (*cmp) (const void *, const void *)) -{ - qsort (base, n, size, cmp); -} - -OCTAVE_API int -octave_strcasecmp (const char *s1, const char *s2) -{ - return strcasecmp (s1, s2); -} - -OCTAVE_API int -octave_strncasecmp (const char *s1, const char *s2, size_t n) -{ - return strncasecmp (s1, s2, n); -} diff -r 103efb7e1600 -r 4392386b5ecb liboctave/util/lo-cutils.h --- a/liboctave/util/lo-cutils.h Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -//////////////////////////////////////////////////////////////////////// -// -// Copyright (C) 2012-2022 The Octave Project Developers -// -// See the file COPYRIGHT.md in the top-level directory of this -// distribution or . -// -// 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 -// . -// -//////////////////////////////////////////////////////////////////////// - -#if ! defined (octave_lo_cutils_h) -#define octave_lo_cutils_h 1 - -#include "octave-config.h" - -#if defined (__cplusplus) -#include -using std::size_t; -extern "C" { -#else -#include -#endif - -OCTAVE_API void -octave_qsort (void *base, size_t n, size_t size, - int (*cmp) (const void *, const void *)); - -OCTAVE_API int -octave_strcasecmp (const char *s1, const char *s2); - -OCTAVE_API int -octave_strncasecmp (const char *s1, const char *s2, size_t n); - -#if defined (__cplusplus) -} -#endif - -#endif diff -r 103efb7e1600 -r 4392386b5ecb liboctave/util/lo-utils.h --- a/liboctave/util/lo-utils.h Thu Mar 03 13:31:24 2022 -0500 +++ b/liboctave/util/lo-utils.h Thu Mar 03 13:37:10 2022 -0500 @@ -33,7 +33,6 @@ #include #include -#include "lo-cutils.h" #include "oct-cmplx.h" #include "quit.h" diff -r 103efb7e1600 -r 4392386b5ecb liboctave/util/module.mk --- a/liboctave/util/module.mk Thu Mar 03 13:31:24 2022 -0500 +++ b/liboctave/util/module.mk Thu Mar 03 13:37:10 2022 -0500 @@ -9,7 +9,6 @@ %reldir%/file-info.h \ %reldir%/glob-match.h \ %reldir%/lo-array-errwarn.h \ - %reldir%/lo-cutils.h \ %reldir%/lo-hash.h \ %reldir%/lo-ieee.h \ %reldir%/lo-regexp.h \ @@ -51,8 +50,6 @@ %reldir%/r1mach.f UTIL_C_SRC = \ - %reldir%/f2c-main.c \ - %reldir%/lo-cutils.c \ %reldir%/blaswrap.c \ %reldir%/f77-fcn.c \ %reldir%/lo-error.c \ @@ -64,6 +61,7 @@ %reldir%/cmd-edit.cc \ %reldir%/cmd-hist.cc \ %reldir%/data-conv.cc \ + %reldir%/f77-dummy-main.cc \ %reldir%/file-info.cc \ %reldir%/glob-match.cc \ %reldir%/kpse.cc \ @@ -75,6 +73,7 @@ %reldir%/quit.cc \ %reldir%/oct-atomic.c \ %reldir%/oct-base64.cc \ + %reldir%/oct-cmplx.cc \ %reldir%/oct-glob.cc \ %reldir%/oct-inttypes.cc \ %reldir%/oct-mutex.cc \ diff -r 103efb7e1600 -r 4392386b5ecb liboctave/util/oct-cmplx.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/liboctave/util/oct-cmplx.cc Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,201 @@ +//////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 1995-2022 The Octave Project Developers +// +// See the file COPYRIGHT.md in the top-level directory of this +// distribution or . +// +// 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 +// . +// +//////////////////////////////////////////////////////////////////////// + +#if defined (HAVE_CONFIG_H) +# include "config.h" +#endif + +#include + +// For complex-complex and complex-real comparisons, Octave uses the following +// ordering: compare absolute values first; if they match, compare phase +// angles. This is partially inconsistent with M*b, which compares complex +// numbers only by their real parts; OTOH, it uses the same definition for +// max/min and sort. The abs/arg comparison is definitely more useful (the +// other one is emulated rather trivially), so let's be consistent and use that +// all over. + +// The standard C library function arg() returns [-pi,pi], which creates a +// non-unique representation for numbers along the negative real axis branch +// cut. Change this to principal value (-pi,pi] by mapping -pi to pi. + +// General templated code for all (double, float) complex operators +#define DEF_COMPLEXR_COMP(OP, OPS) \ + template \ + bool operator OP (const std::complex& a, const std::complex& b) \ + { \ + OCTAVE_FLOAT_TRUNCATE const T ax = std::abs (a); \ + OCTAVE_FLOAT_TRUNCATE const T bx = std::abs (b); \ + if (ax == bx) \ + { \ + OCTAVE_FLOAT_TRUNCATE const T ay = std::arg (a); \ + OCTAVE_FLOAT_TRUNCATE const T by = std::arg (b); \ + if (ay == static_cast (-M_PI)) \ + { \ + if (by != static_cast (-M_PI)) \ + return static_cast (M_PI) OP by; \ + } \ + else if (by == static_cast (-M_PI)) \ + { \ + return ay OP static_cast (M_PI); \ + } \ + return ay OP by; \ + } \ + else \ + return ax OPS bx; \ + } \ + template \ + bool operator OP (const std::complex& a, T b) \ + { \ + OCTAVE_FLOAT_TRUNCATE const T ax = std::abs (a); \ + OCTAVE_FLOAT_TRUNCATE const T bx = std::abs (b); \ + if (ax == bx) \ + { \ + OCTAVE_FLOAT_TRUNCATE const T ay = std::arg (a); \ + if (ay == static_cast (-M_PI)) \ + return static_cast (M_PI) OP 0; \ + return ay OP 0; \ + } \ + else \ + return ax OPS bx; \ + } \ + template \ + bool operator OP (T a, const std::complex& b) \ + { \ + OCTAVE_FLOAT_TRUNCATE const T ax = std::abs (a); \ + OCTAVE_FLOAT_TRUNCATE const T bx = std::abs (b); \ + if (ax == bx) \ + { \ + OCTAVE_FLOAT_TRUNCATE const T by = std::arg (b); \ + if (by == static_cast (-M_PI)) \ + return 0 OP static_cast (M_PI); \ + return 0 OP by; \ + } \ + else \ + return ax OPS bx; \ + } + +#if defined (__APPLE__) + // Apple specializations + + // FIXME: Apple's math library chooses to return a different value for + // std::arg with floats than the constant static_cast (M_PI). + // Work around this obtuse behavior by providing the constant A_PI which + // is Apple's definition of the constant PI for float variables. + // The template code for doubles is the same as that for UNIX platforms. + // Use C++ template specialization to add specific functions for float + // values that make use of A_PI. + + // Apple version of PI in single precision +# define A_PI 3.1415925025939941f + +# define INST_SPECIAL_COMPLEXR_COMP(OP, OPS) \ + template <> OCTAVE_API \ + bool operator OP (const std::complex& a, \ + const std::complex& b) \ + { \ + OCTAVE_FLOAT_TRUNCATE const float ax = std::abs (a); \ + OCTAVE_FLOAT_TRUNCATE const float bx = std::abs (b); \ + if (ax == bx) \ + { \ + OCTAVE_FLOAT_TRUNCATE const float ay = std::arg (a); \ + OCTAVE_FLOAT_TRUNCATE const float by = std::arg (b); \ + if (ay == -A_PI) \ + { \ + if (by != -A_PI) \ + return static_cast (M_PI) OP by; \ + } \ + else if (by == -A_PI) \ + { \ + return ay OP static_cast (M_PI); \ + } \ + return ay OP by; \ + } \ + else \ + return ax OPS bx; \ + } \ + template <> OCTAVE_API \ + bool operator OP (const std::complex& a, float b) \ + { \ + OCTAVE_FLOAT_TRUNCATE const float ax = std::abs (a); \ + OCTAVE_FLOAT_TRUNCATE const float bx = std::abs (b); \ + if (ax == bx) \ + { \ + OCTAVE_FLOAT_TRUNCATE const float ay = std::arg (a); \ + if (ay == -A_PI) \ + return static_cast (M_PI) OP 0; \ + return ay OP 0; \ + } \ + else \ + return ax OPS bx; \ + } \ + template <> OCTAVE_API \ + bool operator OP (float a, const std::complex& b) \ + { \ + OCTAVE_FLOAT_TRUNCATE const float ax = std::abs (a); \ + OCTAVE_FLOAT_TRUNCATE const float bx = std::abs (b); \ + if (ax == bx) \ + { \ + OCTAVE_FLOAT_TRUNCATE const float by = std::arg (b); \ + if (by == -A_PI) \ + return 0 OP static_cast (M_PI); \ + return 0 OP by; \ + } \ + else \ + return ax OPS bx; \ + } + +#endif + +DEF_COMPLEXR_COMP (>, >) +DEF_COMPLEXR_COMP (<, <) +DEF_COMPLEXR_COMP (>=, >) +DEF_COMPLEXR_COMP (<=, <) + + +// Instantiate templates + +# define INST_COMPLEXR_COMP(OP, T) \ + template OCTAVE_API bool operator OP (const std::complex& a, \ + const std::complex& b); \ + template OCTAVE_API bool operator OP (const std::complex& a, T b); \ + template OCTAVE_API bool operator OP (T a, const std::complex& b); + +INST_COMPLEXR_COMP (>, double) +INST_COMPLEXR_COMP (<, double) +INST_COMPLEXR_COMP (>=, double) +INST_COMPLEXR_COMP (<=, double) + +#if defined (__APPLE__) +INST_SPECIAL_COMPLEXR_COMP (>, >) +INST_SPECIAL_COMPLEXR_COMP (<, <) +INST_SPECIAL_COMPLEXR_COMP (>=, >) +INST_SPECIAL_COMPLEXR_COMP (<=, <) +#else +INST_COMPLEXR_COMP (>, float) +INST_COMPLEXR_COMP (<, float) +INST_COMPLEXR_COMP (>=, float) +INST_COMPLEXR_COMP (<=, float) +#endif diff -r 103efb7e1600 -r 4392386b5ecb liboctave/util/oct-cmplx.h --- a/liboctave/util/oct-cmplx.h Thu Mar 03 13:31:24 2022 -0500 +++ b/liboctave/util/oct-cmplx.h Thu Mar 03 13:37:10 2022 -0500 @@ -33,206 +33,34 @@ typedef std::complex Complex; typedef std::complex FloatComplex; -// For complex-complex and complex-real comparisons, Octave uses the following -// ordering: compare absolute values first; if they match, compare phase -// angles. This is partially inconsistent with M*b, which compares complex -// numbers only by their real parts; OTOH, it uses the same definition for -// max/min and sort. The abs/arg comparison is definitely more useful (the -// other one is emulated rather trivially), so let's be consistent and use that -// all over. - -// The standard C library function arg() returns [-pi,pi], which creates a -// non-unique representation for numbers along the negative real axis branch -// cut. Change this to principal value (-pi,pi] by mapping -pi to pi. - -#if ! defined (__APPLE__) +// template declaration +# define DECL_COMPLEXR_COMP(OP) \ + template bool operator OP (const std::complex& a, \ + const std::complex& b); \ + template bool operator OP (const std::complex& a, T b); \ + template bool operator OP (T a, const std::complex& b); - // General templated code for all (double, float) complex operators -# define DEF_COMPLEXR_COMP(OP, OPS) \ - template \ - inline bool operator OP (const std::complex& a, \ - const std::complex& b) \ - { \ - OCTAVE_FLOAT_TRUNCATE const T ax = std::abs (a); \ - OCTAVE_FLOAT_TRUNCATE const T bx = std::abs (b); \ - if (ax == bx) \ - { \ - OCTAVE_FLOAT_TRUNCATE const T ay = std::arg (a); \ - OCTAVE_FLOAT_TRUNCATE const T by = std::arg (b); \ - if (ay == static_cast (-M_PI)) \ - { \ - if (by != static_cast (-M_PI)) \ - return static_cast (M_PI) OP by; \ - } \ - else if (by == static_cast (-M_PI)) \ - { \ - return ay OP static_cast (M_PI); \ - } \ - return ay OP by; \ - } \ - else \ - return ax OPS bx; \ - } \ - template \ - inline bool operator OP (const std::complex& a, T b) \ - { \ - OCTAVE_FLOAT_TRUNCATE const T ax = std::abs (a); \ - OCTAVE_FLOAT_TRUNCATE const T bx = std::abs (b); \ - if (ax == bx) \ - { \ - OCTAVE_FLOAT_TRUNCATE const T ay = std::arg (a); \ - if (ay == static_cast (-M_PI)) \ - return static_cast (M_PI) OP 0; \ - return ay OP 0; \ - } \ - else \ - return ax OPS bx; \ - } \ - template \ - inline bool operator OP (T a, const std::complex& b) \ - { \ - OCTAVE_FLOAT_TRUNCATE const T ax = std::abs (a); \ - OCTAVE_FLOAT_TRUNCATE const T bx = std::abs (b); \ - if (ax == bx) \ - { \ - OCTAVE_FLOAT_TRUNCATE const T by = std::arg (b); \ - if (by == static_cast (-M_PI)) \ - return 0 OP static_cast (M_PI); \ - return 0 OP by; \ - } \ - else \ - return ax OPS bx; \ - } - -#else - // Apple specialization. - - // FIXME: Apple's math library chooses to return a different value for - // std::arg with floats than the constant static_cast (M_PI). - // Work around this obtuse behavior by providing the constant A_PI which - // is Apple's definition of the constant PI for float variables. - // The template code for doubles is the same as that for UNIX platforms. - // Use C++ template specialization to add specific functions for float - // values that make use of A_PI. - - // Apple version of PI -# define A_PI 3.1415925025939941f +DECL_COMPLEXR_COMP(>) +DECL_COMPLEXR_COMP(<) +DECL_COMPLEXR_COMP(>=) +DECL_COMPLEXR_COMP(<=) -# define DEF_COMPLEXR_COMP(OP, OPS) \ - template \ - inline bool operator OP (const std::complex& a, \ - const std::complex& b) \ - { \ - OCTAVE_FLOAT_TRUNCATE const T ax = std::abs (a); \ - OCTAVE_FLOAT_TRUNCATE const T bx = std::abs (b); \ - if (ax == bx) \ - { \ - OCTAVE_FLOAT_TRUNCATE const T ay = std::arg (a); \ - OCTAVE_FLOAT_TRUNCATE const T by = std::arg (b); \ - if (ay == static_cast (-M_PI)) \ - { \ - if (by != static_cast (-M_PI)) \ - return static_cast (M_PI) OP by; \ - } \ - else if (by == static_cast (-M_PI)) \ - { \ - return ay OP static_cast (M_PI); \ - } \ - return ay OP by; \ - } \ - else \ - return ax OPS bx; \ - } \ - template \ - inline bool operator OP (const std::complex& a, T b) \ - { \ - OCTAVE_FLOAT_TRUNCATE const T ax = std::abs (a); \ - OCTAVE_FLOAT_TRUNCATE const T bx = std::abs (b); \ - if (ax == bx) \ - { \ - OCTAVE_FLOAT_TRUNCATE const T ay = std::arg (a); \ - if (ay == static_cast (-M_PI)) \ - return static_cast (M_PI) OP 0; \ - return ay OP 0; \ - } \ - else \ - return ax OPS bx; \ - } \ - template \ - inline bool operator OP (T a, const std::complex& b) \ - { \ - OCTAVE_FLOAT_TRUNCATE const T ax = std::abs (a); \ - OCTAVE_FLOAT_TRUNCATE const T bx = std::abs (b); \ - if (ax == bx) \ - { \ - OCTAVE_FLOAT_TRUNCATE const T by = std::arg (b); \ - if (by == static_cast (-M_PI)) \ - return 0 OP static_cast (M_PI); \ - return 0 OP by; \ - } \ - else \ - return ax OPS bx; \ - } \ - template <> \ - inline bool operator OP (const std::complex& a, \ - const std::complex& b) \ - { \ - OCTAVE_FLOAT_TRUNCATE const float ax = std::abs (a); \ - OCTAVE_FLOAT_TRUNCATE const float bx = std::abs (b); \ - if (ax == bx) \ - { \ - OCTAVE_FLOAT_TRUNCATE const float ay = std::arg (a); \ - OCTAVE_FLOAT_TRUNCATE const float by = std::arg (b); \ - if (ay == -A_PI) \ - { \ - if (by != -A_PI) \ - return static_cast (M_PI) OP by; \ - } \ - else if (by == -A_PI) \ - { \ - return ay OP static_cast (M_PI); \ - } \ - return ay OP by; \ - } \ - else \ - return ax OPS bx; \ - } \ - template <> \ - inline bool operator OP (const std::complex& a, float b) \ - { \ - OCTAVE_FLOAT_TRUNCATE const float ax = std::abs (a); \ - OCTAVE_FLOAT_TRUNCATE const float bx = std::abs (b); \ - if (ax == bx) \ - { \ - OCTAVE_FLOAT_TRUNCATE const float ay = std::arg (a); \ - if (ay == -A_PI) \ - return static_cast (M_PI) OP 0; \ - return ay OP 0; \ - } \ - else \ - return ax OPS bx; \ - } \ - template <> \ - inline bool operator OP (float a, const std::complex& b) \ - { \ - OCTAVE_FLOAT_TRUNCATE const float ax = std::abs (a); \ - OCTAVE_FLOAT_TRUNCATE const float bx = std::abs (b); \ - if (ax == bx) \ - { \ - OCTAVE_FLOAT_TRUNCATE const float by = std::arg (b); \ - if (by == -A_PI) \ - return 0 OP static_cast (M_PI); \ - return 0 OP by; \ - } \ - else \ - return ax OPS bx; \ - } +// extern template instantiations +# define EXT_INST_COMPLEXR_COMP(OP, T) \ + extern template OCTAVE_API \ + bool operator OP (const std::complex& a, const std::complex& b); \ + extern template OCTAVE_API \ + bool operator OP (const std::complex& a, T b); \ + extern template OCTAVE_API \ + bool operator OP (T a, const std::complex& b); + +EXT_INST_COMPLEXR_COMP(>, double) +EXT_INST_COMPLEXR_COMP(>, float) +EXT_INST_COMPLEXR_COMP(<, double) +EXT_INST_COMPLEXR_COMP(<, float) +EXT_INST_COMPLEXR_COMP(>=, double) +EXT_INST_COMPLEXR_COMP(>=, float) +EXT_INST_COMPLEXR_COMP(<=, double) +EXT_INST_COMPLEXR_COMP(<=, float) #endif - -DEF_COMPLEXR_COMP (>, >) -DEF_COMPLEXR_COMP (<, <) -DEF_COMPLEXR_COMP (<=, <) -DEF_COMPLEXR_COMP (>=, >) - -#endif diff -r 103efb7e1600 -r 4392386b5ecb liboctave/util/quit.cc --- a/liboctave/util/quit.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/liboctave/util/quit.cc Thu Mar 03 13:37:10 2022 -0500 @@ -37,32 +37,11 @@ sig_atomic_t octave_interrupt_state = 0; -// DEPRECATED in Octave 6. -// This variable should never have been public. -sig_atomic_t octave_exception_state = 0; -// Use this variable internally until the functions that use it can be -// removed. -static sig_atomic_t internal_exception_state; - volatile sig_atomic_t octave_signal_caught = 0; void (*octave_signal_hook) (void) = nullptr; void (*octave_interrupt_hook) (void) = nullptr; -// DEPRECATED in Octave 6. -void (*octave_bad_alloc_hook) (void) = nullptr; - -// The octave_exception enum values were DEPRECATED in Octave 6. -// Use these values internally until the functions that use them can be -// removed. -enum octave_internal_exception -{ - octave_internal_no_exception = 0, - octave_internal_exec_exception = 1, - octave_internal_alloc_exception = 3, - octave_internal_quit_exception = 4 -}; - namespace octave { std::string execution_exception::stack_trace (void) const @@ -130,61 +109,3 @@ throw octave::interrupt_exception (); } } - -// DEPRECATED in Octave 6 -void -octave_throw_interrupt_exception (void) -{ - if (octave_interrupt_hook) - octave_interrupt_hook (); - - throw octave::interrupt_exception (); -} - -// DEPRECATED in Octave 6 -void -octave_throw_execution_exception (void) -{ - // FIXME: would a hook function be useful here? - - internal_exception_state = octave_internal_exec_exception; - - throw octave::execution_exception (); -} - -// DEPRECATED in Octave 6 -void -octave_throw_bad_alloc (void) -{ - internal_exception_state = octave_internal_alloc_exception; - - throw std::bad_alloc (); -} - -// DEPRECATED in Octave 6 -void -octave_rethrow_exception (void) -{ - if (octave_interrupt_state) - { - octave_interrupt_state = -1; - - throw octave::interrupt_exception (); - } - else - { - switch (internal_exception_state) - { - case octave_internal_exec_exception: - throw octave::execution_exception (); - break; - - case octave_internal_alloc_exception: - throw std::bad_alloc (); - break; - - default: - break; - } - } -} diff -r 103efb7e1600 -r 4392386b5ecb liboctave/util/quit.h --- a/liboctave/util/quit.h Thu Mar 03 13:31:24 2022 -0500 +++ b/liboctave/util/quit.h Thu Mar 03 13:37:10 2022 -0500 @@ -224,29 +224,10 @@ */ extern OCTAVE_API sig_atomic_t octave_interrupt_state; -#if defined (OCTAVE_PROVIDE_DEPRECATED_SYMBOLS) -OCTAVE_DEPRECATED (6, "'octave_exception_state' is an obsolete internal variable; any uses should be removed") -extern OCTAVE_API sig_atomic_t octave_exception_state; -#endif - extern OCTAVE_API volatile sig_atomic_t octave_signal_caught; extern OCTAVE_API void octave_handle_signal (void); -#if defined (OCTAVE_PROVIDE_DEPRECATED_SYMBOLS) -OCTAVE_DEPRECATED (6, "use 'throw octave::interrupt_exception' instead") -OCTAVE_NORETURN extern OCTAVE_API void octave_throw_interrupt_exception (void); - -OCTAVE_DEPRECATED (6, "use 'throw octave::execution_exception' instead") -OCTAVE_NORETURN extern OCTAVE_API void octave_throw_execution_exception (void); - -OCTAVE_DEPRECATED (6, "use 'throw std::bad_alloc' instead") -OCTAVE_NORETURN extern OCTAVE_API void octave_throw_bad_alloc (void); - -OCTAVE_DEPRECATED (6, "use 'throw' instead") -extern OCTAVE_API void octave_rethrow_exception (void); -#endif - #if defined (__cplusplus) inline void octave_quit (void) @@ -312,11 +293,6 @@ extern OCTAVE_API void (*octave_signal_hook) (void); extern OCTAVE_API void (*octave_interrupt_hook) (void); -#if defined (OCTAVE_PROVIDE_DEPRECATED_SYMBOLS) -OCTAVE_DEPRECATED (6, "'octave_bad_alloc_hook' is obsolete and no longer used") -extern OCTAVE_API void (*octave_bad_alloc_hook) (void); #endif #endif - -#endif diff -r 103efb7e1600 -r 4392386b5ecb liboctave/util/str-vec.cc --- a/liboctave/util/str-vec.cc Thu Mar 03 13:31:24 2022 -0500 +++ b/liboctave/util/str-vec.cc Thu Mar 03 13:37:10 2022 -0500 @@ -244,7 +244,6 @@ for (octave_idx_type row = 0; row < nr; row++) { count = row; - octave_idx_type pos = 0; // Print the next row. @@ -264,7 +263,6 @@ octave_idx_type spaces_to_pad = max_name_length - name_length; for (octave_idx_type i = 0; i < spaces_to_pad; i++) os << ' '; - pos += max_name_length; } os << "\n"; } diff -r 103efb7e1600 -r 4392386b5ecb liboctave/wrappers/module.mk --- a/liboctave/wrappers/module.mk Thu Mar 03 13:31:24 2022 -0500 +++ b/liboctave/wrappers/module.mk Thu Mar 03 13:37:10 2022 -0500 @@ -24,6 +24,7 @@ %reldir%/set-program-name-wrapper.h \ %reldir%/signal-wrappers.h \ %reldir%/stat-wrappers.h \ + %reldir%/strcase-wrappers.h \ %reldir%/strdup-wrapper.h \ %reldir%/strftime-wrapper.h \ %reldir%/strmode-wrapper.h \ @@ -67,6 +68,7 @@ %reldir%/set-program-name-wrapper.c \ %reldir%/signal-wrappers.c \ %reldir%/stat-wrappers.c \ + %reldir%/strcase-wrappers.c \ %reldir%/strdup-wrapper.c \ %reldir%/strftime-wrapper.c \ %reldir%/strmode-wrapper.c \ diff -r 103efb7e1600 -r 4392386b5ecb liboctave/wrappers/strcase-wrappers.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/liboctave/wrappers/strcase-wrappers.c Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,44 @@ +//////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2022 The Octave Project Developers +// +// See the file COPYRIGHT.md in the top-level directory of this +// distribution or . +// +// 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 +// . +// +//////////////////////////////////////////////////////////////////////// + +#if defined (HAVE_CONFIG_H) +# include "config.h" +#endif + +#include + +#include "strcase-wrappers.h" + +OCTAVE_API int +octave_strcasecmp (const char *s1, const char *s2) +{ + return strcasecmp (s1, s2); +} + +OCTAVE_API int +octave_strncasecmp (const char *s1, const char *s2, size_t n) +{ + return strncasecmp (s1, s2, n); +} diff -r 103efb7e1600 -r 4392386b5ecb liboctave/wrappers/strcase-wrappers.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/liboctave/wrappers/strcase-wrappers.h Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,49 @@ +//////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2022 The Octave Project Developers +// +// See the file COPYRIGHT.md in the top-level directory of this +// distribution or . +// +// 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 +// . +// +//////////////////////////////////////////////////////////////////////// + +#if ! defined (octave_strcase_wrappers_h) +#define octave_strcase_wrappers_h 1 + +#include "octave-config.h" + +#if defined (__cplusplus) +#include +using std::size_t; +extern "C" { +#else +#include +#endif + +OCTAVE_API int +octave_strcasecmp (const char *s1, const char *s2); + +OCTAVE_API int +octave_strncasecmp (const char *s1, const char *s2, size_t n); + +#if defined (__cplusplus) +} +#endif + +#endif diff -r 103efb7e1600 -r 4392386b5ecb oct-conf-post-private.in.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/oct-conf-post-private.in.h Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,112 @@ +//////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 1993-2022 The Octave Project Developers +// +// See the file COPYRIGHT.md in the top-level directory of this +// distribution or . +// +// 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 +// . +// +//////////////////////////////////////////////////////////////////////// + +#if ! defined (HAVE_DEV_T) +typedef short dev_t; +#endif + +#if ! defined (HAVE_INO_T) +typedef unsigned long ino_t; +#endif + +#if defined (_MSC_VER) +# define __WIN32__ 1 +# define WIN32 1 + /* missing parameters in macros */ +# pragma warning (disable: 4003) + /* missing implementations in template instantiation */ +# pragma warning (disable: 4996) + /* deprecated function names (FIXME: ???) */ +# pragma warning (disable: 4661) +#endif + +#if defined (__APPLE__) && defined (__MACH__) +# define OCTAVE_USE_OS_X_API 1 +#endif + +/* Silence deprecated API warning from Apple OS > 10.14 */ +#if defined (__APPLE__) && defined (__MACH__) && defined (HAVE_OPENGL) +# define GL_SILENCE_DEPRECATION 1 +#endif + +/* Define to 1 if we expect to have , Sleep, etc. */ +#if defined (__WIN32__) && ! defined (__CYGWIN__) +# define OCTAVE_USE_WINDOWS_API 1 +#endif + +#if defined (OCTAVE_USE_WINDOWS_API) +# define OCTAVE_HAVE_WINDOWS_FILESYSTEM 1 +#elif defined (__CYGWIN__) +# define OCTAVE_HAVE_WINDOWS_FILESYSTEM 1 +# define OCTAVE_HAVE_POSIX_FILESYSTEM 1 +#else +# define OCTAVE_HAVE_POSIX_FILESYSTEM 1 +#endif + +#if defined (__MINGW32__) + /* We need to include this header or __MSVCRT_VERSION__ might not be defined + to the correct value */ +# include <_mingw.h> +#endif +/* assume that Windows will support UTF-8 locales when using UCRT */ +#if defined (__MSVCRT_VERSION__) && __MSVCRT_VERSION__ == 0x0E00 +# define OCTAVE_HAVE_WINDOWS_UTF8_LOCALE 1 +#endif + +/* sigsetjmp is a macro, not a function. */ +#if defined (sigsetjmp) && defined (HAVE_SIGLONGJMP) +# define OCTAVE_HAVE_SIG_JUMP 1 +#endif + +/* To be able to use long doubles for 64-bit mixed arithmetics, we need + them at least 80 bits wide and we need roundl declared in math.h. + FIXME: Maybe substitute this by a more precise check in the future? */ +#if (SIZEOF_LONG_DOUBLE >= 10) && defined (HAVE_ROUNDL) +# define OCTAVE_INT_USE_LONG_DOUBLE +# if (SIZEOF_LONG_DOUBLE < 16 \ + && (defined __i386__ || defined __x86_64__) && defined __GNUC__) +# define OCTAVE_ENSURE_LONG_DOUBLE_OPERATIONS_ARE_NOT_TRUNCATED 1 +# endif +#endif + +/* Make all .oct file interpreter functions and methods static. */ +#define OCTAVE_USE_STATIC_DEFUN + +/* This macro is intended to be used only to enable inline functions or + typedefs that provide access to symbols that have been moved to the + octave namespace. It may be temporarily useful to define this macro + when moving a symbol to the octave namespace but it should not be + defined when building released versions of Octave, as building those + should not require deprecated symbols. It is defined in + octave-config.h, so users of Octave may continue to access symbols + using the deprecated names. */ +/* #undef OCTAVE_PROVIDE_DEPRECATED_SYMBOLS */ + +/* Tag indicating Octave's autoconf-generated config.h has been + included. This symbol is provided because autoconf-generated + config.h files do not define a multiple-inclusion guard. See also + the notes at the top of the generated octave-config.h file. */ + +#define OCTAVE_AUTOCONFIG_H_INCLUDED 1 diff -r 103efb7e1600 -r 4392386b5ecb oct-conf-post-public.in.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/oct-conf-post-public.in.h Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,207 @@ +//////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 1993-2022 The Octave Project Developers +// +// See the file COPYRIGHT.md in the top-level directory of this +// distribution or . +// +// 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 +// . +// +//////////////////////////////////////////////////////////////////////// + +#if defined (__cplusplus) +# include +#else +# include +#endif + +# define OCTAVE_NAMESPACE_BEGIN namespace octave { +# define OCTAVE_NAMESPACE_END } + +/* The C++ standard is evolving to allow attribute hints in a + compiler-independent manner. In C++ 2011 support for noreturn was + added. In C++ 2014 support for deprecated was added. The Octave + code base has been future-proofed by using macros of the form + OCTAVE_ATTRIBUTE_NAME in place of vendor specific attribute + mechanisms. As compilers evolve, the underlying implementation can + be changed with the macro definitions below. FIXME: Update macros + to use C++ standard attribute syntax when Octave moves to C++ 2011 + standard. */ + +#if defined (__GNUC__) + /* The following attributes are used with gcc and clang compilers. */ +# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) +# define OCTAVE_DEPRECATED(ver, msg) __attribute__ ((__deprecated__ ("[" #ver "]: " msg))) +# else +# define OCTAVE_DEPRECATED(ver, msg) __attribute__ ((__deprecated__)) +# endif +# define HAVE_OCTAVE_DEPRECATED_ATTR 1 + +# define OCTAVE_NORETURN __attribute__ ((__noreturn__)) +# define HAVE_OCTAVE_NORETURN_ATTR 1 + +# define OCTAVE_UNUSED __attribute__ ((__unused__)) +# define HAVE_OCTAVE_UNUSED_ATTR 1 +#else +# define OCTAVE_DEPRECATED(ver, msg) +# define OCTAVE_NORETURN +# define OCTAVE_UNUSED + +/* # undef HAVE_OCTAVE_DEPRECATED_ATTR */ +/* # undef HAVE_OCTAVE_NORETURN_ATTR */ +/* # undef HAVE_OCTAVE_UNUSED_ATTR */ +#endif + +#if defined (__MINGW32__) + /* MinGW requires special handling due to different format specifiers + * on different platforms. The macro __MINGW_PRINTF_FORMAT maps to + * either gnu_printf or ms_printf depending on where we are compiling + * to avoid warnings on format specifiers that are legal. + * See: https://bugzilla.mozilla.org/show_bug.cgi?id=1331349 */ +# if defined (__cplusplus) +# include +# else +# include +# endif + +# define OCTAVE_FORMAT_PRINTF(stringIndex, firstToCheck) \ + __attribute__ ((format (__MINGW_PRINTF_FORMAT, stringIndex, firstToCheck))) + +# define HAVE_OCTAVE_FORMAT_PRINTF_ATTR 1 +#elif defined (__GNUC__) + /* The following attributes are used with gcc and clang compilers. */ +# define OCTAVE_FORMAT_PRINTF(index, first) \ + __attribute__ ((__format__(printf, index, first))) + +# define HAVE_OCTAVE_FORMAT_PRINTF_ATTR 1 +#else +# define OCTAVE_FORMAT_PRINTF(index, first) + +/* # undef HAVE_OCTAVE_FORMAT_PRINTF_ATTR */ +#endif + +#if ! defined (OCTAVE_FALLTHROUGH) +# if defined (__cplusplus) && __cplusplus > 201402L +# define OCTAVE_FALLTHROUGH [[fallthrough]] +# elif defined (__GNUC__) && __GNUC__ < 7 +# define OCTAVE_FALLTHROUGH ((void) 0) +# else +# define OCTAVE_FALLTHROUGH __attribute__ ((__fallthrough__)) +# endif +#endif + +#if defined (__cplusplus) +template +static inline void +octave_unused_parameter (const T&) +{ } +#else +# define octave_unused_parameter(param) (void) param; +#endif + +#if defined (OCTAVE_ENABLE_LIB_VISIBILITY_FLAGS) +# if defined (_WIN32) || defined (__CYGWIN__) +# if defined (__GNUC__) + /* GCC */ +# define OCTAVE_EXPORT __attribute__ ((dllexport)) +# define OCTAVE_IMPORT __attribute__ ((dllimport)) +# else + /* MSVC */ +# define OCTAVE_EXPORT __declspec(dllexport) +# define OCTAVE_IMPORT __declspec(dllimport) +# endif +# else + /* All other platforms. */ +# define OCTAVE_EXPORT __attribute__ ((visibility ("default"))) +# define OCTAVE_IMPORT +# endif +#else +# define OCTAVE_EXPORT +# define OCTAVE_IMPORT +#endif + +/* API macro for liboctave */ +#if defined (OCTAVE_DLL) +# define OCTAVE_API OCTAVE_EXPORT +#else +# define OCTAVE_API OCTAVE_IMPORT +#endif + +/* API macro for liboctinterp */ +#if defined (OCTINTERP_DLL) +# define OCTINTERP_API OCTAVE_EXPORT +#else +# define OCTINTERP_API OCTAVE_IMPORT +#endif + +/* API macro for the Array class in liboctave and liboctinterp */ +#if (defined (OCTAVE_DLL) || defined (OCTINTERP_DLL)) +# define OCTARRAY_API OCTAVE_EXPORT +#else +# define OCTARRAY_API OCTAVE_IMPORT +#endif + +/* API macro for libinterp/graphics */ +#if defined (OCTGRAPHICS_DLL) +# define OCTGRAPHICS_API OCTAVE_EXPORT +#else +# define OCTGRAPHICS_API OCTAVE_IMPORT +#endif + +/* API macro for libgui */ +#if defined (OCTGUI_DLL) +# define OCTGUI_API OCTAVE_EXPORT +#else +# define OCTGUI_API OCTAVE_IMPORT +#endif + +#if defined (OCTAVE_ENABLE_64) +# define OCTAVE_IDX_TYPE_FORMAT PRId64 +#else +# define OCTAVE_IDX_TYPE_FORMAT PRId32 +#endif + +#if OCTAVE_SIZEOF_F77_INT_TYPE == 8 +# define OCTAVE_F77_INT_TYPE_FORMAT PRId64 +#else +# define OCTAVE_F77_INT_TYPE_FORMAT PRId32 +#endif + +#define OCTAVE_HAVE_F77_INT_TYPE 1 + +#if defined (__cplusplus) && ! defined (OCTAVE_THREAD_LOCAL) +# define OCTAVE_THREAD_LOCAL +#endif + +typedef OCTAVE_IDX_TYPE octave_idx_type; +typedef OCTAVE_F77_INT_TYPE octave_f77_int_type; + +/* Backward compatibility */ + +#if defined (OCTAVE_ENABLE_64) +# define USE_64_BIT_IDX_T 1 +#endif + +#if defined (OCTAVE_ENABLE_OPENMP) +# define HAVE_OPENMP 1 +#endif + +#if defined (OCTAVE_ENABLE_FLOAT_TRUNCATE) +# define OCTAVE_FLOAT_TRUNCATE volatile +#else +# define OCTAVE_FLOAT_TRUNCATE +#endif diff -r 103efb7e1600 -r 4392386b5ecb oct-conf-post.in.h --- a/oct-conf-post.in.h Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,294 +0,0 @@ -//////////////////////////////////////////////////////////////////////// -// -// Copyright (C) 1993-2022 The Octave Project Developers -// -// See the file COPYRIGHT.md in the top-level directory of this -// distribution or . -// -// 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 -// . -// -//////////////////////////////////////////////////////////////////////// - -# define OCTAVE_NAMESPACE_BEGIN namespace octave { -# define OCTAVE_NAMESPACE_END } - -/* The C++ standard is evolving to allow attribute hints in a - compiler-independent manner. In C++ 2011 support for noreturn was - added. In C++ 2014 support for deprecated was added. The Octave - code base has been future-proofed by using macros of the form - OCTAVE_ATTRIBUTE_NAME in place of vendor specific attribute - mechanisms. As compilers evolve, the underlying implementation can - be changed with the macro definitions below. FIXME: Update macros - to use C++ standard attribute syntax when Octave moves to C++ 2011 - standard. */ - -#if defined (__GNUC__) - /* The following attributes are used with gcc and clang compilers. */ -# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) -# define OCTAVE_DEPRECATED(ver, msg) __attribute__ ((__deprecated__ ("[" #ver "]: " msg))) -# else -# define OCTAVE_DEPRECATED(ver, msg) __attribute__ ((__deprecated__)) -# endif -# define HAVE_OCTAVE_DEPRECATED_ATTR 1 - -# define OCTAVE_NORETURN __attribute__ ((__noreturn__)) -# define HAVE_OCTAVE_NORETURN_ATTR 1 - -# define OCTAVE_UNUSED __attribute__ ((__unused__)) -# define HAVE_OCTAVE_UNUSED_ATTR 1 -#else -# define OCTAVE_DEPRECATED(ver, msg) -# define OCTAVE_NORETURN -# define OCTAVE_UNUSED -#endif - -#if defined (__MINGW32__) - /* MinGW requires special handling due to different format specifiers - * on different platforms. The macro __MINGW_PRINTF_FORMAT maps to - * either gnu_printf or ms_printf depending on where we are compiling - * to avoid warnings on format specifiers that are legal. - * See: https://bugzilla.mozilla.org/show_bug.cgi?id=1331349 */ -# if defined (__cplusplus) -# include -# else -# include -# endif - -# define OCTAVE_FORMAT_PRINTF(stringIndex, firstToCheck) \ - __attribute__ ((format (__MINGW_PRINTF_FORMAT, stringIndex, firstToCheck))) - -# define HAVE_OCTAVE_FORMAT_PRINTF_ATTR 1 -#elif defined (__GNUC__) - /* The following attributes are used with gcc and clang compilers. */ -# define OCTAVE_FORMAT_PRINTF(index, first) \ - __attribute__ ((__format__(printf, index, first))) - -# define HAVE_OCTAVE_FORMAT_PRINTF_ATTR 1 -#else -# define OCTAVE_FORMAT_PRINTF(index, first) - -/* # undef HAVE_OCTAVE_FORMAT_PRINTF_ATTR */ -#endif - -#if ! defined (OCTAVE_FALLTHROUGH) -# if defined (__cplusplus) && __cplusplus > 201402L -# define OCTAVE_FALLTHROUGH [[fallthrough]] -# elif defined (__GNUC__) && __GNUC__ < 7 -# define OCTAVE_FALLTHROUGH ((void) 0) -# else -# define OCTAVE_FALLTHROUGH __attribute__ ((__fallthrough__)) -# endif -#endif - -/* This macro is intended to be used only to enable inline functions or - typedefs that provide access to symbols that have been moved to the - octave namespace. It may be temporarily useful to define this macro - when moving a symbol to the octave namespace but it should not be - defined when building released versions of Octave, as building those - should not require deprecated symbols. It is defined in - octave-config.h, so users of Octave may continue to access symbols - using the deprecated names. */ -/* #undef OCTAVE_PROVIDE_DEPRECATED_SYMBOLS */ - -#if defined (__cplusplus) -template -static inline void -octave_unused_parameter (const T&) -{ } -#else -# define octave_unused_parameter(param) (void) param; -#endif - -#if ! defined (HAVE_DEV_T) -typedef short dev_t; -#endif - -#if ! defined (HAVE_INO_T) -typedef unsigned long ino_t; -#endif - -#if defined (_MSC_VER) -# define __WIN32__ 1 -# define WIN32 1 - /* missing parameters in macros */ -# pragma warning (disable: 4003) - /* missing implementations in template instantiation */ -# pragma warning (disable: 4996) - /* deprecated function names (FIXME: ???) */ -# pragma warning (disable: 4661) -#endif - -#if defined (__APPLE__) && defined (__MACH__) -# define OCTAVE_USE_OS_X_API 1 -#endif - -/* Silence deprecated API warning from Apple OS > 10.14 */ -#if defined (__APPLE__) && defined (__MACH__) && defined (HAVE_OPENGL) -# define GL_SILENCE_DEPRECATION 1 -#endif - -/* Define to 1 if we expect to have , Sleep, etc. */ -#if defined (__WIN32__) && ! defined (__CYGWIN__) -# define OCTAVE_USE_WINDOWS_API 1 -#endif - -#if defined (OCTAVE_USE_WINDOWS_API) -# define OCTAVE_HAVE_WINDOWS_FILESYSTEM 1 -#elif defined (__CYGWIN__) -# define OCTAVE_HAVE_WINDOWS_FILESYSTEM 1 -# define OCTAVE_HAVE_POSIX_FILESYSTEM 1 -#else -# define OCTAVE_HAVE_POSIX_FILESYSTEM 1 -#endif - -#if defined (__MINGW32__) - /* We need to include this header or __MSVCRT_VERSION__ might not be defined - to the correct value */ -# include <_mingw.h> -#endif -/* assume that Windows will support UTF-8 locales when using UCRT */ -#if defined (__MSVCRT_VERSION__) && __MSVCRT_VERSION__ == 0x0E00 -# define OCTAVE_HAVE_WINDOWS_UTF8_LOCALE 1 -#endif - -/* sigsetjmp is a macro, not a function. */ -#if defined (sigsetjmp) && defined (HAVE_SIGLONGJMP) -# define OCTAVE_HAVE_SIG_JUMP 1 -#endif - -/* To be able to use long doubles for 64-bit mixed arithmetics, we need - them at least 80 bits wide and we need roundl declared in math.h. - FIXME: Maybe substitute this by a more precise check in the future? */ -#if (SIZEOF_LONG_DOUBLE >= 10) && defined (HAVE_ROUNDL) -# define OCTAVE_INT_USE_LONG_DOUBLE -# if (SIZEOF_LONG_DOUBLE < 16 \ - && (defined __i386__ || defined __x86_64__) && defined __GNUC__) -# define OCTAVE_ENSURE_LONG_DOUBLE_OPERATIONS_ARE_NOT_TRUNCATED 1 -# endif -#endif - -/* oct-dlldefs.h */ - -#if defined (OCTAVE_ENABLE_LIB_VISIBILITY_FLAGS) -# if defined (_WIN32) || defined (__CYGWIN__) -# if defined (__GNUC__) - /* GCC */ -# define OCTAVE_EXPORT __attribute__ ((dllexport)) -# define OCTAVE_IMPORT __attribute__ ((dllimport)) -# else - /* MSVC */ -# define OCTAVE_EXPORT __declspec(dllexport) -# define OCTAVE_IMPORT __declspec(dllimport) -# endif -# else - /* All other platforms. */ -# define OCTAVE_EXPORT __attribute__ ((visibility ("default"))) -# define OCTAVE_IMPORT -# endif -#else -# define OCTAVE_EXPORT -# define OCTAVE_IMPORT -#endif - -/* API macro for liboctave */ -#if defined (OCTAVE_DLL) -# define OCTAVE_API OCTAVE_EXPORT -#else -# define OCTAVE_API OCTAVE_IMPORT -#endif - -/* API macro for liboctinterp */ -#if defined (OCTINTERP_DLL) -# define OCTINTERP_API OCTAVE_EXPORT -#else -# define OCTINTERP_API OCTAVE_IMPORT -#endif - -/* API macro for the Array class in liboctave and liboctinterp */ -#if (defined (OCTAVE_DLL) || defined (OCTINTERP_DLL)) -# define OCTARRAY_API OCTAVE_EXPORT -#else -# define OCTARRAY_API OCTAVE_IMPORT -#endif - -/* API macro for libinterp/graphics */ -#if defined (OCTGRAPHICS_DLL) -# define OCTGRAPHICS_API OCTAVE_EXPORT -#else -# define OCTGRAPHICS_API OCTAVE_IMPORT -#endif - -/* API macro for libgui */ -#if defined (OCTGUI_DLL) -# define OCTGUI_API OCTAVE_EXPORT -#else -# define OCTGUI_API OCTAVE_IMPORT -#endif - -/* Backward compatibility */ - -#if defined (OCTAVE_ENABLE_64) -# define USE_64_BIT_IDX_T 1 -#endif - -#if defined (OCTAVE_ENABLE_OPENMP) -# define HAVE_OPENMP 1 -#endif - -#if defined (OCTAVE_ENABLE_FLOAT_TRUNCATE) -# define OCTAVE_FLOAT_TRUNCATE volatile -#else -# define OCTAVE_FLOAT_TRUNCATE -#endif - -#if defined (__cplusplus) -# include -#else -# include -#endif - -typedef OCTAVE_IDX_TYPE octave_idx_type; - -#if defined (OCTAVE_ENABLE_64) -# define OCTAVE_IDX_TYPE_FORMAT PRId64 -#else -# define OCTAVE_IDX_TYPE_FORMAT PRId32 -#endif - -typedef OCTAVE_F77_INT_TYPE octave_f77_int_type; - -#if OCTAVE_SIZEOF_F77_INT_TYPE == 8 -# define OCTAVE_F77_INT_TYPE_FORMAT PRId64 -#else -# define OCTAVE_F77_INT_TYPE_FORMAT PRId32 -#endif - -#define OCTAVE_HAVE_F77_INT_TYPE 1 - -#if defined (__cplusplus) && ! defined (OCTAVE_THREAD_LOCAL) -# define OCTAVE_THREAD_LOCAL -#endif - -/* Make all .oct file interpreter functions and methods static. */ -#define OCTAVE_USE_STATIC_DEFUN - -/* Tag indicating Octave's autoconf-generated config.h has been - included. This symbol is provided because autoconf-generated - config.h files do not define a multiple-inclusion guard. See also - the notes at the top of the generated octave-config.h file. */ - -#define OCTAVE_AUTOCONFIG_H_INCLUDED 1 diff -r 103efb7e1600 -r 4392386b5ecb scripts/+containers/Map.m --- a/scripts/+containers/Map.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/+containers/Map.m Thu Mar 03 13:37:10 2022 -0500 @@ -305,6 +305,7 @@ ## -*- texinfo -*- ## @deftypefn {} {} Map.remove (@var{keySet}) + ## @deftypefn {} {@var{newMap) =} Map.remove (@var{keySet}) ## Remove the list of key/value pairs specified by a cell array of keys ## @var{keySet} from the map. ## diff -r 103efb7e1600 -r 4392386b5ecb scripts/@ftp/ascii.m --- a/scripts/@ftp/ascii.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/@ftp/ascii.m Thu Mar 03 13:37:10 2022 -0500 @@ -32,6 +32,7 @@ ## representation. ## ## @var{f} is an FTP object returned by the @code{ftp} function. +## @seealso{@ftp/binary, @ftp/ftp} ## @end deftypefn function ascii (f) diff -r 103efb7e1600 -r 4392386b5ecb scripts/@ftp/binary.m --- a/scripts/@ftp/binary.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/@ftp/binary.m Thu Mar 03 13:37:10 2022 -0500 @@ -31,6 +31,7 @@ ## representation to the local representation. ## ## @var{f} is an FTP object returned by the @code{ftp} function. +## @seealso{@ftp/ascii, @ftp/ftp} ## @end deftypefn function binary (f) diff -r 103efb7e1600 -r 4392386b5ecb scripts/@ftp/cd.m --- a/scripts/@ftp/cd.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/@ftp/cd.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,8 +24,9 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} cd (@var{f}) +## @deftypefn {} {@var{cwd} =} cd (@var{f}) ## @deftypefnx {} {} cd (@var{f}, @var{path}) +## @deftypefnx {} {@var{new_cwd} =} cd (@var{f}, @var{path}) ## Get or set the remote directory on the FTP connection @var{f}. ## ## @var{f} is an FTP object returned by the @code{ftp} function. @@ -36,6 +37,7 @@ ## ## If the directory does not exist, an error message is printed and the ## working directory is not changed. +## @seealso{@ftp/dir, @ftp/ftp} ## @end deftypefn function path = cd (f, path) diff -r 103efb7e1600 -r 4392386b5ecb scripts/@ftp/close.m --- a/scripts/@ftp/close.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/@ftp/close.m Thu Mar 03 13:37:10 2022 -0500 @@ -28,6 +28,7 @@ ## Close the FTP connection represented by the FTP object @var{f}. ## ## @var{f} is an FTP object returned by the @code{ftp} function. +## @seealso{@ftp/ftp} ## @end deftypefn function close (f) diff -r 103efb7e1600 -r 4392386b5ecb scripts/@ftp/delete.m --- a/scripts/@ftp/delete.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/@ftp/delete.m Thu Mar 03 13:37:10 2022 -0500 @@ -28,6 +28,7 @@ ## Delete the remote file @var{file} over the FTP connection @var{f}. ## ## @var{f} is an FTP object returned by the @code{ftp} function. +## @seealso{@ftp/rmdir, @ftp/rename, @ftp/ftp} ## @end deftypefn function delete (f, file) diff -r 103efb7e1600 -r 4392386b5ecb scripts/@ftp/dir.m --- a/scripts/@ftp/dir.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/@ftp/dir.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,10 +24,16 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {@var{lst} =} dir (@var{f}) +## @deftypefn {} {} dir (@var{f}) +## @deftypefnx {} {@var{lst} =} dir (@var{f}) ## List the current directory in verbose form for the FTP connection @var{f}. ## ## @var{f} is an FTP object returned by the @code{ftp} function. +## +## If the optional output @var{lst} is requested return a struct array +## with one entry per file with the fields @code{name}, @code{date}, +## @code{bytes}, @code{isdir}, @code{datenum}. +## @seealso{@ftp/cd, @ftp/mkdir, @ftp/rmdir, @ftp/ftp} ## @end deftypefn function lst = dir (f) diff -r 103efb7e1600 -r 4392386b5ecb scripts/@ftp/ftp.m --- a/scripts/@ftp/ftp.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/@ftp/ftp.m Thu Mar 03 13:37:10 2022 -0500 @@ -50,6 +50,8 @@ ## @item rmdir @tab Remove remote directory ## @end multitable ## +## @seealso{@ftp/ascii, @ftp/binary, @ftp/cd, @ftp/close, @ftp/delete, +## @ftp/dir, @ftp/mget, @ftp/mkdir, @ftp/mput, @ftp/rename, @ftp/rmdir} ## @end deftypefn function obj = ftp (host = "", username = "anonymous", password = "") diff -r 103efb7e1600 -r 4392386b5ecb scripts/@ftp/mget.m --- a/scripts/@ftp/mget.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/@ftp/mget.m Thu Mar 03 13:37:10 2022 -0500 @@ -38,6 +38,7 @@ ## If a third string argument @var{target} is given, then it must indicate ## the path to the local destination directory. @var{target} may be a ## relative or absolute path. +## @seealso{@ftp/mput, @ftp/ftp} ## @end deftypefn function mget (f, file, target = "") diff -r 103efb7e1600 -r 4392386b5ecb scripts/@ftp/mkdir.m --- a/scripts/@ftp/mkdir.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/@ftp/mkdir.m Thu Mar 03 13:37:10 2022 -0500 @@ -28,6 +28,7 @@ ## Create the remote directory @var{path}, over the FTP connection @var{f}. ## ## @var{f} is an FTP object returned by the @code{ftp} function. +## @seealso{@ftp/rmdir, @ftp/ftp} ## @end deftypefn function mkdir (f, path) diff -r 103efb7e1600 -r 4392386b5ecb scripts/@ftp/mput.m --- a/scripts/@ftp/mput.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/@ftp/mput.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,14 +24,19 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} mput (@var{f}, @var{file}) +## @deftypefn {} {} mput (@var{f}, @var{file}) +## @deftypefnx {} {@var{file_list} =} mput (@var{f}, @var{file}) ## Upload the local file @var{file} into the current remote directory on the ## FTP connection @var{f}. ## -## @var{f} is an FTP object returned by the ftp function. +## @var{f} is an FTP object returned by the @code{ftp} function. ## ## The argument @var{file} is passed through the @code{glob} function and any ## files that match the wildcards in @var{file} will be uploaded. +## +## The optional output argument @var{file_list} contains a cell array of +## strings with the names of the uploaded files. +## @seealso{@ftp/mget, @ftp/mkdir, @ftp/ftp} ## @end deftypefn function retval = mput (f, file) diff -r 103efb7e1600 -r 4392386b5ecb scripts/@ftp/rename.m --- a/scripts/@ftp/rename.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/@ftp/rename.m Thu Mar 03 13:37:10 2022 -0500 @@ -28,7 +28,8 @@ ## Rename or move the remote file or directory @var{oldname} to @var{newname}, ## over the FTP connection @var{f}. ## -## @var{f} is an FTP object returned by the ftp function. +## @var{f} is an FTP object returned by the @code{ftp} function. +## @seealso{@ftp/delete, @ftp/rmdir, @ftp/ftp} ## @end deftypefn function rename (f, oldname, newname) diff -r 103efb7e1600 -r 4392386b5ecb scripts/@ftp/rmdir.m --- a/scripts/@ftp/rmdir.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/@ftp/rmdir.m Thu Mar 03 13:37:10 2022 -0500 @@ -28,6 +28,7 @@ ## Remove the remote directory @var{path}, over the FTP connection @var{f}. ## ## @var{f} is an FTP object returned by the @code{ftp} function. +## @seealso{@ftp/delete, @ftp/mkdir, @ftp/rename, @ftp/ftp} ## @end deftypefn function rmdir (f, path) diff -r 103efb7e1600 -r 4392386b5ecb scripts/audio/@audioplayer/__get_properties__.m --- a/scripts/audio/@audioplayer/__get_properties__.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/audio/@audioplayer/__get_properties__.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,51 +24,44 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {@var{properties} =} __get_properties__ (@var{player}) +## @deftypefn {} {@var{props} =} __get_properties__ (@var{player}) ## Return a struct containing all named properties of the audioplayer object ## @var{player}. +## @seealso{@audioplayer/get, @audioplayer/set, @audioplayer/audioplayer} ## @end deftypefn function props = __get_properties__ (player) - if (nargin < 1) - print_usage (); - endif - - if (__player_isplaying__ (struct (player).player)) - running = "on"; - else - running = "off"; - endif + hplayer = struct (player).player; props = struct ("BitsPerSample", - __player_get_nbits__ (struct (player).player), + __player_get_nbits__ (hplayer), "CurrentSample", - __player_get_sample_number__ (struct (player).player), + __player_get_sample_number__ (hplayer), "DeviceID", - __player_get_id__ (struct (player).player), + __player_get_id__ (hplayer), "NumberOfChannels", - __player_get_channels__ (struct (player).player), + __player_get_channels__ (hplayer), "Running", - running, + ifelse (__player_isplaying__ (hplayer), "on", "off"), "SampleRate", - __player_get_fs__ (struct (player).player), + __player_get_fs__ (hplayer), "TotalSamples", - __player_get_total_samples__ (struct (player).player), + __player_get_total_samples__ (hplayer), "Tag", - __player_get_tag__ (struct (player).player), + __player_get_tag__ (hplayer), "Type", "audioplayer", "UserData", - __player_get_userdata__ (struct (player).player)); + __player_get_userdata__ (hplayer)); endfunction diff -r 103efb7e1600 -r 4392386b5ecb scripts/audio/@audioplayer/audioplayer.m --- a/scripts/audio/@audioplayer/audioplayer.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/audio/@audioplayer/audioplayer.m Thu Mar 03 13:37:10 2022 -0500 @@ -32,16 +32,35 @@ ## Create an audioplayer object that will play back data @var{y} at sample ## rate @var{fs}. ## -## The optional arguments @var{nbits}, and @var{id} specify the bit depth and -## player device id, respectively. Device IDs may be found using the -## audiodevinfo function. Given an audioplayer object, use the data from the -## object to initialize the player. +## The signal @var{y} can be a vector (mono audio) or a two-dimensional array +## (multi-channel audio). +## +## The optional arguments @var{nbits} and @var{id} specify the number of bits +## per sample and player device ID, respectively. Device IDs may be found +## using the @code{audiodevinfo} function. +## +## Given an audiorecorder object @var{recorder}, use the data from the object +## to initialize the player. +## +## The list of actions for an audioplayer object are shown below. All +## methods require an audioplayer object as the first argument. ## -## The signal @var{y} can be a vector or a two-dimensional array. +## @multitable @columnfractions 0.2 0.75 +## @headitem Method @tab Description +## @item get @tab Read audioplayer property values +## @item isplaying @tab Return true if audioplayer is playing +## @item pause @tab Pause audioplayer playback +## @item play @tab Play audio stored in audioplayer object w/o blocking +## @item playblocking @tab Play audio stored in audioplayer object +## @item resume @tab Resume playback after pause +## @item set @tab Write audioplayer property values +## @item stop @tab Stop playback +## @end multitable ## -## The following example will create an audioplayer object that will play -## back one second of white noise at 44100 sample rate using 8 bits per -## sample. +## Example +## +## Create an audioplayer object that will play back one second of white noise +## at 44100 sample rate using 8 bits per sample. ## ## @example ## @group @@ -50,8 +69,13 @@ ## play (player); ## @end group ## @end example +## @seealso{@audioplayer/get, @audioplayer/isplaying, @audioplayer/pause, +## @audioplayer/play, @audioplayer/playblocking, @audioplayer/resume, +## @audioplayer/set, @audioplayer/stop, audiodevinfo, +## @audiorecorder/audiorecorder, sound, soundsc} ## @end deftypefn +################################################################################ ## FIXME: callbacks don't work properly, apparently because portaudio ## will execute the callbacks in a separate thread, and calling Octave ## functions in a separate thread which is likely to cause trouble with @@ -85,6 +109,7 @@ ## # play for as long as you want ## stop (player); ## @end group +################################################################################ function player = audioplayer (varargin) @@ -100,15 +125,22 @@ elseif (nargin == 2) recorder = varargin{1}; data = getaudiodata (recorder); - player = audioplayer (data, get (recorder, "SampleRate"), - get (recorder, "BitsPerSample"), varargin{2}); + player = audioplayer (data, + get (recorder, "SampleRate"), + get (recorder, "BitsPerSample"), + varargin{2}); else print_usage (); endif else - if (ischar (varargin{1})) - varargin{1} = str2func (varargin{1}); + ## FIXME: Prevent use of callbacks until situation is fixed. + if (is_function_handle (varargin{1}) || ischar (varargin{1})) + error ("audioplayer: first argument cannot be a callback function"); endif + ## FIXME: Uncomment when callback functions are supported. + ## if (ischar (varargin{1})) + ## varargin{1} = str2func (varargin{1}); + ## endif player.player = __player_audioplayer__ (varargin{:}); player = class (player, "audioplayer"); endif @@ -117,6 +149,7 @@ %!demo +%! ## Generate 2 seconds of white noise and play it back with a pause %! fs = 44100; %! audio = 0.25 * randn (2, 2*fs); %! player = audioplayer (audio, fs); @@ -144,37 +177,34 @@ %! assert (player2.TotalSamples, 44100); %!testif HAVE_PORTAUDIO; audiodevinfo (0) > 0 -%! audio = 0.25 * randn (2, 44100); -%! fs = 44100; -%! player = audioplayer (audio, fs); -%! set (player, {"SampleRate", "Tag", "UserData"}, {8000, "tag", [1, 2; 3, 4]}); -%! assert (player.SampleRate, 8000); -%! assert (player.Tag, "tag"); -%! assert (player.UserData, [1, 2; 3, 4]); - -%!testif HAVE_PORTAUDIO; audiodevinfo (0) > 0 -%! audio = 0.25 * randn (2, 44100); +%! audio = randn (8000, 1); %! fs = 44100; -%! player = audioplayer (audio, fs); -%! settable = set (player); -%! settable.SampleRate = 8000; -%! settable.Tag = "tag"; -%! settable.UserData = [1, 2; 3, 4]; -%! set (player, settable); -%! assert (player.SampleRate, 8000); -%! assert (player.Tag, "tag"); -%! assert (player.UserData, [1, 2; 3, 4]); +%! player = audioplayer (audio, fs, 16); +%! assert (player.NumberOfChannels, 1); +%! assert (player.SampleRate, 44100); +%! assert (player.BitsPerSample, 16); + +## FIXME: Callbacks do not work currently (5/31/2020) so BIST tests commented. +%!#function [sound, status] = callback (samples) +%!# sound = rand (samples, 2) - 0.5; +%!# status = 0; +%!#endfunction -%!testif HAVE_PORTAUDIO; audiodevinfo (0) > 0 -%! audio = 0.25 * randn (2, 44100); -%! fs = 44100; -%! player = audioplayer (audio, fs); -%! player.SampleRate = 8000; -%! player.Tag = "tag"; -%! player.UserData = [1, 2; 3, 4]; -%! properties = get (player, {"SampleRate", "Tag", "UserData"}); -%! assert (properties, {8000, "tag", [1, 2; 3, 4]}); +%!#testif HAVE_PORTAUDIO +%!# player = audioplayer (@callback, 44100); +%!# play (player); +%!# pause (2); +%!# stop (player); +%!# assert (1); +%!#testif HAVE_PORTAUDIO +%!# player = audioplayer ("callback", 44100, 16); +%!# play (player); +%!# pause (2); +%!# stop (player); +%!# assert (1); + +## Verify input validation %!testif HAVE_PORTAUDIO; audiodevinfo (0) > 0 %! ## Verify nbits option only accepts 8, 16, 24 %! fail ("audioplayer (1, 8e3, 9)", "NBITS must be 8, 16, or 24"); @@ -183,22 +213,5 @@ %! player = audioplayer (1, 8e3, 16); %! player = audioplayer (1, 8e3, 24); -## FIXME: Callbacks do not work currently (5/31/2020) so BIST tests commented. -#%!function [sound, status] = callback (samples) -#%! sound = rand (samples, 2) - 0.5; -#%! status = 0; -#%!endfunction - -#%!testif HAVE_PORTAUDIO -#%! player = audioplayer (@callback, 44100); -#%! play (player); -#%! pause (2); -#%! stop (player); -#%! assert (1); - -#%!testif HAVE_PORTAUDIO -#%! player = audioplayer ("callback", 44100, 16); -#%! play (player); -#%! pause (2); -#%! stop (player); -#%! assert (1); +%!error audioplayer (@ls, 8000) +%!error audioplayer ("ls", 8000) diff -r 103efb7e1600 -r 4392386b5ecb scripts/audio/@audioplayer/disp.m --- a/scripts/audio/@audioplayer/disp.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/audio/@audioplayer/disp.m Thu Mar 03 13:37:10 2022 -0500 @@ -26,17 +26,18 @@ ## -*- texinfo -*- ## @deftypefn {} {} disp (@var{player}) ## Display the properties of the audioplayer object @var{player}. +## @seealso{@audioplayer/audioplayer} ## @end deftypefn function disp (player) - if (nargin < 1) - print_usage (); - endif - printf ("audioplayer object with properties:\n\n"); for [val, prop] = __get_properties__ (player) printf (" %s = ", prop), disp (val); endfor endfunction + + +## No tests possible/needed for this function +%!assert (1) diff -r 103efb7e1600 -r 4392386b5ecb scripts/audio/@audioplayer/get.m --- a/scripts/audio/@audioplayer/get.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/audio/@audioplayer/get.m Thu Mar 03 13:37:10 2022 -0500 @@ -25,38 +25,74 @@ ## -*- texinfo -*- ## @deftypefn {} {@var{value} =} get (@var{player}, @var{name}) +## @deftypefnx {} {@var{values} =} get (@var{player}, @lbracechar{}@var{name1}, @var{name2}, @dots{}@rbracechar{}) ## @deftypefnx {} {@var{values} =} get (@var{player}) ## Return the @var{value} of the property identified by @var{name}. ## ## If @var{name} is a cell array return the values of the properties ## identified by the elements of the cell array. Given only the player -## object, return a scalar structure with values of all properties of -## @var{player}. The field names of the structure correspond to property +## object, return a scalar structure with values for all properties of +## @var{player}. The field names of the structure correspond to the property ## names. +## @seealso{@audioplayer/set, @audioplayer/audioplayer} ## @end deftypefn -function retval = get (varargin) +function value = get (player, name) - if (nargin < 1 || nargin > 2) - print_usage (); - endif - - properties = __get_properties__ (varargin{1}); + properties = __get_properties__ (player); if (nargin == 1) - retval = properties; + value = properties; elseif (nargin == 2) - pnames = varargin{2}; + pnames = name; if (ischar (pnames)) - retval = getfield (properties, pnames); + value = getproperty (properties, pnames); elseif (iscellstr (pnames)) - retval = cell (size (pnames)); + value = cell (size (pnames)); for i = 1:numel (pnames) - retval{i} = getfield (properties, pnames{i}); + value{i} = getproperty (properties, pnames{i}); endfor else - error ("@audioplayer/get: invalid NAME argument"); + error ("@audioplayer/get: NAME must be a string or cell array of strings"); endif endif endfunction + +function value = getproperty (properties, pname) + + persistent valid_props; + if (isempty (valid_props)) + valid_props = { "BitsPerSample", "CurrentSample", "DeviceID", ... + "NumberOfChannels", "Running", "SampleRate", ... + "TotalSamples", "Tag", "Type", "UserData" }; + endif + + idx = find (strcmpi (pname, valid_props), 1); + if (isempty (idx)) + error ('@audioplayer/get: "%s" is not a valid property name', pname); + endif + + value = properties.(valid_props{idx}); + +endfunction + + +%!testif HAVE_PORTAUDIO; audiodevinfo (0) > 0 +%! player = audioplayer ([-1, 1], 44100, 8); +%! props = get (player); +%! assert (fieldnames (props), {"BitsPerSample"; "CurrentSample"; "DeviceID"; +%! "NumberOfChannels"; "Running"; "SampleRate"; "TotalSamples"; "Tag"; +%! "Type"; "UserData"}); +%! value = get (player, "Running"); +%! assert (value, "off"); +%! value = get (player, "ruNNIng"); # test case insensitivity +%! assert (value, "off"); +%! values = get (player, {"SampleRate", "BitsPerSample", "TotalSamples"}); +%! assert (values, {44100, 8, 2}); + +## Test input validation +%!testif HAVE_PORTAUDIO; audiodevinfo (0) > 0 +%! player = audioplayer ([-1, 1], 44100, 8); +%! fail ("get (player, 1)", "NAME must be a string"); +%! fail ('get (player, "foobar")', '"foobar" is not a valid property'); diff -r 103efb7e1600 -r 4392386b5ecb scripts/audio/@audioplayer/isplaying.m --- a/scripts/audio/@audioplayer/isplaying.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/audio/@audioplayer/isplaying.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,17 +24,19 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} isplaying (@var{player}) +## @deftypefn {} {@var{tf} =} isplaying (@var{player}) ## Return true if the audioplayer object @var{player} is currently playing back ## audio and false otherwise. +## @seealso{@audioplayer/pause, @audioplayer/audioplayer} ## @end deftypefn -function result = isplaying (player) +function tf = isplaying (player) - if (nargin < 1) - print_usage (); - endif - - result = __player_isplaying__ (struct (player).player); + tf = __player_isplaying__ (struct (player).player); endfunction + + +%!testif HAVE_PORTAUDIO; audiodevinfo (1) > 0 +%! player = audioplayer ([-1, 1], 44100, 8); +%! assert (isplaying (player), false); diff -r 103efb7e1600 -r 4392386b5ecb scripts/audio/@audioplayer/pause.m --- a/scripts/audio/@audioplayer/pause.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/audio/@audioplayer/pause.m Thu Mar 03 13:37:10 2022 -0500 @@ -25,15 +25,16 @@ ## -*- texinfo -*- ## @deftypefn {} {} pause (@var{player}) -## Pause the audioplayer @var{player}. +## Pause playback of audioplayer @var{player}. +## @seealso{@audioplayer/resume, @audioplayer/stop, @audioplayer/audioplayer} ## @end deftypefn function pause (player) - if (nargin < 1) - print_usage (); - endif - __player_pause__ (struct (player).player); endfunction + + +## No tests possible for this function +%!assert (1) diff -r 103efb7e1600 -r 4392386b5ecb scripts/audio/@audioplayer/play.m --- a/scripts/audio/@audioplayer/play.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/audio/@audioplayer/play.m Thu Mar 03 13:37:10 2022 -0500 @@ -26,20 +26,30 @@ ## -*- texinfo -*- ## @deftypefn {} {} play (@var{player}) ## @deftypefnx {} {} play (@var{player}, @var{start}) -## @deftypefnx {} {} play (@var{player}, @var{limits}) +## @deftypefnx {} {} play (@var{player}, [@var{start}, @var{end}]) ## Play audio stored in the audioplayer object @var{player} without blocking. ## -## Given optional argument start, begin playing at @var{start} samples in the -## recording. Given a two-element vector @var{limits}, begin and end playing -## at the number of samples specified by the elements of the vector. +## If the optional argument @var{start} is provided, begin playing +## @var{start} samples in to the recording. +## +## If the optional argument @var{end} is provided, stop playing at +## @var{end} samples into the recording. +## @seealso{@audioplayer/playblocking, @audioplayer/pause, @audioplayer/stop, +## @audioplayer/audioplayer} ## @end deftypefn -function play (varargin) +function play (player, length) + + hplayer = struct (player).player; - if (nargin < 1 || nargin > 2) - print_usage (); + if (nargin == 1) + __player_play__ (hplayer); + else + __player_play__ (hplayer, length); endif - __player_play__ (struct (varargin{1}).player, varargin{2:end}); +endfunction + -endfunction +## No tests possible for this function +%!assert (1) diff -r 103efb7e1600 -r 4392386b5ecb scripts/audio/@audioplayer/playblocking.m --- a/scripts/audio/@audioplayer/playblocking.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/audio/@audioplayer/playblocking.m Thu Mar 03 13:37:10 2022 -0500 @@ -26,20 +26,29 @@ ## -*- texinfo -*- ## @deftypefn {} {} playblocking (@var{player}) ## @deftypefnx {} {} playblocking (@var{player}, @var{start}) -## @deftypefnx {} {} playblocking (@var{player}, @var{limits}) -## Play audio stored in the audioplayer object @var{player} with blocking. +## @deftypefnx {} {} playblocking (@var{player}, [@var{start}, @var{end}]) +## Play audio stored in the audioplayer object @var{player} with blocking +## (synchronous I/O). ## -## Given optional argument start, begin playing at @var{start} samples in the -## recording. Given a two-element vector @var{limits}, begin and end playing -## at the number of samples specified by the elements of the vector. +## If the optional argument @var{start} is provided, begin playing +## @var{start} samples into the recording. +## +## If the optional argument @var{end} is provided, stop playing at +## @var{end} samples into the recording. +## @seealso{@audioplayer/play, @audioplayer/pause, @audioplayer/stop, +## @audioplayer/audioplayer} ## @end deftypefn -function playblocking (varargin) +function playblocking (player, length) - if (nargin < 1 || nargin > 2) + if (nargin != 2) print_usage (); endif - __player_playblocking__ (struct (varargin{1}).player, varargin{2:end}); + __player_playblocking__ (struct (player).player, length); endfunction + + +## No tests possible for this function +%!assert (1) diff -r 103efb7e1600 -r 4392386b5ecb scripts/audio/@audioplayer/resume.m --- a/scripts/audio/@audioplayer/resume.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/audio/@audioplayer/resume.m Thu Mar 03 13:37:10 2022 -0500 @@ -26,14 +26,15 @@ ## -*- texinfo -*- ## @deftypefn {} {} resume (@var{player}) ## Resume playback for the paused audioplayer object @var{player}. +## @seealso{@audioplayer/pause, @audioplayer/stop, @audioplayer/audioplayer} ## @end deftypefn function resume (player) - if (nargin < 1) - print_usage (); - endif - __player_resume__ (struct (player).player); endfunction + + +## No tests possible for this function +%!assert (1) diff -r 103efb7e1600 -r 4392386b5ecb scripts/audio/@audioplayer/set.m --- a/scripts/audio/@audioplayer/set.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/audio/@audioplayer/set.m Thu Mar 03 13:37:10 2022 -0500 @@ -25,60 +25,94 @@ ## -*- texinfo -*- ## @deftypefn {} {} set (@var{player}, @var{name}, @var{value}) -## @deftypefnx {} {} set (@var{player}, @var{properties}) +## @deftypefnx {} {} set (@var{player}, @var{name_cell}, @var{value_cell}) +## @deftypefnx {} {} set (@var{player}, @var{properties_struct}) ## @deftypefnx {} {@var{properties} =} set (@var{player}) ## Set the value of property specified by @var{name} to a given @var{value}. ## ## If @var{name} and @var{value} are cell arrays, set each property to the -## corresponding value. Given a structure of @var{properties} with fields +## corresponding value. Given a structure of properties with fields ## corresponding to property names, set the value of those properties to the -## field values. Given only the audioplayer object, return a structure of -## settable properties. +## corresponding field values. Given only an audioplayer object, return a +## structure of configurable properties (i.e., writeable properties). +## @seealso{@audioplayer/get, @audioplayer/audioplayer} ## @end deftypefn -function settable = set (varargin) +function properties = set (player, varargin) - if (nargin < 1 || nargin > 3) + if (nargin > 3) print_usage (); endif - player = struct (varargin{1}).player; + hplayer = struct (player).player; if (nargin == 1) - settable.SampleRate = {}; - settable.Tag = {}; - settable.UserData = {}; + properties = struct ("SampleRate", {{}}, "Tag", {{}}, "UserData", {{}}); elseif (nargin == 2) - for [value, property] = varargin{2} - setproperty (player, property, value); + for [value, property] = varargin{1} + setproperty (hplayer, property, value); endfor elseif (nargin == 3) - if (iscell (varargin{2})) + if (iscell (varargin{1})) index = 1; - for property = varargin{2} - setproperty (player, char (property), varargin{3}{index}); + for property = varargin{1} + setproperty (hplayer, char (property), varargin{2}{index}); index += 1; endfor else - setproperty (player, varargin{2}, varargin{3}); + setproperty (hplayer, varargin{1}, varargin{2}); endif - else - error ("@audioplayer/set: wrong number of arguments to the set method"); endif endfunction function setproperty (player, property, value) - switch (property) - case "SampleRate" + switch (lower (property)) + case "samplerate" __player_set_fs__ (player, value); - case "Tag" + case "tag" __player_set_tag__ (player, value); - case "UserData" + case "userdata" __player_set_userdata__ (player, value); otherwise - error ("audioplayer: no such property or the property specified is read-only"); + error ('@audioplayer/set: "%s" is not a valid property name or is read-only', property); endswitch endfunction + + +%!testif HAVE_PORTAUDIO; audiodevinfo (0) > 0 +%! player = audioplayer ([-1, 1], 44100, 8); +%! set (player, "SampleRate", 8800); +%! set (player, "Tag", "mytag"); +%! ## Also test case insensitivity +%! set (player, "USERdata", [1, 2; 3, 4]); +%! assert (player.SampleRate, 8800); +%! assert (player.Tag, "mytag"); +%! assert (player.UserData, [1, 2; 3, 4]); + +%!testif HAVE_PORTAUDIO; audiodevinfo (0) > 0 +%! player = audioplayer ([-1, 1], 44100, 8); +%! set (player, {"SampleRate", "Tag", "UserData"}, +%! {8800, "mytag", [1, 2; 3, 4]}); +%! assert (player.SampleRate, 8800); +%! assert (player.Tag, "mytag"); +%! assert (player.UserData, [1, 2; 3, 4]); + +%!testif HAVE_PORTAUDIO; audiodevinfo (0) > 0 +%! player = audioplayer ([-1, 1], 44100, 8); +%! props = set (player); +%! props.SampleRate = 8800; +%! props.Tag = "mytag"; +%! props.UserData = [1, 2; 3, 4]; +%! set (player, props); +%! assert (player.SampleRate, 8800); +%! assert (player.Tag, "mytag"); +%! assert (player.UserData, [1, 2; 3, 4]); + +## Test input validation +%!testif HAVE_PORTAUDIO; audiodevinfo (0) > 0 +%! player = audioplayer ([-1, 1], 44100, 8); +%! fail ('set (player, "foobar", 1)', "not a valid property name"); +%! fail ('set (player, "Running", 1)', "is read-only"); diff -r 103efb7e1600 -r 4392386b5ecb scripts/audio/@audioplayer/stop.m --- a/scripts/audio/@audioplayer/stop.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/audio/@audioplayer/stop.m Thu Mar 03 13:37:10 2022 -0500 @@ -25,16 +25,17 @@ ## -*- texinfo -*- ## @deftypefn {} {} stop (@var{player}) -## Stop the playback for the audioplayer @var{player} and reset the -## relevant variables to their starting values. +## Stop playback of the audioplayer @var{player} and reset relevant variables +## to their initial values. +## @seealso{@audioplayer/pause, @audioplayer/resume, @audioplayer/audioplayer} ## @end deftypefn function stop (player) - if (nargin < 1) - print_usage (); - endif - __player_stop__ (struct (player).player); endfunction + + +## No tests possible for this function +%!assert (1) diff -r 103efb7e1600 -r 4392386b5ecb scripts/audio/@audioplayer/subsasgn.m --- a/scripts/audio/@audioplayer/subsasgn.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/audio/@audioplayer/subsasgn.m Thu Mar 03 13:37:10 2022 -0500 @@ -28,10 +28,15 @@ ## Perform subscripted assignment on the audio player object @var{player}. ## ## Assign the value of @var{rhs} to the player property named by @var{idx}. +## @seealso{@audioplayer/audioplayer} ## @end deftypefn function value = subsasgn (player, idx, rhs) + if (nargin != 3) + print_usage (); + endif + if (isempty (idx)) error ("audioplayer: missing index"); endif @@ -45,3 +50,15 @@ endif endfunction + + +%!testif HAVE_PORTAUDIO; audiodevinfo (0) > 0 +%! player = audioplayer ([-1, 1], 44100, 8); +%! player.Tag = "mytag"; +%! assert (get (player, "Tag"), "mytag"); + +## Test input validation +%!testif HAVE_PORTAUDIO; audiodevinfo (0) > 0 +%! player = audioplayer ([-1, 1], 44100, 8); +%! fail ("player(1).Tag = 5", "invalid subscript type"); +%! fail ("player{1}.Tag = 5", "invalid subscript type"); diff -r 103efb7e1600 -r 4392386b5ecb scripts/audio/@audioplayer/subsref.m --- a/scripts/audio/@audioplayer/subsref.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/audio/@audioplayer/subsref.m Thu Mar 03 13:37:10 2022 -0500 @@ -28,6 +28,7 @@ ## Perform subscripted selection on the audio player object @var{player}. ## ## Return the player property value named by @var{idx}. +## @seealso{@audioplayer/audioplayer} ## @end deftypefn function value = subsref (player, idx) @@ -48,3 +49,15 @@ endif endfunction + + +%!testif HAVE_PORTAUDIO; audiodevinfo (0) > 0 +%! player = audioplayer ([-1, 1], 44100, 8); +%! set (player, "Tag", "mytag"); +%! assert (player.Tag, "mytag"); + +## Test input validation +%!testif HAVE_PORTAUDIO; audiodevinfo (0) > 0 +%! player = audioplayer ([-1, 1], 44100, 8); +%! fail ("player(1).Tag", "invalid subscript type"); +%! fail ("player{1}.Tag", "invalid subscript type"); diff -r 103efb7e1600 -r 4392386b5ecb scripts/audio/@audiorecorder/__get_properties__.m --- a/scripts/audio/@audiorecorder/__get_properties__.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/audio/@audiorecorder/__get_properties__.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,51 +24,45 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {@var{properties} =} __get_properties__ (@var{recorder}) +## @deftypefn {} {@var{props} =} __get_properties__ (@var{recorder}) ## Return a struct containing all named properties of the recorder object ## @var{recorder}. +## @seealso{@audiorecorder/get, @audiorecorder/set, +## @audiorecorder/audiorecorder} ## @end deftypefn function props = __get_properties__ (recorder) - if (nargin < 1) - print_usage (); - endif - - if (__recorder_isrecording__ (struct (recorder).recorder)) - running = "on"; - else - running = "off"; - endif + hrecorder = struct (recorder).recorder; props = struct ("BitsPerSample", - __recorder_get_nbits__ (struct (recorder).recorder), + __recorder_get_nbits__ (hrecorder), "CurrentSample", - __recorder_get_sample_number__ (struct (recorder).recorder), + __recorder_get_sample_number__ (hrecorder), "DeviceID", - __recorder_get_id__ (struct (recorder).recorder), + __recorder_get_id__ (hrecorder), "NumberOfChannels", - __recorder_get_channels__ (struct (recorder).recorder), + __recorder_get_channels__ (hrecorder), "Running", - running, + ifelse (__recorder_isrecording__ (hrecorder), "on", "off"), "SampleRate", - __recorder_get_fs__ (struct (recorder).recorder), + __recorder_get_fs__ (hrecorder), "TotalSamples", - __recorder_get_total_samples__ (struct (recorder).recorder), + __recorder_get_total_samples__ (hrecorder), "Tag", - __recorder_get_tag__ (struct (recorder).recorder), + __recorder_get_tag__ (hrecorder), "Type", "audiorecorder", "UserData", - __recorder_get_userdata__ (struct (recorder).recorder)); + __recorder_get_userdata__ (hrecorder)); endfunction diff -r 103efb7e1600 -r 4392386b5ecb scripts/audio/@audiorecorder/audiorecorder.m --- a/scripts/audio/@audiorecorder/audiorecorder.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/audio/@audiorecorder/audiorecorder.m Thu Mar 03 13:37:10 2022 -0500 @@ -25,25 +25,50 @@ ## -*- texinfo -*- ## @deftypefn {} {@var{recorder} =} audiorecorder () -## @deftypefnx {} {@var{recorder} =} audiorecorder (@var{fs}, @var{nbits}, @var{channels}) -## @deftypefnx {} {@var{recorder} =} audiorecorder (@var{fs}, @var{nbits}, @var{channels}, @var{id}) -## Create an audiorecorder object recording 8 bit mono audio at 8000 Hz +## @deftypefnx {} {@var{recorder} =} audiorecorder (@var{fs}, @var{nbits}, @var{nchannels}) +## @deftypefnx {} {@var{recorder} =} audiorecorder (@var{fs}, @var{nbits}, @var{nchannels}, @var{id}) +## Create an audiorecorder object recording 8-bit mono audio at 8000 Hz ## sample rate. ## -## The optional arguments @var{fs}, @var{nbits}, @var{channels}, and @var{id} -## specify the sample rate, bit depth, number of channels and recording -## device id, respectively. Device IDs may be found using the audiodevinfo -## function. +## The optional arguments @var{fs}, @var{nbits}, @var{nchannels}, and @var{id} +## specify the sample rate, number of bits per sample, number of channels, and +## recording device ID, respectively. Device IDs may be found using the +## @code{audiodevinfo} function. +## +## The list of actions for an audiorecorder object are shown below. All +## methods require an audiorecorder object as the first argument. +## +## @multitable @columnfractions 0.22 0.73 +## @headitem Method @tab Description +## @item get @tab Read audiorecorder property values +## @item getaudiodata @tab Return audio data as a numeric matrix +## @item getplayer @tab Return audioplayer loaded with data from audiorecorder +## @item isrecording @tab Return true if audiorecorder is recording +## @item pause @tab Pause recording +## @item play @tab Play audio stored in audiorecorder object +## @item record @tab Record audio in audiorecorder object w/o blocking +## @item recordblocking @tab Record audio in audiorecorder object +## @item resume @tab Resume recording after pause +## @item set @tab Write audiorecorder property values +## @item stop @tab Stop recording +## @end multitable ## @end deftypefn +## @seealso{@audiorecorder/get, @audiorecorder/getaudiodata, +## @audiorecorder/getplayer, @audiorecorder/isrecording, +## @audiorecorder/pause, @audiorecorder/play, @audiorecorder/record, +## @audiorecorder/recordblocking, @audioplayer/resume, @audiorecorder/set, +## @audiorecorder/stop, audiodevinfo, @audioplayer/audioplayer, record} +################################################################################ ## FIXME: callbacks don't work properly, apparently because portaudio ## will execute the callbacks in a separate thread, and calling Octave -## functions in a separate thread which is likely to cause trouble with +## functions in a separate thread is likely to cause trouble with ## all of Octave's global data... ## ## @deftypefnx {} {@var{recorder} =} audiorecorder (@var{function}, @dots{}) ## ## Given a function handle, use that function to process the audio. +################################################################################ function recorder = audiorecorder (varargin) @@ -51,9 +76,15 @@ print_usage (); endif - if (nargin > 0 && ischar (varargin{1})) - varargin{1} = str2func (varargin{1}); + ## FIXME: Prevent use of callbacks until situation is fixed. + if (nargin > 0 && (is_function_handle (varargin{1}) || ischar (varargin{1}))) + error ("audiorecorder: first argument cannot be a callback function"); endif + + ## FIXME: Uncomment when callback functions are supported. + ## if (nargin > 0 && ischar (varargin{1})) + ## varargin{1} = str2func (varargin{1}); + ## endif recorder.recorder = __recorder_audiorecorder__ (varargin{:}); recorder = class (recorder, "audiorecorder"); @@ -62,6 +93,7 @@ %!demo +%! ## Record 1 second of audio and play it back in two ways %! recorder = audiorecorder (44100, 16, 2); %! record (recorder, 1); %! pause (2); @@ -76,67 +108,34 @@ ## Tests of audiorecorder must not actually record anything. -%!testif HAVE_PORTAUDIO; audiodevinfo (1) > 0 -%! recorder = audiorecorder (44100, 16, 2); -%! data = getaudiodata (recorder, "int16"); -%! assert (strcmp (class (data), "int16")); -%! data = getaudiodata (recorder, "int8"); -%! assert (strcmp (class (data), "int8")); -%! data = getaudiodata (recorder, "uint8"); -%! assert (strcmp (class (data), "uint8")); -%! assert (size (data)(1), recorder.TotalSamples); -%! assert (size (data)(2), 2); - -%!testif HAVE_PORTAUDIO; audiodevinfo (1) > 0 -%! recorder = audiorecorder (); -%! set (recorder, {"SampleRate", "Tag", "UserData"}, -%! {8000, "tag", [1, 2; 3, 4]}); -%! assert (recorder.SampleRate, 8000); -%! assert (recorder.Tag, "tag"); -%! assert (recorder.UserData, [1, 2; 3, 4]); - -%!testif HAVE_PORTAUDIO; audiodevinfo (1) > 0 -%! recorder = audiorecorder (); -%! settable = set (recorder); -%! settable.SampleRate = 8000; -%! settable.Tag = "tag"; -%! settable.UserData = [1, 2; 3, 4]; -%! set (recorder, settable); -%! assert (recorder.SampleRate, 8000); -%! assert (recorder.Tag, "tag"); -%! assert (recorder.UserData, [1, 2; 3, 4]); +## FIXME: Uncomment when callbacks are supported +%!#function status = callback_record (sound) +%!# fid = fopen ("record.txt", "at"); +%!# for index = 1:rows(sound) +%!# fprintf (fid, "%.4f, %.4f\n", sound(index, 1), sound(index, 2)); +%!# endfor +%!# fclose (fid); +%!# status = 0; +%!#endfunction -%!testif HAVE_PORTAUDIO; audiodevinfo (1) > 0 -%! recorder = audiorecorder (); -%! recorder.SampleRate = 8000; -%! recorder.Tag = "tag"; -%! recorder.UserData = [1, 2; 3, 4]; -%! properties = get (recorder, {"SampleRate", "Tag", "UserData"}); -%! assert (properties, {8000, "tag", [1, 2; 3, 4]}); - -#%!function status = callback_record (sound) -#%! fid = fopen ("record.txt", "at"); -#%! for index = 1:rows(sound) -#%! fprintf (fid, "%.4f, %.4f\n", sound(index, 1), sound(index, 2)); -#%! endfor -#%! fclose (fid); -#%! status = 0; -#%!endfunction +%!#testif HAVE_PORTAUDIO +%!# recorder = audiorecorder (@callback_record, 44100); +%!# unlink ("record.txt") +%!# record (recorder); +%!# pause (2); +%!# stop (recorder); +%!# s = stat ("record.txt"); +%!# assert (s.size > 0); -#%!testif HAVE_PORTAUDIO -#%! recorder = audiorecorder (@callback_record, 44100); -#%! unlink ("record.txt") -#%! record (recorder); -#%! pause (2); -#%! stop (recorder); -#%! s = stat ("record.txt"); -#%! assert (s.size > 0); +%!#testif HAVE_PORTAUDIO +%!# recorder = audiorecorder (@callback_record, 44100); +%!# unlink ("record.txt") +%!# record (recorder); +%!# pause (2); +%!# stop (recorder); +%!# s = stat ("record.txt"); +%!# assert (s.size > 0); -#%!testif HAVE_PORTAUDIO -#%! recorder = audiorecorder (@callback_record, 44100); -#%! unlink ("record.txt") -#%! record (recorder); -#%! pause (2); -#%! stop (recorder); -#%! s = stat ("record.txt"); -#%! assert (s.size > 0); +## Test input validation +%!error audiorecorder (@ls) +%!error audiorecorder ("ls") diff -r 103efb7e1600 -r 4392386b5ecb scripts/audio/@audiorecorder/disp.m --- a/scripts/audio/@audiorecorder/disp.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/audio/@audiorecorder/disp.m Thu Mar 03 13:37:10 2022 -0500 @@ -26,17 +26,18 @@ ## -*- texinfo -*- ## @deftypefn {} {} disp (@var{recorder}) ## Display the properties of the audiorecorder object @var{recorder}. +## @seealso{@audiorecorder/audiorecorder} ## @end deftypefn function disp (recorder) - if (nargin < 1) - print_usage (); - endif - printf ("audiorecorder object with properties:\n\n"); for [val, prop] = __get_properties__ (recorder) printf (" %s = ", prop), disp (val); endfor endfunction + + +## No tests possible/needed for this function +%!assert (1) diff -r 103efb7e1600 -r 4392386b5ecb scripts/audio/@audiorecorder/get.m --- a/scripts/audio/@audiorecorder/get.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/audio/@audiorecorder/get.m Thu Mar 03 13:37:10 2022 -0500 @@ -25,38 +25,72 @@ ## -*- texinfo -*- ## @deftypefn {} {@var{value} =} get (@var{recorder}, @var{name}) +## @deftypefnx {} {@var{values} =} get (@var{recorder}, @lbracechar{}@var{name1}, @var{name2}, @dots{}@rbracechar{}) ## @deftypefnx {} {@var{values} =} get (@var{recorder}) ## Return the @var{value} of the property identified by @var{name}. ## -## If @var{name} is a cell array, return the values of the properties -## corresponding to the elements of the cell array. Given only the recorder -## object, return a scalar structure with values of all properties of -## @var{recorder}. The field names of the structure correspond to property +## If @var{name} is a cell array return the values of the properties +## identified by the elements of the cell array. Given only the recorder +## object, return a scalar structure with values for all properties of +## @var{recorder}. The field names of the structure correspond to the property ## names. +## @seealso{@audiorecorder/set, @audiorecorder/audiorecorder} ## @end deftypefn -function retval = get (varargin) +function value = get (recorder, name) - if (nargin < 1 || nargin > 2) - print_usage (); - endif - - properties = __get_properties__ (varargin{1}); + properties = __get_properties__ (recorder); if (nargin == 1) - retval = properties; + value = properties; elseif (nargin == 2) - pnames = varargin{2}; + pnames = name; if (ischar (pnames)) - retval = getfield (properties, pnames); + value = getproperty (properties, pnames); elseif (iscellstr (pnames)) - retval = cell (size (pnames)); + value = cell (size (pnames)); for i = 1:numel (pnames) - retval{i} = getfield (properties, pnames{i}); + value{i} = getproperty (properties, pnames{i}); endfor else - error ("@audiorecorder/get: invalid NAME argument"); + error ("@audiorecorder/get: NAME must be a string or cell array of strings"); endif endif endfunction + +function value = getproperty (properties, pname) + + persistent valid_props; + if (isempty (valid_props)) + valid_props = { "BitsPerSample", "CurrentSample", "DeviceID", ... + "NumberOfChannels", "Running", "SampleRate", ... + "TotalSamples", "Tag", "Type", "UserData" }; + endif + + idx = find (strcmpi (pname, valid_props), 1); + if (isempty (idx)) + error ('@audiorecorder/get: "%s" is not a valid property name', pname); + endif + + value = properties.(valid_props{idx}); + +endfunction + + +%!testif HAVE_PORTAUDIO; audiodevinfo (1) > 0 +%! recorder = audiorecorder (44100, 16, 2); +%! props = get (recorder); +%! assert (fieldnames (props), {"BitsPerSample"; "CurrentSample"; "DeviceID"; +%! "NumberOfChannels"; "Running"; "SampleRate"; "TotalSamples"; "Tag"; +%! "Type"; "UserData"}); +%! value = get (recorder, "Running"); +%! assert (value, "off"); +%! values = get (recorder, {"SampleRate", "BitsPerSample", "NumberOfChannels"}); +%! assert (values, {44100, 16, 2}); + +## Test input validation +%!testif HAVE_PORTAUDIO; audiodevinfo (1) > 0 +%! recorder = audiorecorder (44100, 16, 2); +%! fail ("get (recorder, 1)", "NAME must be a string"); +%! fail ('get (recorder, "foobar")', '"foobar" is not a valid property'); diff -r 103efb7e1600 -r 4392386b5ecb scripts/audio/@audiorecorder/getaudiodata.m --- a/scripts/audio/@audiorecorder/getaudiodata.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/audio/@audiorecorder/getaudiodata.m Thu Mar 03 13:37:10 2022 -0500 @@ -26,41 +26,74 @@ ## -*- texinfo -*- ## @deftypefn {} {@var{data} =} getaudiodata (@var{recorder}) ## @deftypefnx {} {@var{data} =} getaudiodata (@var{recorder}, @var{datatype}) -## Return recorder audio data as a matrix with values between -1.0 and 1.0 -## and with as many columns as there are channels in the recorder. +## Return audio data from audiorecorder object @var{recorder} as a double +## matrix with values between -1.0 and 1.0 and with as many columns as there +## are channels in @var{recorder}. ## ## Given the optional argument @var{datatype}, convert the recorded data ## to the specified type, which may be one of @qcode{"double"}, ## @qcode{"single"}, @qcode{"int16"}, @qcode{"int8"} or @qcode{"uint8"}. +## @seealso{@audiorecorder/audiorecorder} ## @end deftypefn -function data = getaudiodata (varargin) +function data = getaudiodata (recorder, datatype) - if (nargin < 1 || nargin > 2) - print_usage (); - endif - - recorder = varargin{1}; + hrecorder = struct (recorder).recorder; if (nargin == 1) - data = __recorder_getaudiodata__ (struct (recorder).recorder); + data = __recorder_getaudiodata__ (hrecorder); else - data = __recorder_getaudiodata__ (struct (recorder).recorder); - type = varargin{2}; - switch (type) + data = __recorder_getaudiodata__ (hrecorder); + switch (datatype) + case "double" + ## Do nothing, data is already of type double + case "single" + data = single (data); case "int16" data = int16 (data * (2.0 ^ 15)); case "int8" data = int8 (data * (2.0 ^ 7)); case "uint8" data = uint8 ((data + 1.0) * 0.5 * (2.0 ^ 8 - 1)); + otherwise + error ('@audiorecorder/getaudiodata: invalid DATATYPE "%s"', datatype) endswitch endif if (get (recorder, "NumberOfChannels") == 2) - data = data'; + data = data.'; else - data = data(1,:)'; + data = data(1,:).'; endif endfunction + + +## Tests of audiorecorder must not actually record anything. +%!testif HAVE_PORTAUDIO; audiodevinfo (1) > 0 +%! recorder = audiorecorder (44100, 16, 2); +%! data = getaudiodata (recorder); +%! assert (isa (data, "double")); +%! data = getaudiodata (recorder, "double"); +%! assert (isa (data, "double")); +%! data = getaudiodata (recorder, "single"); +%! assert (isa (data, "single")); +%! data = getaudiodata (recorder, "int16"); +%! assert (isa (data, "int16")); +%! data = getaudiodata (recorder, "int8"); +%! assert (isa (data, "int8")); +%! data = getaudiodata (recorder, "uint8"); +%! assert (isa (data, "uint8")); +%! assert (size (data)(1), recorder.TotalSamples); +%! assert (size (data)(2), 2); + +%!testif HAVE_PORTAUDIO; audiodevinfo (1) > 0 +%! recorder = audiorecorder (44100, 8, 1); +%! data = getaudiodata (recorder); +%! assert (size (data)(1), recorder.TotalSamples); +%! assert (size (data)(2), 1); + +## Test input validation +%!testif HAVE_PORTAUDIO; audiodevinfo (1) > 0 +%! recorder = audiorecorder (44100, 16, 2); +%! fail ("getaudiodata (recorder, 'foobar')", "invalid DATATYPE"); diff -r 103efb7e1600 -r 4392386b5ecb scripts/audio/@audiorecorder/getplayer.m --- a/scripts/audio/@audiorecorder/getplayer.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/audio/@audiorecorder/getplayer.m Thu Mar 03 13:37:10 2022 -0500 @@ -27,17 +27,23 @@ ## @deftypefn {} {@var{player} =} getplayer (@var{recorder}) ## Return an audioplayer object with data recorded by the audiorecorder object ## @var{recorder}. +## @seealso{@audioplayer/audioplayer, @audiorecorder/audiorecorder} ## @end deftypefn -function player = getplayer (varargin) +function player = getplayer (recorder) - if (nargin < 1 || nargin > 2) - print_usage (); - endif - - recorder = varargin{1}; data = getaudiodata (recorder); - player = audioplayer (data, get (recorder, "SampleRate"), + player = audioplayer (data, + get (recorder, "SampleRate"), get (recorder, "BitsPerSample")); endfunction + + +## FIXME: Uncomment when audioplayer constructor supports null data +%!#testif HAVE_PORTAUDIO; audiodevinfo (1) > 0 +%!# recorder = audiorecorder (44100, 16, 2); +%!# player = getplayer (recorder); +%!# assert (isa (player, "audioplayer")); +%!# assert (player.SampleRate, 44100); +%!# assert (player.BitsPerSample, 16); diff -r 103efb7e1600 -r 4392386b5ecb scripts/audio/@audiorecorder/isrecording.m --- a/scripts/audio/@audiorecorder/isrecording.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/audio/@audiorecorder/isrecording.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,17 +24,19 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} isrecording (@var{recorder}) +## @deftypefn {} {@var{tf} =} isrecording (@var{recorder}) ## Return true if the audiorecorder object @var{recorder} is currently ## recording audio and false otherwise. +## @seealso{@audiorecorder/pause, @audiorecorder/audiorecorder} ## @end deftypefn -function result = isrecording (recorder) +function tf = isrecording (recorder) - if (nargin < 1) - print_usage (); - endif - - result = __recorder_isrecording__ (struct (recorder).recorder); + tf = __recorder_isrecording__ (struct (recorder).recorder); endfunction + + +%!testif HAVE_PORTAUDIO; audiodevinfo (1) > 0 +%! recorder = audiorecorder (44100, 16, 2); +%! assert (isrecording (recorder), false); diff -r 103efb7e1600 -r 4392386b5ecb scripts/audio/@audiorecorder/pause.m --- a/scripts/audio/@audiorecorder/pause.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/audio/@audiorecorder/pause.m Thu Mar 03 13:37:10 2022 -0500 @@ -25,15 +25,17 @@ ## -*- texinfo -*- ## @deftypefn {} {} pause (@var{recorder}) -## Pause recording with audiorecorder object @var{recorder}. +## Pause recording for audiorecorder @var{recorder}. +## @seealso{@audiorecorder/resume, @audiorecorder/stop, +## @audiorecorder/audiorecorder} ## @end deftypefn function pause (recorder) - if (nargin < 1) - print_usage (); - endif - __recorder_pause__ (struct (recorder).recorder); endfunction + + +## No tests possible for this function +%!assert (1) diff -r 103efb7e1600 -r 4392386b5ecb scripts/audio/@audiorecorder/play.m --- a/scripts/audio/@audiorecorder/play.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/audio/@audiorecorder/play.m Thu Mar 03 13:37:10 2022 -0500 @@ -27,30 +27,33 @@ ## @deftypefn {} {@var{player} =} play (@var{recorder}) ## @deftypefnx {} {@var{player} =} play (@var{recorder}, @var{start}) ## @deftypefnx {} {@var{player} =} play (@var{recorder}, [@var{start}, @var{end}]) -## Play the audio recorded in @var{recorder} and return a corresponding -## audioplayer object. +## Play the audio recorded in @var{recorder} without blocking and return a +## corresponding audioplayer object. ## ## If the optional argument @var{start} is provided, begin playing -## @var{start} seconds in to the recording. +## @var{start} seconds into the recording. ## ## If the optional argument @var{end} is provided, stop playing at -## @var{end} seconds in the recording. +## @var{end} seconds into the recording. +## @seealso{@audiorecorder/getplayer, @audioplayer/audioplayer, +## @audiorecorder/audiorecorder} ## @end deftypefn -function player = play (varargin) +function player = play (recorder, start) - if (nargin < 1 || nargin > 2) - print_usage (); - endif + data = getaudiodata (recorder); + player = audioplayer (data, + get (recorder, "SampleRate"), + get (recorder, "BitsPerSample")); - recorder = varargin{1}; - data = getaudiodata (recorder); - player = audioplayer (data, get (recorder, "SampleRate"), - get (recorder, "BitsPerSample")); if (nargin == 1) play (player); else - play (player, varargin{2}); + play (player, start); endif endfunction + + +## No tests possible for this function +%!assert (1) diff -r 103efb7e1600 -r 4392386b5ecb scripts/audio/@audiorecorder/record.m --- a/scripts/audio/@audiorecorder/record.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/audio/@audiorecorder/record.m Thu Mar 03 13:37:10 2022 -0500 @@ -27,18 +27,25 @@ ## @deftypefn {} {} record (@var{recorder}) ## @deftypefnx {} {} record (@var{recorder}, @var{length}) ## Record audio without blocking using the audiorecorder object -## @var{recorder} until stopped or paused by the @var{stop} or @var{pause} -## method. +## @var{recorder} until paused or stopped by the @var{pause} or @var{stop} +## methods. ## ## Given the optional argument @var{length}, record for @var{length} seconds. +## @seealso{@audiorecorder/recordblocking, @audiorecorder/audiorecorder} ## @end deftypefn -function record (varargin) +function record (recorder, length) + + hrecorder = struct (recorder).recorder; - if (nargin < 1 || nargin > 2) - print_usage (); + if (nargin == 1) + __recorder_record__ (hrecorder); + else + __recorder_record__ (hrecorder, length); endif - __recorder_record__ (struct (varargin{1}).recorder, varargin{2:end}); +endfunction + -endfunction +## No tests possible for this function +%!assert (1) diff -r 103efb7e1600 -r 4392386b5ecb scripts/audio/@audiorecorder/recordblocking.m --- a/scripts/audio/@audiorecorder/recordblocking.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/audio/@audiorecorder/recordblocking.m Thu Mar 03 13:37:10 2022 -0500 @@ -28,14 +28,19 @@ ## Record audio with blocking (synchronous I/O). ## ## The length of the recording in seconds (@var{length}) must be specified. +## @seealso{@audiorecorder/record, @audiorecorder/audiorecorder} ## @end deftypefn -function recordblocking (varargin) +function recordblocking (recorder, length) if (nargin != 2) print_usage (); endif - __recorder_recordblocking__ (struct (varargin{1}).recorder, varargin{2}); + __recorder_recordblocking__ (struct (recorder).recorder, length); endfunction + + +## No tests possible for this function +%!assert (1) diff -r 103efb7e1600 -r 4392386b5ecb scripts/audio/@audiorecorder/resume.m --- a/scripts/audio/@audiorecorder/resume.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/audio/@audiorecorder/resume.m Thu Mar 03 13:37:10 2022 -0500 @@ -26,14 +26,16 @@ ## -*- texinfo -*- ## @deftypefn {} {} resume (@var{recorder}) ## Resume recording with the paused audiorecorder object @var{recorder}. +## @seealso{@audiorecorder/pause, @audiorecorder/stop, +## @audiorecorder/audiorecorder} ## @end deftypefn function resume (recorder) - if (nargin < 1) - print_usage (); - endif - __recorder_resume__ (struct (recorder).recorder); endfunction + + +## No tests possible for this function +%!assert (1) diff -r 103efb7e1600 -r 4392386b5ecb scripts/audio/@audiorecorder/set.m --- a/scripts/audio/@audiorecorder/set.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/audio/@audiorecorder/set.m Thu Mar 03 13:37:10 2022 -0500 @@ -25,42 +25,44 @@ ## -*- texinfo -*- ## @deftypefn {} {} set (@var{recorder}, @var{name}, @var{value}) -## @deftypefnx {} {} set (@var{recorder}, @var{properties}) +## @deftypefnx {} {} set (@var{recorder}, @var{name_cell}, @var{value_cell}) +## @deftypefnx {} {} set (@var{recorder}, @var{properties_struct}) ## @deftypefnx {} {@var{properties} =} set (@var{recorder}) ## Set the value of property specified by @var{name} to a given @var{value}. ## -## If @var{name} and @var{value} are cell arrays of the same size, set each -## property to a corresponding value. Given a structure with fields +## If @var{name} and @var{value} are cell arrays, set each property to a +## corresponding value. Given a structure of properties with fields ## corresponding to property names, set the value of those properties to the -## corresponding field values. Given only the recorder object, return a -## structure of settable properties. +## corresponding field values. Given only a recorder object, return a +## structure of configurable properties (i.e., writeable properties). +## @seealso{@audiorecorder/get, @audiorecorder/audiorecorder} ## @end deftypefn -function settable = set (varargin) +function properties = set (recorder, varargin) - if (nargin < 1 || nargin > 3) + if (nargin > 3) print_usage (); endif - recorder = struct (varargin{1}).recorder; + hrecorder = struct (recorder).recorder; if (nargin == 1) - settable.SampleRate = {}; - settable.Tag = {}; - settable.UserData = {}; + properties = struct ("SampleRate", {{}}, "Tag", {{}}, "UserData", {{}}); + elseif (nargin == 2) - for [value, property] = varargin{2} - setproperty (recorder, property, value); + for [value, property] = varargin{1} + setproperty (hrecorder, property, value); endfor + elseif (nargin == 3) - if (iscell (varargin{2})) + if (iscell (varargin{1})) index = 1; - for property = varargin{2} - setproperty (recorder, char (property), varargin{3}{index}); + for property = varargin{1} + setproperty (hrecorder, char (property), varargin{2}{index}); index += 1; endfor else - setproperty (recorder, varargin{2}, varargin{3}); + setproperty (hrecorder, varargin{1}, varargin{2}); endif endif @@ -68,15 +70,52 @@ function setproperty (recorder, property, value) - switch (property) - case "SampleRate" + switch (lower (property)) + case "samplerate" __recorder_set_fs__ (recorder, value); - case "Tag" + case "tag" __recorder_set_tag__ (recorder, value); - case "UserData" + case "userdata" __recorder_set_userdata__ (recorder, value); otherwise - error ("@audiorecorder/set: no such property or the property specified is read-only"); + error ('@audiorecorder/set: "%s" is not a valid property name or is read-only', property); endswitch endfunction + + +## Tests of audiorecorder must not actually record anything. +%!testif HAVE_PORTAUDIO; audiodevinfo (1) > 0 +%! recorder = audiorecorder (); +%! set (recorder, "SampleRate", 8800); +%! set (recorder, "Tag", "mytag"); +%! ## Also test case insensitivity +%! set (recorder, "USERdata", [1, 2; 3, 4]); +%! assert (recorder.SampleRate, 8800); +%! assert (recorder.Tag, "mytag"); +%! assert (recorder.UserData, [1, 2; 3, 4]); + +%!testif HAVE_PORTAUDIO; audiodevinfo (1) > 0 +%! recorder = audiorecorder (); +%! set (recorder, {"SampleRate", "Tag", "UserData"}, +%! {8800, "mytag", [1, 2; 3, 4]}); +%! assert (recorder.SampleRate, 8800); +%! assert (recorder.Tag, "mytag"); +%! assert (recorder.UserData, [1, 2; 3, 4]); + +%!testif HAVE_PORTAUDIO; audiodevinfo (1) > 0 +%! recorder = audiorecorder (); +%! props = set (recorder); +%! props.SampleRate = 8800; +%! props.Tag = "mytag"; +%! props.UserData = [1, 2; 3, 4]; +%! set (recorder, props); +%! assert (recorder.SampleRate, 8800); +%! assert (recorder.Tag, "mytag"); +%! assert (recorder.UserData, [1, 2; 3, 4]); + +## Test input validation +%!testif HAVE_PORTAUDIO; audiodevinfo (1) > 0 +%! recorder = audiorecorder (); +%! fail ('set (recorder, "foobar", 1)', "not a valid property name"); +%! fail ('set (recorder, "Running", 1)', "is read-only"); diff -r 103efb7e1600 -r 4392386b5ecb scripts/audio/@audiorecorder/stop.m --- a/scripts/audio/@audiorecorder/stop.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/audio/@audiorecorder/stop.m Thu Mar 03 13:37:10 2022 -0500 @@ -25,15 +25,18 @@ ## -*- texinfo -*- ## @deftypefn {} {} stop (@var{recorder}) -## Stop the audiorecorder object @var{recorder} and clean up any audio streams. +## Stop recording with audiorecorder object @var{recorder} and clean up any +## audio streams. +## @seealso{@audiorecorder/pause, @audiorecorder/resume, +## @audiorecorder/audiorecorder} ## @end deftypefn function stop (recorder) - if (nargin < 1) - print_usage (); - endif - __recorder_stop__ (struct (recorder).recorder); endfunction + + +## No tests possible for this function +%!assert (1) diff -r 103efb7e1600 -r 4392386b5ecb scripts/audio/@audiorecorder/subsasgn.m --- a/scripts/audio/@audiorecorder/subsasgn.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/audio/@audiorecorder/subsasgn.m Thu Mar 03 13:37:10 2022 -0500 @@ -28,9 +28,10 @@ ## Perform subscripted assignment on the audio recorder object @var{recorder}. ## ## Assign the value of @var{rhs} to the recorder property named by @var{idx}. +## @seealso{@audiorecorder/audiorecorder} ## @end deftypefn -function value = subsasgn (recorder, idx, rhs) +function recorder = subsasgn (recorder, idx, rhs) if (nargin != 3) print_usage (); @@ -43,9 +44,20 @@ if (strcmp (idx(1).type, ".")) field = idx.subs; set (recorder, field, rhs); - value = recorder; else error ("@audiorecorder/subsasgn: invalid subscript type"); endif endfunction + + +%!testif HAVE_PORTAUDIO; audiodevinfo (1) > 0 +%! recorder = audiorecorder (44100, 16, 2); +%! recorder.Tag = "mytag"; +%! assert (get (recorder, "Tag"), "mytag"); + +## Test input validation +%!testif HAVE_PORTAUDIO; audiodevinfo (1) > 0 +%! recorder = audiorecorder (44100, 16, 2); +%! fail ("recorder(1).Tag = 5", "invalid subscript type"); +%! fail ("recorder{1}.Tag = 5", "invalid subscript type"); diff -r 103efb7e1600 -r 4392386b5ecb scripts/audio/@audiorecorder/subsref.m --- a/scripts/audio/@audiorecorder/subsref.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/audio/@audiorecorder/subsref.m Thu Mar 03 13:37:10 2022 -0500 @@ -28,6 +28,7 @@ ## Perform subscripted selection on the audio recorder object @var{recorder}. ## ## Return the recorder property value named by @var{idx}. +## @seealso{@audiorecorder/audiorecorder} ## @end deftypefn function value = subsref (recorder, idx) @@ -48,3 +49,15 @@ endif endfunction + + +%!testif HAVE_PORTAUDIO; audiodevinfo (1) > 0 +%! recorder = audiorecorder (44100, 16, 2); +%! set (recorder, "Tag", "mytag"); +%! assert (recorder.Tag, "mytag"); + +## Test input validation +%!testif HAVE_PORTAUDIO; audiodevinfo (1) > 0 +%! recorder = audiorecorder (44100, 16, 2); +%! fail ("recorder(1).Tag", "invalid subscript type"); +%! fail ("recorder{1}.Tag", "invalid subscript type"); diff -r 103efb7e1600 -r 4392386b5ecb scripts/audio/record.m --- a/scripts/audio/record.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/audio/record.m Thu Mar 03 13:37:10 2022 -0500 @@ -33,10 +33,10 @@ ## for recording. ## ## For more control over audio recording, use the @code{audiorecorder} class. -## @seealso{sound, soundsc} +## @seealso{@audiorecorder/audiorecorder, sound, soundsc} ## @end deftypefn -function x = record (sec, fs = 8000) +function data = record (sec, fs = 8000) if (nargin < 1) print_usage (); @@ -50,16 +50,14 @@ error ("record: sample rate FS must be a positive number"); endif - x = []; + data = []; if (sec > 0) - rec = audiorecorder (fs, 16, 1); recordblocking (rec, sec); - x = getaudiodata (rec); - + data = getaudiodata (rec); endif endfunction diff -r 103efb7e1600 -r 4392386b5ecb scripts/audio/sound.m --- a/scripts/audio/sound.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/audio/sound.m Thu Mar 03 13:37:10 2022 -0500 @@ -30,7 +30,7 @@ ## Play audio data @var{y} at sample rate @var{fs} to the default audio ## device. ## -## The audio signal @var{y} can be a vector or a two-column array, representing +## The audio signal @var{y} can be a vector or a two-column array representing ## mono or stereo audio, respectively. ## ## If @var{fs} is not given, a default sample rate of 8000 samples per second @@ -40,7 +40,7 @@ ## audio device and defaults to 8 bits. ## ## For more control over audio playback, use the @code{audioplayer} class. -## @seealso{soundsc, record} +## @seealso{soundsc, @audioplayer/audioplayer, record} ## @end deftypefn function sound (y, fs, nbits) diff -r 103efb7e1600 -r 4392386b5ecb scripts/audio/soundsc.m --- a/scripts/audio/soundsc.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/audio/soundsc.m Thu Mar 03 13:37:10 2022 -0500 @@ -31,7 +31,7 @@ ## Scale the audio data @var{y} and play it at sample rate @var{fs} to the ## default audio device. ## -## The audio signal @var{y} can be a vector or a two-column array, representing +## The audio signal @var{y} can be a vector or a two-column array representing ## mono or stereo audio, respectively. ## ## If @var{fs} is not given, a default sample rate of 8000 samples per second @@ -46,19 +46,15 @@ ## are scaled to the range [-1, 1] instead. ## ## For more control over audio playback, use the @code{audioplayer} class. -## @seealso{sound, record} +## @seealso{sound, @audioplayer/audioplayer, record} ## @end deftypefn -function soundsc (y, fs, nbits, yrange) +function soundsc (y, fs, nbits, yrange = []) if (nargin < 1) print_usage (); endif - if (nargin < 4) - yrange = []; - endif - if (nargin < 2 || isempty (fs)) fs = 8000; elseif (nargin == 2 && numel (fs) > 1) diff -r 103efb7e1600 -r 4392386b5ecb scripts/deprecated/disable_diagonal_matrix.m --- a/scripts/deprecated/disable_diagonal_matrix.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/deprecated/disable_diagonal_matrix.m Thu Mar 03 13:37:10 2022 -0500 @@ -26,7 +26,7 @@ ## -*- texinfo -*- ## @deftypefn {} {@var{val} =} disable_diagonal_matrix () ## @deftypefnx {} {@var{old_val} =} disable_diagonal_matrix (@var{new_val}) -## @deftypefnx {} {} disable_diagonal_matrix (@var{new_val}, "local") +## @deftypefnx {} {@var{old_val} =} disable_diagonal_matrix (@var{new_val}, "local") ## ## @code{disable_diagonal_matrix} is deprecated and will be removed in Octave ## version 9. Use @code{optimize_diagonal_matrix} instead. diff -r 103efb7e1600 -r 4392386b5ecb scripts/deprecated/disable_permutation_matrix.m --- a/scripts/deprecated/disable_permutation_matrix.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/deprecated/disable_permutation_matrix.m Thu Mar 03 13:37:10 2022 -0500 @@ -26,7 +26,7 @@ ## -*- 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") +## @deftypefnx {} {@var{old_val} =} disable_permutation_matrix (@var{new_val}, "local") ## ## @code{disable_permutation_matrix} is deprecated and will be removed in ## Octave version 9. Use @code{optimize_permutation_matrix} instead. diff -r 103efb7e1600 -r 4392386b5ecb scripts/deprecated/disable_range.m --- a/scripts/deprecated/disable_range.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/deprecated/disable_range.m Thu Mar 03 13:37:10 2022 -0500 @@ -26,7 +26,7 @@ ## -*- texinfo -*- ## @deftypefn {} {@var{val} =} disable_range () ## @deftypefnx {} {@var{old_val} =} disable_range (@var{new_val}) -## @deftypefnx {} {} disable_range (@var{new_val}, "local") +## @deftypefnx {} {@var{old_val} =} disable_range (@var{new_val}, "local") ## ## @code{disable_range} is deprecated and will be removed in Octave version 9. ## Use @code{optimize_range} instead. diff -r 103efb7e1600 -r 4392386b5ecb scripts/deprecated/module.mk --- a/scripts/deprecated/module.mk Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/deprecated/module.mk Thu Mar 03 13:37:10 2022 -0500 @@ -5,7 +5,8 @@ %reldir%/disable_diagonal_matrix.m \ %reldir%/disable_permutation_matrix.m \ %reldir%/disable_range.m \ - %reldir%/runtests.m + %reldir%/shift.m \ + %reldir%/sparse_auto_mutate.m %canon_reldir%dir = $(fcnfiledir)/deprecated diff -r 103efb7e1600 -r 4392386b5ecb scripts/deprecated/runtests.m --- a/scripts/deprecated/runtests.m Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -######################################################################## -## -## Copyright (C) 2010-2022 The Octave Project Developers -## -## See the file COPYRIGHT.md in the top-level directory of this -## distribution or . -## -## 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 {} {} runtests () -## @deftypefnx {} {} runtests (@var{directory}) -## -## -## @code{runtests} is deprecated and will be removed in Octave version 8. -## Use @code{oruntests} instead. -## -## Execute built-in tests for all m-files in the specified @var{directory}. -## -## Test blocks in any C++ source files (@file{*.cc}) will also be executed -## for use with dynamically linked oct-file functions. -## -## If no directory is specified, operate on all directories in Octave's search -## path for functions. -## @seealso{oruntests, rundemos, test, path} -## @end deftypefn - -## FIXME: DEPRECATED: Remove in version 8. - -function runtests (varargin) - - persistent warned = false; - if (! warned) - warned = true; - warning ("Octave:deprecated-function", - "runtests is obsolete and will be removed from a future version of Octave, please use oruntests instead\n"); - endif - - oruntests (varargin{:}); - -endfunction diff -r 103efb7e1600 -r 4392386b5ecb scripts/deprecated/shift.m --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scripts/deprecated/shift.m Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,115 @@ +######################################################################## +## +## Copyright (C) 1995-2022 The Octave Project Developers +## +## See the file COPYRIGHT.md in the top-level directory of this +## distribution or . +## +## 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 {} {} shift (@var{x}, @var{b}) +## @deftypefnx {} {} shift (@var{x}, @var{b}, @var{dim}) +## +## @code{shift} is deprecated and will be removed in Octave version 10. Use +## @code{circshift} instead. +## +## If @var{x} is a vector, perform a circular shift of length @var{b} of +## the elements of @var{x}. +## +## If @var{x} is a matrix, do the same for each column of @var{x}. +## +## If the optional @var{dim} argument is given, operate along this dimension. +## @seealso{circshift} +## @end deftypefn + +## FIXME: DEPRECATED: Remove in version 10. + +function y = shift (x, b, dim) + + persistent warned = false; + if (! warned) + warned = true; + warning ("Octave:deprecated-function", + "shift is deprecated and will be removed from a future version of Octave, please use circshift instead\n"); + endif + + if (nargin < 2) + print_usage (); + endif + + if (numel (x) < 1) + error ("shift: X must not be empty"); + elseif (! (isscalar (b) && b == fix (b))) + error ("shift: B must be an integer"); + endif + + nd = ndims (x); + sz = size (x); + + if (nargin == 3) + if (!(isscalar (dim) && dim == fix (dim)) + || !(1 <= dim && dim <= nd)) + error ("shift: DIM must be an integer and a valid dimension"); + endif + else + ## Find the first non-singleton dimension. + (dim = find (sz > 1, 1)) || (dim = 1); + endif + + d = sz(dim); + + idx = repmat ({':'}, nd, 1); + if (b > 0) + b = rem (b, d); + idx{dim} = [d-b+1:d, 1:d-b]; + elseif (b < 0) + b = rem (abs (b), d); + idx{dim} = [b+1:d, 1:b]; + endif + + y = x(idx{:}); + +endfunction + + +%!test +%! a = [1, 2, 3]; +%! b = [4, 5, 6]; +%! c = [7, 8, 9]; +%! +%! r = [a, b, c]; +%! m = [a; b; c]; +%! +%! assert (shift (r, 0), r); +%! assert (shift (r, 3), [c, a, b]); +%! assert (shift (r, -6), [c, a, b]); +%! assert (shift (r, -3), [b, c, a]); +%! assert (shift (m, 1), [c; a; b]); +%! assert (shift (m, -2), [c; a; b]); + +## Test input validation +%!error shift () +%!error shift (1) +%!error shift ([], 1) +%!error shift (ones (2), ones (2)) +%!error shift (ones (2), 1.5) +%!error shift (1, 1, 1.5) +%!error shift (1, 1, 0) +%!error shift (1, 1, 3) diff -r 103efb7e1600 -r 4392386b5ecb scripts/deprecated/sparse_auto_mutate.m --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scripts/deprecated/sparse_auto_mutate.m Thu Mar 03 13:37:10 2022 -0500 @@ -0,0 +1,81 @@ +######################################################################## +## +## Copyright (C) 2022 The Octave Project Developers +## +## See the file COPYRIGHT.md in the top-level directory of this +## distribution or . +## +## 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{val} =} sparse_auto_mutate () +## @deftypefnx {} {@var{old_val} =} sparse_auto_mutate (@var{new_val}) +## @deftypefnx {} {@var{old_val} =} sparse_auto_mutate (@var{new_val}, "local") +## +## @code{sparse_auto_mutate} is deprecated and will be removed in Octave +## version 9. Use @code{optimize_diagonal_matrix} instead. +## +## Query or set whether storing diagonal 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{sparse_auto_mutate, disable_permutation_matrix} +## @end deftypefn + +## FIXME: DEPRECATED: Remove in version 10. + +function retval = sparse_auto_mutate (val, opt) + + persistent warned = false; + if (! warned) + warned = true; + warning ("Octave:deprecated-function", + "sparse_auto_mutate is obsolete, has no effect, and will be removed from a future version of Octave\n"); + endif + + if (nargin == 0 || nargout > 0) + ## Always false now. + retval = false; + return; + endif + + if (nargin == 2) + if (! (ischar (opt) && strcmp (opt, "local"))) + error ('sparse_auto_mutate: second argument must be "local"'); + endif + nargin = 1; + endif + + ## Don't bother warning that "local" is invalid outside of a + ## function. + + if (nargin > 1) + print_usage (); + endif + + if (! islogical (val)) + error ("sparse_auto_mutate: argument must be a logical value"); + endif + +endfunction diff -r 103efb7e1600 -r 4392386b5ecb scripts/elfun/acosd.m --- a/scripts/elfun/acosd.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/elfun/acosd.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,7 +24,7 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} acosd (@var{x}) +## @deftypefn {} {@var{y} =} acosd (@var{x}) ## Compute the inverse cosine in degrees for each element of @var{x}. ## @seealso{cosd, acos} ## @end deftypefn diff -r 103efb7e1600 -r 4392386b5ecb scripts/elfun/acot.m --- a/scripts/elfun/acot.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/elfun/acot.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,7 +24,7 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} acot (@var{x}) +## @deftypefn {} {@var{y} =} acot (@var{x}) ## Compute the inverse cotangent in radians for each element of @var{x}. ## @seealso{cot, acotd} ## @end deftypefn diff -r 103efb7e1600 -r 4392386b5ecb scripts/elfun/acotd.m --- a/scripts/elfun/acotd.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/elfun/acotd.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,7 +24,7 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} acotd (@var{x}) +## @deftypefn {} {@var{y} =} acotd (@var{x}) ## Compute the inverse cotangent in degrees for each element of @var{x}. ## @seealso{cotd, acot} ## @end deftypefn diff -r 103efb7e1600 -r 4392386b5ecb scripts/elfun/acoth.m --- a/scripts/elfun/acoth.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/elfun/acoth.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,7 +24,7 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} acoth (@var{x}) +## @deftypefn {} {@var{y} =} acoth (@var{x}) ## Compute the inverse hyperbolic cotangent of each element of @var{x}. ## @seealso{coth} ## @end deftypefn diff -r 103efb7e1600 -r 4392386b5ecb scripts/elfun/acsc.m --- a/scripts/elfun/acsc.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/elfun/acsc.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,7 +24,7 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} acsc (@var{x}) +## @deftypefn {} {@var{y} =} acsc (@var{x}) ## Compute the inverse cosecant in radians for each element of @var{x}. ## @seealso{csc, acscd} ## @end deftypefn diff -r 103efb7e1600 -r 4392386b5ecb scripts/elfun/acscd.m --- a/scripts/elfun/acscd.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/elfun/acscd.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,7 +24,7 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} acscd (@var{x}) +## @deftypefn {} {@var{y} =} acscd (@var{x}) ## Compute the inverse cosecant in degrees for each element of @var{x}. ## @seealso{cscd, acsc} ## @end deftypefn diff -r 103efb7e1600 -r 4392386b5ecb scripts/elfun/acsch.m --- a/scripts/elfun/acsch.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/elfun/acsch.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,7 +24,7 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} acsch (@var{x}) +## @deftypefn {} {@var{y} =} acsch (@var{x}) ## Compute the inverse hyperbolic cosecant of each element of @var{x}. ## @seealso{csch} ## @end deftypefn diff -r 103efb7e1600 -r 4392386b5ecb scripts/elfun/asec.m --- a/scripts/elfun/asec.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/elfun/asec.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,7 +24,7 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} asec (@var{x}) +## @deftypefn {} {@var{y} =} asec (@var{x}) ## Compute the inverse secant in radians for each element of @var{x}. ## @seealso{sec, asecd} ## @end deftypefn diff -r 103efb7e1600 -r 4392386b5ecb scripts/elfun/asecd.m --- a/scripts/elfun/asecd.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/elfun/asecd.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,7 +24,7 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} asecd (@var{x}) +## @deftypefn {} {@var{y} =} asecd (@var{x}) ## Compute the inverse secant in degrees for each element of @var{x}. ## @seealso{secd, asec} ## @end deftypefn diff -r 103efb7e1600 -r 4392386b5ecb scripts/elfun/asech.m --- a/scripts/elfun/asech.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/elfun/asech.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,7 +24,7 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} asech (@var{x}) +## @deftypefn {} {@var{y} =} asech (@var{x}) ## Compute the inverse hyperbolic secant of each element of @var{x}. ## @seealso{sech} ## @end deftypefn diff -r 103efb7e1600 -r 4392386b5ecb scripts/elfun/asind.m --- a/scripts/elfun/asind.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/elfun/asind.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,7 +24,7 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} asind (@var{x}) +## @deftypefn {} {@var{y} =} asind (@var{x}) ## Compute the inverse sine in degrees for each element of @var{x}. ## @seealso{sind, asin} ## @end deftypefn diff -r 103efb7e1600 -r 4392386b5ecb scripts/elfun/atan2d.m --- a/scripts/elfun/atan2d.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/elfun/atan2d.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,19 +24,19 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} atan2d (@var{y}, @var{x}) +## @deftypefn {} {@var{d} =} atan2d (@var{y}, @var{x}) ## Compute atan (@var{y} / @var{x}) in degrees for corresponding elements ## from @var{y} and @var{x}. ## @seealso{tand, atan2} ## @end deftypefn -function retval = atan2d (y, x) +function d = atan2d (y, x) if (nargin != 2) print_usage (); endif - retval = 180 ./ pi .* atan2 (y, x); + d = 180 ./ pi .* atan2 (y, x); endfunction diff -r 103efb7e1600 -r 4392386b5ecb scripts/elfun/atand.m --- a/scripts/elfun/atand.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/elfun/atand.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,7 +24,7 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} atand (@var{x}) +## @deftypefn {} {@var{y} =} atand (@var{x}) ## Compute the inverse tangent in degrees for each element of @var{x}. ## @seealso{tand, atan} ## @end deftypefn diff -r 103efb7e1600 -r 4392386b5ecb scripts/elfun/cosd.m --- a/scripts/elfun/cosd.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/elfun/cosd.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,7 +24,7 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} cosd (@var{x}) +## @deftypefn {} {@var{y} =} cosd (@var{x}) ## Compute the cosine for each element of @var{x} in degrees. ## ## The function is more accurate than @code{cos} for large values of @var{x} diff -r 103efb7e1600 -r 4392386b5ecb scripts/elfun/cot.m --- a/scripts/elfun/cot.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/elfun/cot.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,7 +24,7 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} cot (@var{x}) +## @deftypefn {} {@var{y} =} cot (@var{x}) ## Compute the cotangent for each element of @var{x} in radians. ## @seealso{acot, cotd, coth} ## @end deftypefn diff -r 103efb7e1600 -r 4392386b5ecb scripts/elfun/cotd.m --- a/scripts/elfun/cotd.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/elfun/cotd.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,7 +24,7 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} cotd (@var{x}) +## @deftypefn {} {@var{y} =} cotd (@var{x}) ## Compute the cotangent for each element of @var{x} in degrees. ## @seealso{acotd, cot} ## @end deftypefn diff -r 103efb7e1600 -r 4392386b5ecb scripts/elfun/coth.m --- a/scripts/elfun/coth.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/elfun/coth.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,7 +24,7 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} coth (@var{x}) +## @deftypefn {} {@var{y} =} coth (@var{x}) ## Compute the hyperbolic cotangent of each element of @var{x}. ## @seealso{acoth} ## @end deftypefn diff -r 103efb7e1600 -r 4392386b5ecb scripts/elfun/csc.m --- a/scripts/elfun/csc.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/elfun/csc.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,7 +24,7 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} csc (@var{x}) +## @deftypefn {} {@var{y} =} csc (@var{x}) ## Compute the cosecant for each element of @var{x} in radians. ## @seealso{acsc, cscd, csch} ## @end deftypefn diff -r 103efb7e1600 -r 4392386b5ecb scripts/elfun/cscd.m --- a/scripts/elfun/cscd.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/elfun/cscd.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,7 +24,7 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} cscd (@var{x}) +## @deftypefn {} {@var{y} =} cscd (@var{x}) ## Compute the cosecant for each element of @var{x} in degrees. ## @seealso{acscd, csc} ## @end deftypefn diff -r 103efb7e1600 -r 4392386b5ecb scripts/elfun/csch.m --- a/scripts/elfun/csch.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/elfun/csch.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,7 +24,7 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} csch (@var{x}) +## @deftypefn {} {@var{y} =} csch (@var{x}) ## Compute the hyperbolic cosecant of each element of @var{x}. ## @seealso{acsch} ## @end deftypefn diff -r 103efb7e1600 -r 4392386b5ecb scripts/elfun/sec.m --- a/scripts/elfun/sec.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/elfun/sec.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,7 +24,7 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} sec (@var{x}) +## @deftypefn {} {@var{y} =} sec (@var{x}) ## Compute the secant for each element of @var{x} in radians. ## @seealso{asec, secd, sech} ## @end deftypefn diff -r 103efb7e1600 -r 4392386b5ecb scripts/elfun/secd.m --- a/scripts/elfun/secd.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/elfun/secd.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,7 +24,7 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} secd (@var{x}) +## @deftypefn {} {@var{y} =} secd (@var{x}) ## Compute the secant for each element of @var{x} in degrees. ## @seealso{asecd, sec} ## @end deftypefn diff -r 103efb7e1600 -r 4392386b5ecb scripts/elfun/sech.m --- a/scripts/elfun/sech.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/elfun/sech.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,7 +24,7 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} sech (@var{x}) +## @deftypefn {} {@var{y} =} sech (@var{x}) ## Compute the hyperbolic secant of each element of @var{x}. ## @seealso{asech} ## @end deftypefn diff -r 103efb7e1600 -r 4392386b5ecb scripts/elfun/sind.m --- a/scripts/elfun/sind.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/elfun/sind.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,7 +24,7 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} sind (@var{x}) +## @deftypefn {} {@var{y} =} sind (@var{x}) ## Compute the sine for each element of @var{x} in degrees. ## ## The function is more accurate than @code{sin} for large values of @var{x} diff -r 103efb7e1600 -r 4392386b5ecb scripts/elfun/tand.m --- a/scripts/elfun/tand.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/elfun/tand.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,7 +24,7 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} tand (@var{x}) +## @deftypefn {} {@var{y} =} tand (@var{x}) ## Compute the tangent for each element of @var{x} in degrees. ## ## Returns zero for elements where @code{@var{x}/180} is an integer and diff -r 103efb7e1600 -r 4392386b5ecb scripts/general/interp2.m --- a/scripts/general/interp2.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/general/interp2.m Thu Mar 03 13:37:10 2022 -0500 @@ -69,7 +69,8 @@ ## interpolation with smooth first derivative. ## ## @item @qcode{"cubic"} -## Cubic interpolation (same as @qcode{"pchip"}). +## Cubic interpolation using a convolution kernel function---third order +## method with smooth first derivative. ## ## @item @qcode{"spline"} ## Cubic spline interpolation---smooth first and second derivatives @@ -149,7 +150,7 @@ ## Calculate the interleaved input vectors. p = 2^n; XI = (p:p*zc)/p; - YI = (p:p*zr)'/p; + YI = (p:p*zr).'/p; endif if (! isnumeric (XI) || ! isnumeric (YI)) error ("interp2: XI, YI must be numeric"); @@ -180,7 +181,13 @@ error ("interp2: Y must be strictly monotonic"); endif - if (any (strcmp (method, {"nearest", "linear", "pchip", "cubic"}))) + if (strcmp (method, "cubic") && (rows (Z) < 3 || columns (Z) < 3)) + warning (["interp2: cubic requires at least 3 points in each " ... + "dimension. Falling back to linear interpolation."]); + method = "linear"; + endif + + if (any (strcmp (method, {"nearest", "linear", "pchip"}))) ## If Xi and Yi are vectors of different orientation build a grid if ((isrow (XI) && iscolumn (YI)) || (iscolumn (XI) && isrow (YI))) @@ -244,30 +251,17 @@ idx = sub2ind (size (Z), yidx+jj, xidx+ii); ZI = Z(idx); - elseif (strcmp (method, "pchip") || strcmp (method, "cubic")) + elseif (strcmp (method, "pchip")) if (length (X) < 2 || length (Y) < 2) - error ("interp2: %s requires at least 2 points in each dimension", - method); + error ("interp2: pchip requires at least 2 points in each dimension"); endif ## first order derivatives DX = __pchip_deriv__ (X, Z, 2); DY = __pchip_deriv__ (Y, Z, 1); ## Compute mixed derivatives row-wise and column-wise. Use the average. - DXY = (__pchip_deriv__ (X, DY, 2) + __pchip_deriv__ (Y, DX, 1))/2; - - if (iscomplex (Z)) - ## __pchip_deriv__ works only on real part. Do it again for imag part. - ## FIXME: Adapt __pchip_deriv__ to correctly handle complex input. - - ## first order derivatives - DX += 1i * __pchip_deriv__ (X, imag (Z), 2); - DY += 1i * __pchip_deriv__ (Y, imag (Z), 1); - ## Compute mixed derivatives row-wise and column-wise. Use the average. - DXY += 1i * (__pchip_deriv__ (X, imag (DY), 2) - + __pchip_deriv__ (Y, imag (DX), 1))/2; - endif + DXY = (__pchip_deriv__ (X, DY, 2) + __pchip_deriv__ (Y, DX, 1)) / 2; ## do the bicubic interpolation hx = diff (X); hx = hx(xidx); @@ -304,19 +298,19 @@ yb{1,1} = t2 + 1; ZI = zeros (size (XI)); - for i = 1:2 - for j = 1:2 - zidx = sub2ind (size (Z), yidx+(j-1), xidx+(i-1)); - ZI += xb{1,i} .* yb{1,j} .* Z(zidx); - ZI += xb{2,i} .* yb{1,j} .* DX(zidx); - ZI += xb{1,i} .* yb{2,j} .* DY(zidx); - ZI += xb{2,i} .* yb{2,j} .* DXY(zidx); + for ix = 1:2 + for iy = 1:2 + zidx = sub2ind (size (Z), yidx+(iy-1), xidx+(ix-1)); + ZI += xb{1,ix} .* yb{1,iy} .* Z(zidx); + ZI += xb{2,ix} .* yb{1,iy} .* DX(zidx); + ZI += xb{1,ix} .* yb{2,iy} .* DY(zidx); + ZI += xb{2,ix} .* yb{2,iy} .* DXY(zidx); endfor endfor endif - else + else # cubic or spline methods ## Check dimensions of XI and YI if (isvector (XI) && isvector (YI) && ! size_equal (XI, YI)) @@ -326,15 +320,50 @@ endif if (strcmp (method, "spline")) - if (isgriddata (XI) && isgriddata (YI')) + if (isgriddata (XI) && isgriddata (YI.')) ZI = __splinen__ ({Y, X}, Z, {YI(:,1), XI(1,:)}, extrap, "spline"); else error ("interp2: XI, YI must have uniform spacing ('meshgrid' format)"); endif - endif + return; # spline doesn't use extrapolation value (MATLAB compatibility) + elseif (strcmp (method, "cubic")) + ## reduce to vectors if interpolation points are a meshgrid + if (size_equal (XI, YI) && all (all (XI(1, :) == XI & YI(:, 1) == YI))) + XI = XI(1, :); + YI = YI(:, 1); + endif + + ## make X a row vector + X = X.'; - return; # spline doesn't need NA extrapolation value (MATLAB compatibility) + ## quadratic padding + additional zeros for the special case of copying + ## the last line (like x=1:5, xi=5, requires to have indices 6 and 7) + row_1 = 3*Z(1, :, :) - 3*Z(2, :, :) + Z(3, :, :); + row_end = 3*Z(end, :, :) - 3*Z(end-1, :, :) + Z(end-2, :, :); + ZI = [3*row_1(:, 1, :) - 3*row_1(:, 2, :) + row_1(:, 3, :), ... + row_1, ... + 3*row_1(:, end, :) - 3*row_1(:, end-1, :) + row_1(:, end-2, :), ... + 0; + # + 3*Z(:, 1, :) - 3*Z(:, 2, :) + Z(:, 3, :), ... + Z, ... + 3*Z(:, end, :) - 3*Z(:, end-1, :) + Z(:, end-2, :), ... + zeros(rows (Z), 1, size (Z, 3)); + # + 3*row_end(:, 1, :) - 3*row_end(:, 2, :) + row_end(:, 3, :), ... + row_end, ... + 3*row_end(:, end, :) - 3*row_end(:, end-1, :) + row_end(:, end-2, :), ... + 0; + zeros(1, columns (Z) + 3, size (Z, 3))]; + ## interpolate + if (isrow (XI) && iscolumn (YI)) + ZI = conv_interp_vec (ZI, Y, YI, @cubic, [-2, 2], 1); + ZI = conv_interp_vec (ZI, X, XI, @cubic, [-2, 2], 2); + else + ZI = conv_interp_pairs (ZI, X, Y, XI, YI, @cubic, [-2, 2]); + endif + endif endif ## extrapolation 'extrap' @@ -367,6 +396,70 @@ b = ! any (d1(:) != 0); endfunction +## cubic convolution kernel with a = -0.5 for MATLAB compatibility. +function w = cubic (h) + + absh = abs (h); + absh01 = absh <= 1; + absh12 = absh <= 2 & ! absh01; + absh_sqr = absh .* absh; + absh_cube = absh_sqr .* absh; + w = ... # for |h| <= 1 + (1.5 * absh_cube - 2.5 * absh_sqr + 1) .* absh01 ... + ... # for 1 < |h| <= 2 + + (-0.5 * absh_cube + 2.5 * absh_sqr - 4 * absh + 2) .* absh12; + +endfunction + +## bicubic interpolation of full matrix in one direction with vector +function out = conv_interp_vec (Z, XY, XIYI, kernel, kernel_bounds, axis) + + ## allocate output + out_shape = size (Z); + out_shape(axis) = length (XIYI); + out = zeros (out_shape); + + ## get indexes and distances h + spread = abs (XY(1) - XY(2)); + idx = lookup (XY, XIYI, "l"); + h = (XIYI - XY(idx)) / spread; + idx += -kernel_bounds(1) - 1; # apply padding for indexes + + ## interpolate + for shift = kernel_bounds(1)+1 : kernel_bounds(2) + if (axis == 1) + out += Z(idx + shift, :) .* kernel (shift - h); + else + out += Z(:, idx + shift) .* kernel (shift - h); + endif + endfor + +endfunction + +## bicubic interpolation of arbitrary XI-YI-pairs +function out = conv_interp_pairs (Z, X, Y, XI, YI, kernel, kernel_bounds) + + spread_x = abs (X(1, 1) - X(1, 2)); + spread_y = abs (Y(1, 1) - Y(2, 1)); + idx_x = lookup (X, XI, "l"); + idx_y = lookup (Y, YI, "l"); + h_x = (XI - reshape (X(idx_x), size (idx_x))) / spread_x; + h_y = (YI - reshape (Y(idx_y), size (idx_y))) / spread_y; + + # adjust indexes for padding + idx_x += -kernel_bounds(1) - 1; + idx_y += -kernel_bounds(1) - 1; + + shifts = kernel_bounds(1)+1 : kernel_bounds(2); + [SX(1,1,:,:), SY(1,1,:,:)] = meshgrid (shifts, shifts); + pixels = Z(sub2ind (size (Z), idx_y + SY, idx_x + SX)); + kernel_y = kernel (reshape (shifts, 1, 1, [], 1) - h_y); + kernel_x = kernel (reshape (shifts, 1, 1, 1, []) - h_x); + out_x = sum (pixels .* kernel_x, 4); + out = sum (out_x .* kernel_y, 3); + +endfunction + %!demo %! clf; @@ -374,7 +467,7 @@ %! A = [13,-1,12;5,4,3;1,6,2]; %! x = [0,1,4]; y = [10,11,12]; %! xi = linspace (min (x), max (x), 17); -%! yi = linspace (min (y), max (y), 26)'; +%! yi = linspace (min (y), max (y), 26).'; %! mesh (xi,yi,interp2 (x,y,A,xi,yi, "linear")); %! [x,y] = meshgrid (x,y); %! hold on; plot3 (x,y,A,"b*"); hold off; @@ -383,9 +476,9 @@ %! clf; %! colormap ("default"); %! [x,y,A] = peaks (10); -%! x = x(1,:)'; y = y(:,1); +%! x = x(1,:).'; y = y(:,1); %! xi = linspace (min (x), max (x), 41); -%! yi = linspace (min (y), max (y), 41)'; +%! yi = linspace (min (y), max (y), 41).'; %! mesh (xi,yi,interp2 (x,y,A,xi,yi, "linear")); %! [x,y] = meshgrid (x,y); %! hold on; plot3 (x,y,A,"b*"); hold off; @@ -396,7 +489,7 @@ %! A = [13,-1,12;5,4,3;1,6,2]; %! x = [0,1,4]; y = [10,11,12]; %! xi = linspace (min (x), max (x), 17); -%! yi = linspace (min (y), max (y), 26)'; +%! yi = linspace (min (y), max (y), 26).'; %! mesh (xi,yi,interp2 (x,y,A,xi,yi, "nearest")); %! [x,y] = meshgrid (x,y); %! hold on; plot3 (x,y,A,"b*"); hold off; @@ -405,33 +498,31 @@ %! clf; %! colormap ("default"); %! [x,y,A] = peaks (10); -%! x = x(1,:)'; y = y(:,1); +%! x = x(1,:).'; y = y(:,1); %! xi = linspace (min (x), max (x), 41); -%! yi = linspace (min (y), max (y), 41)'; +%! yi = linspace (min (y), max (y), 41).'; %! mesh (xi,yi,interp2 (x,y,A,xi,yi, "nearest")); %! [x,y] = meshgrid (x,y); %! hold on; plot3 (x,y,A,"b*"); hold off; -## 'pchip' commented out since it is the same as 'cubic' -%!#demo +%!demo %! clf; %! colormap ("default"); %! A = [13,-1,12;5,4,3;1,6,2]; %! x = [0,1,2]; y = [10,11,12]; %! xi = linspace (min (x), max (x), 17); -%! yi = linspace (min (y), max (y), 26)'; +%! yi = linspace (min (y), max (y), 26).'; %! mesh (xi,yi,interp2 (x,y,A,xi,yi, "pchip")); %! [x,y] = meshgrid (x,y); %! hold on; plot3 (x,y,A,"b*"); hold off; -## 'pchip' commented out since it is the same as 'cubic' -%!#demo +%!demo %! clf; %! colormap ("default"); %! [x,y,A] = peaks (10); -%! x = x(1,:)'; y = y(:,1); +%! x = x(1,:).'; y = y(:,1); %! xi = linspace (min (x), max (x), 41); -%! yi = linspace (min (y), max (y), 41)'; +%! yi = linspace (min (y), max (y), 41).'; %! mesh (xi,yi,interp2 (x,y,A,xi,yi, "pchip")); %! [x,y] = meshgrid (x,y); %! hold on; plot3 (x,y,A,"b*"); hold off; @@ -442,7 +533,7 @@ %! A = [13,-1,12;5,4,3;1,6,2]; %! x = [0,1,2]; y = [10,11,12]; %! xi = linspace (min (x), max (x), 17); -%! yi = linspace (min (y), max (y), 26)'; +%! yi = linspace (min (y), max (y), 26).'; %! mesh (xi,yi,interp2 (x,y,A,xi,yi, "cubic")); %! [x,y] = meshgrid (x,y); %! hold on; plot3 (x,y,A,"b*"); hold off; @@ -451,9 +542,9 @@ %! clf; %! colormap ("default"); %! [x,y,A] = peaks (10); -%! x = x(1,:)'; y = y(:,1); +%! x = x(1,:).'; y = y(:,1); %! xi = linspace (min (x), max (x), 41); -%! yi = linspace (min (y), max (y), 41)'; +%! yi = linspace (min (y), max (y), 41).'; %! mesh (xi,yi,interp2 (x,y,A,xi,yi, "cubic")); %! [x,y] = meshgrid (x,y); %! hold on; plot3 (x,y,A,"b*"); hold off; @@ -464,7 +555,7 @@ %! A = [13,-1,12;5,4,3;1,6,2]; %! x = [0,1,2]; y = [10,11,12]; %! xi = linspace (min (x), max (x), 17); -%! yi = linspace (min (y), max (y), 26)'; +%! yi = linspace (min (y), max (y), 26).'; %! mesh (xi,yi,interp2 (x,y,A,xi,yi, "spline")); %! [x,y] = meshgrid (x,y); %! hold on; plot3 (x,y,A,"b*"); hold off; @@ -473,36 +564,115 @@ %! clf; %! colormap ("default"); %! [x,y,A] = peaks (10); -%! x = x(1,:)'; y = y(:,1); +%! x = x(1,:).'; y = y(:,1); %! xi = linspace (min (x), max (x), 41); -%! yi = linspace (min (y), max (y), 41)'; +%! yi = linspace (min (y), max (y), 41).'; %! mesh (xi,yi,interp2 (x,y,A,xi,yi, "spline")); %! [x,y] = meshgrid (x,y); %! hold on; plot3 (x,y,A,"b*"); hold off; +%!shared x, y, orig, xi, yi, expected %!test # simple test %! x = [1,2,3]; %! y = [4,5,6,7]; %! [X, Y] = meshgrid (x, y); %! orig = X.^2 + Y.^3; -%! xi = [1.2,2, 1.5]; -%! yi = [6.2, 4.0, 5.0]'; +%! xi = [0.8, 1.2, 2.0, 1.5]; +%! yi = [6.2, 4.0, 5.0, 7.1].'; +%! +%! # check nearest neighbor +%! expected = ... +%! [NA, 217, 220, 220; +%! NA, 65, 68, 68; +%! NA, 126, 129, 129; +%! NA, NA, NA, NA]; +%! result = interp2 (x, y, orig, xi, yi, "nearest"); +%! assert (result, expected); %! +%! # check invariance of translation +%! result = interp2 (x+3, y-7, orig, xi+3, yi-7, "nearest"); +%! assert (result, expected); +%! +%! # check invariance of scaling +%! result = interp2 (x*3, y*(-7), orig, xi*3, yi*(-7), "nearest"); +%! assert (result, expected); +%! +%! # check interpolation with index pairs +%! result = interp2 (x, y, orig, xi(2:4), yi(1:3).', "nearest"); +%! assert (result, expected(sub2ind(size(expected), 1:3, 2:4))); +%! +%! # check bilinear interpolation %! expected = ... -%! [243, 245.4, 243.9; -%! 65.6, 68, 66.5; -%! 126.6, 129, 127.5]; -%! result = interp2 (x,y,orig, xi, yi); +%! [NA, 243, 245.4, 243.9; +%! NA, 65.6, 68, 66.5; +%! NA, 126.6, 129, 127.5; +%! NA, NA, NA, NA]; +%! result = interp2 (x, y, orig, xi, yi); +%! assert (result, expected, 1000*eps); +%! +%! # check invariance of translation +%! result = interp2 (x+3, y-7, orig, xi+3, yi-7); +%! assert (result, expected, 1000*eps); +%! +%! # check invariance of scaling +%! result = interp2 (x*3, y*(-7), orig, xi*3, yi*(-7)); +%! assert (result, expected, 1000*eps); +%! +%! # check interpolation with index pairs +%! result = interp2 (x, y, orig, xi(2:4), yi(1:3).'); +%! assert (result, expected(sub2ind(size(expected), 1:3, 2:4)), 1000*eps); +%! +%! # check spline interpolation +%! expected = ... +%! [238.968, 239.768, 242.328, 240.578; +%! 64.64, 65.44, 68, 66.25; +%! 125.64, 126.44, 129, 127.25; +%! 358.551, 359.351, 361.911, 360.161]; +%! result = interp2 (x, y, orig, xi, yi, "spline"); +%! assert (result, expected, 1000*eps); %! +%! # check invariance of translation +%! result = interp2 (x+3, y-7, orig, xi+3, yi-7, "spline"); %! assert (result, expected, 1000*eps); +%! +%! # check invariance of scaling +%! result = interp2 (x*3, y*(-7), orig, xi*3, yi*(-7), "spline"); +%! assert (result, expected, 1000*eps); +%! +%!test <62133> +%! # FIXME: spline interpolation does not support index pairs, Matlab does. +%! result = interp2 (x, y, orig, xi(2:4), yi(1:3).', "spline"); +%! assert (result, expected(sub2ind(size(expected), 1:3, 2:4)), 1000*eps); +%! +%!test <*61754> +%! # check bicubic interpolation +%! expected = ... +%! [NA, 239.96, 242.52, 240.77; +%! NA, 65.44, 68, 66.25; +%! NA, 126.44, 129, 127.25; +%! NA, NA, NA, NA]; +%! result = interp2 (x, y, orig, xi, yi, "cubic"); +%! assert (result, expected, 10000*eps); +%! +%! # check invariance of translation +%! result = interp2 (x+3, y-7, orig, xi+3, yi-7, "cubic"); +%! assert (result, expected, 10000*eps); +%! +%! # check invariance of scaling +%! result = interp2 (x*3, y*(-7), orig, xi*3, yi*(-7), "cubic"); +%! assert (result, expected, 10000*eps); +%! +%! # check interpolation with index pairs +%! result = interp2 (x, y, orig, xi(2:4), yi(1:3).', "cubic"); +%! assert (result, expected(sub2ind(size(expected), 1:3, 2:4)), 10000*eps); ## Test that interpolating a complex matrix is equivalent to interpolating its ## real and imaginary parts separately. -%!test <61863> +%!test <*61863> %! xi = [2.5, 3.5]; -%! yi = [0.5, 1.5]'; -%! orig = rand (2, 3) + 1i * rand (2, 3); -%! for method = {"nearest", "linear", "pchip", "spline"} +%! yi = [0.5, 1.5].'; +%! orig = rand (4, 3) + 1i * rand (4, 3); +%! for method = {"nearest", "linear", "pchip", "cubic", "spline"} %! interp_complex = interp2 (orig, xi, yi, method{1}); %! interp_real = interp2 (real (orig), xi, yi, method{1}); %! interp_imag = interp2 (imag (orig), xi, yi, method{1}); @@ -515,7 +685,7 @@ %! y = [4,5,6,7]; %! [X, Y] = meshgrid (x, y); %! orig = X.^2 + Y.^3; -%! xi = [1:0.25:3]; yi = [4:0.25:7]'; +%! xi = [1:0.25:3]; yi = [4:0.25:7].'; %! expected = interp2 (x,y,orig, xi, yi); %! result = interp2 (orig, 2); %! @@ -535,18 +705,20 @@ %! [X, Y] = meshgrid (x,y); %! orig = X.^2 + Y.^3; %! xi = [0,4]; -%! yi = [3,8]'; +%! yi = [3,8].'; %! assert (interp2 (x,y,orig, xi, yi), [NA,NA;NA,NA]); %! assert (interp2 (x,y,orig, xi, yi,"linear", 0), [0,0;0,0]); %! assert (interp2 (x,y,orig, xi, yi,"linear", 2), [2,2;2,2]); %! assert (interp2 (x,y,orig, xi, yi,"spline", 2), [2,2;2,2]); %! assert (interp2 (x,y,orig, xi, yi,"linear", 0+1i), [0+1i,0+1i;0+1i,0+1i]); %! assert (interp2 (x,y,orig, xi, yi,"spline"), [27,43;512,528]); +%! assert (interp2 (x,y,orig, xi, yi,"cubic"), [NA,NA;NA,NA]); +%! assert (interp2 (x,y,orig, xi, yi,"cubic", 2), [2,2;2,2]); %!test # for values at boundaries %! A = [1,2;3,4]; %! x = [0,1]; -%! y = [2,3]'; +%! y = [2,3].'; %! assert (interp2 (x,y,A,x,y,"linear"), A); %! assert (interp2 (x,y,A,x,y,"nearest"), A); @@ -569,20 +741,26 @@ %!assert (interp2 (z), zout, tol) %!assert (interp2 (z, "linear"), zout, tol) %!assert (interp2 (z, "pchip"), zout, tol) -%!assert (interp2 (z, "cubic"), zout, 10 * tol) +%!assert (interp2 (z, "cubic"), zout, tol) %!assert (interp2 (z, "spline"), zout, tol) -%!assert (interp2 (z, [2 3 1], [2 2 2]', "linear"), +%!assert (interp2 (z, [2 3 1], [2 2 2].', "linear"), %! repmat ([5, 7, 3], [3, 1]), tol) -%!assert (interp2 (z, [2 3 1], [2 2 2]', "pchip"), +%!assert (interp2 (z, [2 3 1], [2 2 2].', "pchip"), %! repmat ([5, 7, 3], [3, 1]), tol) -%!assert (interp2 (z, [2 3 1], [2 2 2]', "cubic"), -%! repmat ([5, 7, 3], [3, 1]), 10 * tol) -%!assert (interp2 (z, [2 3 1], [2 2 2]', "spline"), +%!assert (interp2 (z, [2 3 1], [2 2 2].', "cubic"), +%! repmat ([5, 7, 3], [3, 1]), tol) +%!assert (interp2 (z, [2 3 1], [2 2 2].', "spline"), %! repmat ([5, 7, 3], [3, 1]), tol) %!assert (interp2 (z, [2 3 1], [2 2 2], "linear"), [5 7 3], tol) %!assert (interp2 (z, [2 3 1], [2 2 2], "pchip"), [5 7 3], tol) -%!assert (interp2 (z, [2 3 1], [2 2 2], "cubic"), [5 7 3], 10 * tol) +%!assert (interp2 (z, [2 3 1], [2 2 2], "cubic"), [5 7 3], tol) %!assert (interp2 (z, [2 3 1], [2 2 2], "spline"), [5 7 3], tol) +%!assert (interp2 (z, [3; 3; 3], [2; 3; 1], "linear"), [7; 9; 5], tol) +%!assert (interp2 (z, [3; 3; 3], [2; 3; 1], "pchip"), [7; 9; 5], tol) +%!assert (interp2 (z, [3; 3; 3], [2; 3; 1], "cubic"), [7; 9; 5], tol) +%!test <62132> +%! # FIXME: single column yields single row with spline interpolation (numbers are correct) +%! assert (interp2 (z, [3; 3; 3], [2; 3; 1], "spline"), [7; 9; 5], tol) ## Test input validation %!error interp2 (1, 1, 1, 1, 1, 2) # only 5 numeric inputs @@ -594,10 +772,10 @@ %!error interp2 (ones (2), -1) %!error interp2 (ones (2), 1.5) %!warning interp2 (rand (3,3), 1, "*linear"); -%!error interp2 (1, 1, 1, 1, 1, 'linear', {1}) -%!error interp2 (1, 1, 1, 1, 1, 'linear', ones (2,2)) -%!error interp2 (1, 1, 1, 1, 1, 'linear', "abc") -%!error interp2 (1, 1, 1, 1, 1, 'linear', "extrap") +%!error interp2 (1, 1, 1, 1, 1, "linear", {1}) +%!error interp2 (1, 1, 1, 1, 1, "linear", ones (2,2)) +%!error interp2 (1, 1, 1, 1, 1, "linear", "abc") +%!error interp2 (1, 1, 1, 1, 1, "linear", "extrap") %!error interp2 ({1}, 1, ones (2), 1, 1) %!error interp2 (1, {1}, ones (2), 1, 1) %!error interp2 (1, 1, ones (2), {1}, 1) @@ -608,6 +786,7 @@ %!error interp2 (1:2, 1:2, ones (3,2), 1, 1) %!error interp2 ([1 0 2], 1:3, ones (3,3), 1, 1) %!error interp2 (1:3, [1 0 2], ones (3,3), 1, 1) +%!warning interp2 (eye(2), 1.5, 1.5, "cubic"); %!error interp2 (1:2, 1:2, ones (2), ones (2,2), 1) %!error interp2 (1:2, 1:2, ones (2), 1, ones (2,2)) %!error interp2 (1:2, 1:2, ones (2), [1 2 4], [1 2 3], "spline") diff -r 103efb7e1600 -r 4392386b5ecb scripts/general/interpn.m --- a/scripts/general/interpn.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/general/interpn.m Thu Mar 03 13:37:10 2022 -0500 @@ -185,11 +185,6 @@ if (strcmp (method, "linear")) vi = __lin_interpn__ (x{:}, v, y{:}); - if (iscomplex (v)) - ## __lin_interpn__ ignores imaginary part. Do it again for imag part. - ## FIXME: Adapt __lin_interpn__ to correctly handle complex input. - vi += 1i * __lin_interpn__ (x{:}, imag (v), y{:}); - endif vi(isna (vi)) = extrapval; elseif (strcmp (method, "nearest")) ## FIXME: This seems overly complicated. Is there a way to simplify diff -r 103efb7e1600 -r 4392386b5ecb scripts/general/isequal.m --- a/scripts/general/isequal.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/general/isequal.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,7 +24,7 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} isequal (@var{x1}, @var{x2}, @dots{}) +## @deftypefn {} {@var{tf} =} isequal (@var{x1}, @var{x2}, @dots{}) ## Return true if all of @var{x1}, @var{x2}, @dots{} are equal. ## @seealso{isequaln} ## @end deftypefn @@ -46,7 +46,7 @@ ## e. cell compare each member with isequal (recursive) ## f. fcn_handle compare using overloaded "eq" operator -function t = isequal (x, varargin) +function tf = isequal (x, varargin) if (nargin < 2) print_usage (); @@ -65,22 +65,22 @@ ## All arguments must either be of the same class, ## or they must be "numeric" values. if (two_args) - t = (strcmp (class (x), class (y)) - || ((isreal (x) || iscomplex (x)) && (isreal (y) || iscomplex (y)))); + tf = (strcmp (class (x), class (y)) + || ((isreal (x) || iscomplex (x)) && (isreal (y) || iscomplex (y)))); else - t = (all (cellfun ("isclass", varargin, class (x))) - || ((isreal (x) || iscomplex (x)) - && all (cellfun ("isreal", varargin) - | cellfun ("isnumeric", varargin)))); + tf = (all (cellfun ("isclass", varargin, class (x))) + || ((isreal (x) || iscomplex (x)) + && all (cellfun ("isreal", varargin) + | cellfun ("isnumeric", varargin)))); endif ## Test that everything is the same size (which also tests dimensions) - if (t) - t = size_equal (x, varargin{:}); + if (tf) + tf = size_equal (x, varargin{:}); endif ## From here on, compare any objects as if they were structures. - if (t && isobject (x)) + if (tf && isobject (x)) ## Locally suppress class-to-struct warning. We know what we are doing. warning ("off", "Octave:classdef-to-struct", "local"); x = builtin ("struct", x); @@ -98,44 +98,44 @@ ############################################################ ## Check individual classes. - if (t) + if (tf) if (two_args) if (ischar (x) && ischar (y)) ## char type. Optimization, strcmp is ~35% faster than '==' operator. - t = strcmp (x, y); + tf = strcmp (x, y); elseif (isreal (x) || iscomplex (x)) if (issparse (x)) ## sparse types. [xi, xj, xv] = find (x); [yi, yj, yv] = find (y); - t = (length (xi) == length (yi)) && all (xi == yi) ... + tf = (length (xi) == length (yi)) && all (xi == yi) ... && all (xj == yj) && all (xv == yv); else ## general "numeric" type. Use '==' operator. m = (x == y); - t = all (m(:)); + tf = all (m(:)); endif elseif (isstruct (x)) ## struct type. Compare # of fields, fieldnames, then field values. ## Test number of fields are equal. - t = (numfields (x) == numfields (y)); + tf = (numfields (x) == numfields (y)); ## Test that all the field names are equal. - if (t) + if (tf) s_fnm_x = sort (fieldnames (x)); - t = all (strcmp (s_fnm_x, sort (fieldnames (y)))); + tf = all (strcmp (s_fnm_x, sort (fieldnames (y)))); endif ## Test that all field values are equal. Slow because of recursion. - if (t) + if (tf) if (isscalar (x)) for fldnm = s_fnm_x.' - t = isequal (x.(fldnm{1}), y.(fldnm{1})); - if (! t) + tf = isequal (x.(fldnm{1}), y.(fldnm{1})); + if (! tf) break; endif endfor @@ -143,8 +143,8 @@ ## struct arrays have to have the contents of each field wrapped ## in a cell since it expands to a collection of values. for fldnm = s_fnm_x.' - t = isequal ({x.(fldnm{1})}, {y.(fldnm{1})}); - if (! t) + tf = isequal ({x.(fldnm{1})}, {y.(fldnm{1})}); + if (! tf) break; endif endfor @@ -156,20 +156,20 @@ ## FIXME: It would be faster to use strcmp on whole cellstr arrays, ## but bug #51412 needs to be fixed. Instead, time/space trade-off. ## Convert to char (space) for faster processing with strcmp (time). - t = strcmp (char (x), char (y)); + tf = strcmp (char (x), char (y)); elseif (iscell (x)) ## cell type. Check that each element of a cell is equal. Slow. n = numel (x); idx = 1; - while (t && idx <= n) - t = isequal (x{idx}, y{idx}); + while (tf && idx <= n) + tf = isequal (x{idx}, y{idx}); idx += 1; endwhile elseif (is_function_handle (x)) ## function type. Use '==' operator which is overloaded. - t = (x == y); + tf = (x == y); else error ("isequal: Impossible to reach code. File a bug report."); @@ -181,8 +181,8 @@ if (ischar (x) && all (cellfun ("isclass", varargin, "char"))) ## char type. Optimization, strcmp is ~35% faster than '==' operator. idx = 1; - while (t && idx <= nvarargin) - t = strcmp (x, varargin{idx}); + while (tf && idx <= nvarargin) + tf = strcmp (x, varargin{idx}); idx += 1; endwhile @@ -193,11 +193,11 @@ idx = 1; [xi, xj, xv] = find (x); - while (t && idx <= nvarargin) + while (tf && idx <= nvarargin) y = varargin{idx}; [yi, yj, yv] = find (y); - t = (length (xi) == length (yi)) && all (xi == yi) ... - && all (xj == yj) && all (xv == yv); + tf = (length (xi) == length (yi)) && all (xi == yi) ... + && all (xj == yj) && all (xv == yv); idx += 1; endwhile @@ -206,10 +206,10 @@ ## general "numeric" type. Use '==' operator. idx = 1; - while (t && idx <= nvarargin) + while (tf && idx <= nvarargin) y = varargin{idx}; m = (x == y); - t = all (m(:)); + tf = all (m(:)); idx += 1; endwhile @@ -223,21 +223,21 @@ fnm_x = fieldnames (x); n = numel (fnm_x); fnm_v = cellfun ("fieldnames", varargin, "uniformoutput", false); - t = all (n == cellfun ("numel", fnm_v)); + tf = all (n == cellfun ("numel", fnm_v)); ## Test that all the field names are equal. - if (t) + if (tf) fnm_x = sort (fnm_x); idx = 1; - while (t && idx <= nvarargin) + while (tf && idx <= nvarargin) ## Allow the fieldnames to be in a different order. - t = all (strcmp (fnm_x, sort (fnm_v{idx}))); + tf = all (strcmp (fnm_x, sort (fnm_v{idx}))); idx += 1; endwhile endif ## Test that all field values are equal. Slow because of recursion. - if (t) + if (tf) args = cell (1, 1 + nvarargin); if (isscalar (x)) for fldnm = fnm_x.' @@ -246,9 +246,9 @@ args{argn+1} = varargin{argn}.(fldnm{1}); endfor - t = isequal (args{:}); + tf = isequal (args{:}); - if (! t) + if (! tf) break; endif endfor @@ -261,9 +261,9 @@ args{argn+1} = { varargin{argn}.(fldnm{1}) }; endfor - t = isequal (args{:}); + tf = isequal (args{:}); - if (! t) + if (! tf) break; endif endfor @@ -277,8 +277,8 @@ ## Convert to char (space) for faster processing with strcmp (time). idx = 1; x = char (x); - while (t && idx <= nvarargin) - t = strcmp (x, char (varargin{idx})); + while (tf && idx <= nvarargin) + tf = strcmp (x, char (varargin{idx})); idx += 1; endwhile @@ -287,18 +287,18 @@ n = numel (x); args = cell (1, 1 + nvarargin); idx = 1; - while (t && idx <= n) + while (tf && idx <= n) args(1) = x{idx}; args(2:end) = [cellindexmat(varargin, idx){:}]; - t = isequal (args{:}); + tf = isequal (args{:}); idx += 1; endwhile elseif (is_function_handle (x)) ## function type. Use '==' operator which is overloaded. - t = all (cellfun ("eq", {x}, varargin)); + tf = all (cellfun ("eq", {x}, varargin)); else error ("isequal: Impossible to reach code. File a bug report."); @@ -308,7 +308,7 @@ endif endif - t = full (t); # Always return full logical value for Matlab compatibility. + tf = full (tf); # Always return full logical value for Matlab compatibility. endfunction diff -r 103efb7e1600 -r 4392386b5ecb scripts/general/isequaln.m --- a/scripts/general/isequaln.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/general/isequaln.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,7 +24,7 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} isequaln (@var{x1}, @var{x2}, @dots{}) +## @deftypefn {} {@var{tf} =} isequaln (@var{x1}, @var{x2}, @dots{}) ## Return true if all of @var{x1}, @var{x2}, @dots{} are equal under the ## additional assumption that NaN == NaN (no comparison of NaN placeholders ## in dataset). @@ -48,7 +48,7 @@ ## e. cell compare each member with isequaln (recursive) ## f. fcn_handle compare using overloaded "eq" operator -function t = isequaln (x, varargin) +function tf = isequaln (x, varargin) if (nargin < 2) print_usage (); @@ -67,22 +67,22 @@ ## All arguments must either be of the same class, ## or they must be "numeric" values. if (two_args) - t = (strcmp (class (x), class (y)) - || ((isreal (x) || iscomplex (x)) && (isreal (y) || iscomplex (y)))); + tf = (strcmp (class (x), class (y)) + || ((isreal (x) || iscomplex (x)) && (isreal (y) || iscomplex (y)))); else - t = (all (cellfun ("isclass", varargin, class (x))) - || ((isreal (x) || iscomplex (x)) - && all (cellfun ("isreal", varargin) - | cellfun ("isnumeric", varargin)))); + tf = (all (cellfun ("isclass", varargin, class (x))) + || ((isreal (x) || iscomplex (x)) + && all (cellfun ("isreal", varargin) + | cellfun ("isnumeric", varargin)))); endif ## Test that everything is the same size (which also tests dimensions) - if (t) - t = size_equal (x, varargin{:}); + if (tf) + tf = size_equal (x, varargin{:}); endif ## From here on, compare any objects as if they were structures. - if (t && isobject (x)) + if (tf && isobject (x)) ## Locally suppress class-to-struct warning. We know what we are doing. warning ("off", "Octave:classdef-to-struct", "local"); x = builtin ("struct", x); @@ -100,40 +100,40 @@ ############################################################ ## Check individual classes. - if (t) + if (tf) if (two_args) if (ischar (x) && ischar (y)) ## char type. Optimization, strcmp is ~35% faster than '==' operator. - t = strcmp (x, y); + tf = strcmp (x, y); elseif (isreal (x) || iscomplex (x)) ## general "numeric" type. Use '==' operator. m = (x == y); - t = all (m(:)); + tf = all (m(:)); - if (! t && isfloat (x) && isfloat (y)) - t = isnan (x(! m)) && isnan (y(! m)); + if (! tf && isfloat (x) && isfloat (y)) + tf = isnan (x(! m)) && isnan (y(! m)); endif elseif (isstruct (x)) ## struct type. Compare # of fields, fieldnames, then field values. ## Test number of fields are equal. - t = (numfields (x) == numfields (y)); + tf = (numfields (x) == numfields (y)); ## Test that all the field names are equal. - if (t) + if (tf) s_fnm_x = sort (fieldnames (x)); - t = all (strcmp (s_fnm_x, sort (fieldnames (y)))); + tf = all (strcmp (s_fnm_x, sort (fieldnames (y)))); endif ## Test that all field values are equal. Slow because of recursion. - if (t) + if (tf) if (isscalar (x)) for fldnm = s_fnm_x.' - t = isequaln (x.(fldnm{1}), y.(fldnm{1})); - if (! t) + tf = isequaln (x.(fldnm{1}), y.(fldnm{1})); + if (! tf) break; endif endfor @@ -141,8 +141,8 @@ ## struct arrays have to have the contents of each field wrapped ## in a cell since it expands to a collection of values. for fldnm = s_fnm_x.' - t = isequaln ({x.(fldnm{1})}, {y.(fldnm{1})}); - if (! t) + tf = isequaln ({x.(fldnm{1})}, {y.(fldnm{1})}); + if (! tf) break; endif endfor @@ -154,20 +154,20 @@ ## FIXME: It would be faster to use strcmp on whole cellstr arrays, ## but bug #51412 needs to be fixed. Instead, time/space trade-off. ## Convert to char (space) for faster processing with strcmp (time). - t = strcmp (char (x), char (y)); + tf = strcmp (char (x), char (y)); elseif (iscell (x)) ## cell type. Check that each element of a cell is equal. Slow. n = numel (x); idx = 1; - while (t && idx <= n) - t = isequaln (x{idx}, y{idx}); + while (tf && idx <= n) + tf = isequaln (x{idx}, y{idx}); idx += 1; endwhile elseif (is_function_handle (x)) ## function type. Use '==' operator which is overloaded. - t = (x == y); + tf = (x == y); else error ("isequaln: Impossible to reach code. File a bug report."); @@ -179,8 +179,8 @@ if (ischar (x) && all (cellfun ("isclass", varargin, "char"))) ## char type. Optimization, strcmp is ~35% faster than '==' operator. idx = 1; - while (t && idx <= nvarargin) - t = strcmp (x, varargin{idx}); + while (tf && idx <= nvarargin) + tf = strcmp (x, varargin{idx}); idx += 1; endwhile @@ -188,13 +188,13 @@ ## general "numeric" type. Use '==' operator. idx = 1; - while (t && idx <= nvarargin) + while (tf && idx <= nvarargin) y = varargin{idx}; m = (x == y); - t = all (m(:)); + tf = all (m(:)); - if (! t && isfloat (x) && isfloat (y)) - t = isnan (x(! m)) && isnan (y(! m)); + if (! tf && isfloat (x) && isfloat (y)) + tf = isnan (x(! m)) && isnan (y(! m)); endif idx += 1; @@ -207,21 +207,21 @@ fnm_x = fieldnames (x); n = numel (fnm_x); fnm_v = cellfun ("fieldnames", varargin, "uniformoutput", false); - t = all (n == cellfun ("numel", fnm_v)); + tf = all (n == cellfun ("numel", fnm_v)); ## Test that all the field names are equal. - if (t) + if (tf) fnm_x = sort (fnm_x); idx = 1; - while (t && idx <= nvarargin) + while (tf && idx <= nvarargin) ## Allow the fieldnames to be in a different order. - t = all (strcmp (fnm_x, sort (fnm_v{idx}))); + tf = all (strcmp (fnm_x, sort (fnm_v{idx}))); idx += 1; endwhile endif ## Test that all field values are equal. Slow because of recursion. - if (t) + if (tf) args = cell (1, 1 + nvarargin); if (isscalar (x)) for fldnm = fnm_x.' @@ -230,9 +230,9 @@ args{argn+1} = varargin{argn}.(fldnm{1}); endfor - t = isequaln (args{:}); + tf = isequaln (args{:}); - if (! t) + if (! tf) break; endif endfor @@ -245,9 +245,9 @@ args{argn+1} = { varargin{argn}.(fldnm{1}) }; endfor - t = isequaln (args{:}); + tf = isequaln (args{:}); - if (! t) + if (! tf) break; endif endfor @@ -261,8 +261,8 @@ ## Convert to char (space) for faster processing with strcmp (time). idx = 1; x = char (x); - while (t && idx <= nvarargin) - t = strcmp (x, char (varargin{idx})); + while (tf && idx <= nvarargin) + tf = strcmp (x, char (varargin{idx})); idx += 1; endwhile @@ -271,18 +271,18 @@ n = numel (x); args = cell (1, 1 + nvarargin); idx = 1; - while (t && idx <= n) + while (tf && idx <= n) args(1) = x{idx}; args(2:end) = [cellindexmat(varargin, idx){:}]; - t = isequaln (args{:}); + tf = isequaln (args{:}); idx += 1; endwhile elseif (is_function_handle (x)) ## function type. Use '==' operator which is overloaded. - t = all (cellfun ("eq", {x}, varargin)); + tf = all (cellfun ("eq", {x}, varargin)); else error ("isequaln: Impossible to reach code. File a bug report."); @@ -292,7 +292,7 @@ endif endif - t = full (t); # Always return full logical value for Matlab compatibility. + tf = full (tf); # Always return full logical value for Matlab compatibility. endfunction diff -r 103efb7e1600 -r 4392386b5ecb scripts/general/module.mk --- a/scripts/general/module.mk Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/general/module.mk Thu Mar 03 13:37:10 2022 -0500 @@ -64,7 +64,6 @@ %reldir%/rng.m \ %reldir%/rot90.m \ %reldir%/rotdim.m \ - %reldir%/shift.m \ %reldir%/shiftdim.m \ %reldir%/sortrows.m \ %reldir%/sph2cart.m \ diff -r 103efb7e1600 -r 4392386b5ecb scripts/general/polyarea.m --- a/scripts/general/polyarea.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/general/polyarea.m Thu Mar 03 13:37:10 2022 -0500 @@ -55,9 +55,9 @@ endif if (nargin == 2) - a = abs (sum (x .* (shift (y, -1) - shift (y, 1)))) / 2; + a = abs (sum (x .* (circshift (y, -1) - circshift (y, 1)))) / 2; else - a = abs (sum (x .* (shift (y, -1, dim) - shift (y, 1, dim)), dim)) / 2; + a = abs (sum (x .* (circshift (y, -1, dim) - circshift (y, 1, dim)), dim)) / 2; endif endfunction diff -r 103efb7e1600 -r 4392386b5ecb scripts/general/shift.m --- a/scripts/general/shift.m Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,101 +0,0 @@ -######################################################################## -## -## Copyright (C) 1995-2022 The Octave Project Developers -## -## See the file COPYRIGHT.md in the top-level directory of this -## distribution or . -## -## 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 {} {} shift (@var{x}, @var{b}) -## @deftypefnx {} {} shift (@var{x}, @var{b}, @var{dim}) -## If @var{x} is a vector, perform a circular shift of length @var{b} of -## the elements of @var{x}. -## -## If @var{x} is a matrix, do the same for each column of @var{x}. -## -## If the optional @var{dim} argument is given, operate along this dimension. -## @end deftypefn - -function y = shift (x, b, dim) - - if (nargin < 2) - print_usage (); - endif - - if (numel (x) < 1) - error ("shift: X must not be empty"); - elseif (! (isscalar (b) && b == fix (b))) - error ("shift: B must be an integer"); - endif - - nd = ndims (x); - sz = size (x); - - if (nargin == 3) - if (!(isscalar (dim) && dim == fix (dim)) - || !(1 <= dim && dim <= nd)) - error ("shift: DIM must be an integer and a valid dimension"); - endif - else - ## Find the first non-singleton dimension. - (dim = find (sz > 1, 1)) || (dim = 1); - endif - - d = sz(dim); - - idx = repmat ({':'}, nd, 1); - if (b > 0) - b = rem (b, d); - idx{dim} = [d-b+1:d, 1:d-b]; - elseif (b < 0) - b = rem (abs (b), d); - idx{dim} = [b+1:d, 1:b]; - endif - - y = x(idx{:}); - -endfunction - - -%!test -%! a = [1, 2, 3]; -%! b = [4, 5, 6]; -%! c = [7, 8, 9]; -%! -%! r = [a, b, c]; -%! m = [a; b; c]; -%! -%! assert (shift (r, 0), r); -%! assert (shift (r, 3), [c, a, b]); -%! assert (shift (r, -6), [c, a, b]); -%! assert (shift (r, -3), [b, c, a]); -%! assert (shift (m, 1), [c; a; b]); -%! assert (shift (m, -2), [c; a; b]); - -## Test input validation -%!error shift () -%!error shift (1) -%!error shift ([], 1) -%!error shift (ones (2), ones (2)) -%!error shift (ones (2), 1.5) -%!error shift (1, 1, 1.5) -%!error shift (1, 1, 0) -%!error shift (1, 1, 3) diff -r 103efb7e1600 -r 4392386b5ecb scripts/help/__makeinfo__.m --- a/scripts/help/__makeinfo__.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/help/__makeinfo__.m Thu Mar 03 13:37:10 2022 -0500 @@ -101,7 +101,12 @@ endif ## Texinfo crashes if @end tex does not appear first on the line. text = regexprep (text, '^ +@end tex', '@end tex', 'lineanchors'); - text = regexprep (text, '@seealso', '@xseealso'); + ## Replace @seealso with Octave specific @xseealso macro, and escape '@' + [s, e] = regexp (text, '@seealso{.*}'); + if (! isempty (s)) + esc_text = strrep (text(s+8:e), '@', '@@'); + text = [text(1:s), 'xseealso', esc_text, text(e+1:end)]; + endif ## We don't want *ref macros to clutter plain text output with "Note ..." if (strcmp (output_type, "plain text")) diff -r 103efb7e1600 -r 4392386b5ecb scripts/help/warning_ids.m --- a/scripts/help/warning_ids.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/help/warning_ids.m Thu Mar 03 13:37:10 2022 -0500 @@ -178,6 +178,13 @@ ## different file target than the programmer intended is being used. ## By default, the @code{Octave:data-file-in-path} warning is enabled. ## +## @item Octave:datevec:date-format-spec +## If the @code{Octave:datevec:date-format-spec} warning is enabled, a warning +## is printed if the date format specification contains questionable date or +## time specifiers. Typical bad patterns are using upper case date specifiers +## or lower case time specifiers. +## By default, the @code{Octave:datevec:date-format-spec} warning is enabled. +## ## @item Octave:deprecated-function ## If the @code{Octave:deprecated-function} warning is enabled, a ## warning is issued when Octave encounters a function that is obsolete and @@ -354,6 +361,11 @@ ## By default, the @code{Octave:possible-matlab-short-circuit-operator} warning ## is enabled. ## +## @item Octave:pow2:imaginary-ignored +## If the @code{Octave:pow2:imaginary-ignored} warning is enabled, a warning is +## printed if either input to @code{pow2} is complex. +## By default, the @code{Octave:pow2:imaginary-ignored} warning is enabled. +## ## @item Octave:recursive-path-search ## If the @code{Octave:recursive-path-search} warning is enabled, Octave ## will issue a warning if @code{addpath} is used with double trailing diff -r 103efb7e1600 -r 4392386b5ecb scripts/image/iscolormap.m --- a/scripts/image/iscolormap.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/image/iscolormap.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,7 +24,7 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} iscolormap (@var{cmap}) +## @deftypefn {} {@var{tf} =} iscolormap (@var{cmap}) ## Return true if @var{cmap} is a colormap. ## ## A colormap is a real matrix, of class single or double, with 3 columns. @@ -38,15 +38,14 @@ ## @seealso{colormap, rgbplot} ## @end deftypefn -function retval = iscolormap (cmap) +function tf = iscolormap (cmap) if (nargin < 1) print_usage (); endif - retval = (isnumeric (cmap) && isreal (cmap) - && ndims (cmap) == 2 && columns (cmap) == 3 - && isfloat (cmap)); + tf = isnumeric (cmap) && isreal (cmap) && isfloat (cmap) ... + && ndims (cmap) == 2 && columns (cmap) == 3; endfunction diff -r 103efb7e1600 -r 4392386b5ecb scripts/image/private/__imread__.m --- a/scripts/image/private/__imread__.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/image/private/__imread__.m Thu Mar 03 13:37:10 2022 -0500 @@ -61,7 +61,7 @@ if (sum (idx) > 1) error ("imread: Index or Frames may only be specified once"); endif - val = varargin{shift (idx, 1)}; + val = varargin{circshift (idx, 1)}; if (! is_valid_index_option (val) && ! strcmpi (val, "all")) error ("imread: %s must be a vector or the string 'all'", varargin{idx}); endif diff -r 103efb7e1600 -r 4392386b5ecb scripts/image/spinmap.m --- a/scripts/image/spinmap.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/image/spinmap.m Thu Mar 03 13:37:10 2022 -0500 @@ -56,7 +56,7 @@ t0 = clock (); while (etime (clock (), t0) < t) - cmap = shift (cmap, inc, 1); + cmap = circshift (cmap, inc, 1); set (gcf (), "colormap", cmap); drawnow (); endwhile diff -r 103efb7e1600 -r 4392386b5ecb scripts/io/is_valid_file_id.m --- a/scripts/io/is_valid_file_id.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/io/is_valid_file_id.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,23 +24,23 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} is_valid_file_id (@var{fid}) +## @deftypefn {} {@var{tf} =} is_valid_file_id (@var{fid}) ## Return true if @var{fid} refers to an open file. ## @seealso{freport, fopen} ## @end deftypefn -function retval = is_valid_file_id (fid) +function tf = is_valid_file_id (fid) if (nargin < 1) print_usage (); endif - retval = false; + tf = false; try if (isscalar (fid)) [file, mode, arch] = fopen (fid); - retval = ! isempty (file); + tf = ! isempty (file); endif end_try_catch diff -r 103efb7e1600 -r 4392386b5ecb scripts/legacy/isdir.m --- a/scripts/legacy/isdir.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/legacy/isdir.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,7 +24,7 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} isdir (@var{f}) +## @deftypefn {} {@var{tf} =} isdir (@var{f}) ## ## This function is not recommended. Use @code{isfolder} or ## @code{file_in_loadpath} instead. @@ -43,7 +43,7 @@ ## is_rooted_relative_filename} ## @end deftypefn -function retval = isdir (f) +function tf = isdir (f) persistent warned = false; if (! warned) @@ -57,7 +57,7 @@ endif ## Exist returns an integer but isdir should return a logical. - retval = (exist (f, "dir") == 7); + tf = (exist (f, "dir") == 7); endfunction diff -r 103efb7e1600 -r 4392386b5ecb scripts/legacy/isstr.m --- a/scripts/legacy/isstr.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/legacy/isstr.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,7 +24,7 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} isstr (@var{x}) +## @deftypefn {} {@var{tf} =} isstr (@var{x}) ## This function is obsolete. Use @code{ischar} instead. ## @seealso{ischar} ## @end deftypefn @@ -33,7 +33,7 @@ ## removed in some future version. Now users are told that it should be ## avoided, but there is no mention of possible future removal. -function retval = isstr (varargin) +function tf = isstr (varargin) persistent warned = false; if (! warned) @@ -42,6 +42,6 @@ "isstr is obsolete; please use ischar instead"); endif - retval = ischar (varargin{:}); + tf = ischar (varargin{:}); endfunction diff -r 103efb7e1600 -r 4392386b5ecb scripts/linear-algebra/isbanded.m --- a/scripts/linear-algebra/isbanded.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/linear-algebra/isbanded.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,7 +24,7 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} isbanded (@var{A}, @var{lower}, @var{upper}) +## @deftypefn {} {@var{tf} =} isbanded (@var{A}, @var{lower}, @var{upper}) ## Return true if @var{A} is a matrix with entries confined between ## @var{lower} diagonals below the main diagonal and @var{upper} diagonals ## above the main diagonal. @@ -33,7 +33,7 @@ ## @seealso{isdiag, istril, istriu, bandwidth} ## @end deftypefn -function retval = isbanded (A, lower, upper) +function tf = isbanded (A, lower, upper) if (nargin != 3) print_usage (); @@ -44,16 +44,16 @@ endif if (isempty (A)) - retval = []; + tf = []; else - retval = (isnumeric (A) || islogical (A)) && ndims (A) == 2; - if (retval) + tf = (isnumeric (A) || islogical (A)) && ndims (A) == 2; + if (tf) [i, j] = find (A); pupp = j >= i; - retval = all (j(pupp) - i(pupp) <= upper); - if (retval) + tf = all (j(pupp) - i(pupp) <= upper); + if (tf) plow = i >= j; - retval = all (i(plow) - j(plow) <= lower); + tf = all (i(plow) - j(plow) <= lower); endif endif endif diff -r 103efb7e1600 -r 4392386b5ecb scripts/linear-algebra/isdefinite.m --- a/scripts/linear-algebra/isdefinite.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/linear-algebra/isdefinite.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,8 +24,8 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} isdefinite (@var{A}) -## @deftypefnx {} {} isdefinite (@var{A}, @var{tol}) +## @deftypefn {} {@var{tf} =} isdefinite (@var{A}) +## @deftypefnx {} {@var{tf} =} isdefinite (@var{A}, @var{tol}) ## Return true if @var{A} is symmetric positive definite matrix within the ## tolerance specified by @var{tol}. ## @@ -47,14 +47,14 @@ ## @seealso{issymmetric, ishermitian} ## @end deftypefn -function retval = isdefinite (A, tol) +function tf = isdefinite (A, tol) if (nargin < 1) print_usage (); endif ## Validate inputs - retval = false; + tf = false; if (! isnumeric (A)) return; endif @@ -76,7 +76,7 @@ e = tol * eye (rows (A)); [~, p] = chol (A - e); if (p == 0) - retval = true; + tf = true; endif endfunction diff -r 103efb7e1600 -r 4392386b5ecb scripts/linear-algebra/isdiag.m --- a/scripts/linear-algebra/isdiag.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/linear-algebra/isdiag.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,24 +24,24 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} isdiag (@var{A}) +## @deftypefn {} {@var{tf} =} isdiag (@var{A}) ## Return true if @var{A} is a diagonal matrix. ## @seealso{isbanded, istril, istriu, diag, bandwidth} ## @end deftypefn -function retval = isdiag (A) +function tf = isdiag (A) if (nargin < 1) print_usage (); endif if (strfind (typeinfo (A), "diagonal matrix")) - retval = true; + tf = true; elseif ((isnumeric (A) || islogical (A)) && ndims (A) == 2) [i, j] = find (A); - retval = all (i == j); + tf = all (i == j); else - retval = false; + tf = false; endif endfunction diff -r 103efb7e1600 -r 4392386b5ecb scripts/linear-algebra/ishermitian.m --- a/scripts/linear-algebra/ishermitian.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/linear-algebra/ishermitian.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,10 +24,10 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} ishermitian (@var{A}) -## @deftypefnx {} {} ishermitian (@var{A}, @var{tol}) -## @deftypefnx {} {} ishermitian (@var{A}, @qcode{"skew"}) -## @deftypefnx {} {} ishermitian (@var{A}, @qcode{"skew"}, @var{tol}) +## @deftypefn {} {@var{tf} =} ishermitian (@var{A}) +## @deftypefnx {} {@var{tf} =} ishermitian (@var{A}, @var{tol}) +## @deftypefnx {} {@var{tf} =} ishermitian (@var{A}, @qcode{"skew"}) +## @deftypefnx {} {@var{tf} =} ishermitian (@var{A}, @qcode{"skew"}, @var{tol}) ## Return true if @var{A} is a Hermitian or skew-Hermitian matrix within the ## tolerance specified by @var{tol}. ## @@ -50,7 +50,7 @@ ## @seealso{issymmetric, isdefinite} ## @end deftypefn -function retval = ishermitian (A, skewopt = "nonskew", tol = 0) +function tf = ishermitian (A, skewopt = "nonskew", tol = 0) if (nargin < 1) print_usage (); @@ -67,8 +67,8 @@ endif ## Validate inputs - retval = (isnumeric (A) || islogical (A)) && issquare (A); - if (! retval) + tf = (isnumeric (A) || islogical (A)) && issquare (A); + if (! tf) return; endif @@ -84,26 +84,26 @@ if (strcmp (skewopt, "nonskew")) if (tol == 0) ## check for exact symmetry - retval = full (! any ((A != A')(:))); + tf = full (! any ((A != A')(:))); else if (islogical (A)) ## Hack to allow norm to work. Choose single to minimize memory. A = single (A); endif norm_x = norm (A, Inf); - retval = norm_x == 0 || norm (A - A', Inf) / norm_x <= tol; + tf = norm_x == 0 || norm (A - A', Inf) / norm_x <= tol; endif else ## skew-Hermitian if (tol == 0) - retval = full (! any ((A != -A')(:))); + tf = full (! any ((A != -A')(:))); else if (islogical (A)) ## Hack to allow norm to work. Choose single to minimize memory. A = single (A); endif norm_x = norm (A, Inf); - retval = norm_x == 0 || norm (A + A', Inf) / norm_x <= tol; + tf = norm_x == 0 || norm (A + A', Inf) / norm_x <= tol; endif endif diff -r 103efb7e1600 -r 4392386b5ecb scripts/linear-algebra/issymmetric.m --- a/scripts/linear-algebra/issymmetric.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/linear-algebra/issymmetric.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,10 +24,10 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} issymmetric (@var{A}) -## @deftypefnx {} {} issymmetric (@var{A}, @var{tol}) -## @deftypefnx {} {} issymmetric (@var{A}, @qcode{"skew"}) -## @deftypefnx {} {} issymmetric (@var{A}, @qcode{"skew"}, @var{tol}) +## @deftypefn {} {@var{tf} =} issymmetric (@var{A}) +## @deftypefnx {} {@var{tf} =} issymmetric (@var{A}, @var{tol}) +## @deftypefnx {} {@var{tf} =} issymmetric (@var{A}, @qcode{"skew"}) +## @deftypefnx {} {@var{tf} =} issymmetric (@var{A}, @qcode{"skew"}, @var{tol}) ## Return true if @var{A} is a symmetric or skew-symmetric matrix within the ## tolerance specified by @var{tol}. ## @@ -49,7 +49,7 @@ ## @seealso{ishermitian, isdefinite} ## @end deftypefn -function retval = issymmetric (A, skewopt = "nonskew", tol = 0) +function tf = issymmetric (A, skewopt = "nonskew", tol = 0) if (nargin < 1) print_usage (); @@ -79,7 +79,7 @@ endif if (! issquare (A)) - retval = false; + tf = false; return; endif @@ -87,26 +87,26 @@ if (strcmp (skewopt, "nonskew")) if (tol == 0) ## check for exact symmetry - retval = full (! any ((A != A.')(:))); + tf = full (! any ((A != A.')(:))); else if (! isnumeric (A)) ## Hack to allow norm to work. Choose single to minimize memory. A = single (A); endif norm_x = norm (A, Inf); - retval = norm_x == 0 || norm (A - A.', Inf) / norm_x <= tol; + tf = norm_x == 0 || norm (A - A.', Inf) / norm_x <= tol; endif else ## skew symmetry if (tol == 0) - retval = full (! any ((A != -A.')(:))); + tf = full (! any ((A != -A.')(:))); else if (! isnumeric (A)) ## Hack to allow norm to work. Choose single to minimize memory. A = single (A); endif norm_x = norm (A, Inf); - retval = norm_x == 0 || norm (A + A.', Inf) / norm_x <= tol; + tf = norm_x == 0 || norm (A + A.', Inf) / norm_x <= tol; endif endif diff -r 103efb7e1600 -r 4392386b5ecb scripts/linear-algebra/istril.m --- a/scripts/linear-algebra/istril.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/linear-algebra/istril.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,7 +24,7 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} istril (@var{A}) +## @deftypefn {} {@var{tf} =} istril (@var{A}) ## Return true if @var{A} is a lower triangular matrix. ## ## A lower triangular matrix has nonzero entries only on the main diagonal and @@ -32,16 +32,16 @@ ## @seealso{istriu, isbanded, isdiag, tril, bandwidth} ## @end deftypefn -function retval = istril (A) +function tf = istril (A) if (nargin < 1) print_usage (); endif - retval = (isnumeric (A) || islogical (A)) && ndims (A) == 2; - if (retval) + tf = (isnumeric (A) || islogical (A)) && ndims (A) == 2; + if (tf) [i, j] = find (A); - retval = all (i >= j); + tf = all (i >= j); endif endfunction diff -r 103efb7e1600 -r 4392386b5ecb scripts/linear-algebra/istriu.m --- a/scripts/linear-algebra/istriu.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/linear-algebra/istriu.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,7 +24,7 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} istriu (@var{A}) +## @deftypefn {} {@var{tf} =} istriu (@var{A}) ## Return true if @var{A} is an upper triangular matrix. ## ## An upper triangular matrix has nonzero entries only on the main diagonal and @@ -32,16 +32,16 @@ ## @seealso{isdiag, isbanded, istril, triu, bandwidth} ## @end deftypefn -function retval = istriu (A) +function tf = istriu (A) if (nargin < 1) print_usage (); endif - retval = (isnumeric (A) || islogical (A)) && ndims (A) == 2; - if (retval) + tf = (isnumeric (A) || islogical (A)) && ndims (A) == 2; + if (tf) [i, j] = find (A); - retval = all (i <= j); + tf = all (i <= j); endif endfunction diff -r 103efb7e1600 -r 4392386b5ecb scripts/miscellaneous/isdeployed.m --- a/scripts/miscellaneous/isdeployed.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/miscellaneous/isdeployed.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,7 +24,7 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} isdeployed () +## @deftypefn {} {@var{tf} =} isdeployed () ## Return true if the current program has been compiled and is running ## separately from the Octave interpreter and false if it is running in ## the Octave interpreter. @@ -32,8 +32,8 @@ ## Currently, this function always returns false in Octave. ## @end deftypefn -function retval = isdeployed () - retval = false; +function tf = isdeployed () + tf = false; endfunction diff -r 103efb7e1600 -r 4392386b5ecb scripts/miscellaneous/isfolder.m --- a/scripts/miscellaneous/isfolder.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/miscellaneous/isfolder.m Thu Mar 03 13:37:10 2022 -0500 @@ -33,7 +33,7 @@ ## is_rooted_relative_filename} ## @end deftypefn -function retval = isfolder (f) +function tf = isfolder (f) if (nargin < 1) print_usage (); @@ -44,10 +44,10 @@ endif f = cellstr (f); - retval = false (size (f)); + tf = false (size (f)); for i = 1:numel (f) [info, err] = stat (f{i}); - retval(i) = (! err && S_ISDIR (info.mode)); + tf(i) = (! err && S_ISDIR (info.mode)); endfor endfunction diff -r 103efb7e1600 -r 4392386b5ecb scripts/miscellaneous/ismac.m --- a/scripts/miscellaneous/ismac.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/miscellaneous/ismac.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,14 +24,14 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} ismac () +## @deftypefn {} {@var{tf} =} ismac () ## Return true if Octave is running on a Mac OS X system and false otherwise. ## @seealso{isunix, ispc} ## @end deftypefn -function retval = ismac () +function tf = ismac () - retval = __octave_config_info__ ("mac"); + tf = __octave_config_info__ ("mac"); endfunction diff -r 103efb7e1600 -r 4392386b5ecb scripts/miscellaneous/ismethod.m --- a/scripts/miscellaneous/ismethod.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/miscellaneous/ismethod.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,14 +24,14 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} ismethod (@var{obj}, @var{method}) -## @deftypefnx {} {} ismethod (@var{class_name}, @var{method}) +## @deftypefn {} {@var{tf} =} ismethod (@var{obj}, @var{method}) +## @deftypefnx {} {@var{tf} =} ismethod (@var{class_name}, @var{method}) ## Return true if the string @var{method} is a valid method of the object ## @var{obj} or of the class @var{clsname}. ## @seealso{isprop, isobject, isjava, methods} ## @end deftypefn -function retval = ismethod (obj, method) +function tf = ismethod (obj, method) if (nargin != 2) print_usage (); @@ -47,7 +47,7 @@ method_list = methods (obj); - retval = ismember (method, method_list); + tf = ismember (method, method_list); endfunction diff -r 103efb7e1600 -r 4392386b5ecb scripts/miscellaneous/ispc.m --- a/scripts/miscellaneous/ispc.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/miscellaneous/ispc.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,14 +24,14 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} ispc () +## @deftypefn {} {@var{tf} =} ispc () ## Return true if Octave is running on a Windows system and false otherwise. ## @seealso{isunix, ismac} ## @end deftypefn -function retval = ispc () +function tf = ispc () - retval = __octave_config_info__ ("windows"); + tf = __octave_config_info__ ("windows"); endfunction diff -r 103efb7e1600 -r 4392386b5ecb scripts/miscellaneous/isunix.m --- a/scripts/miscellaneous/isunix.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/miscellaneous/isunix.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,14 +24,14 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} isunix () +## @deftypefn {} {@var{tf} =} isunix () ## Return true if Octave is running on a Unix-like system and false otherwise. ## @seealso{ismac, ispc} ## @end deftypefn -function retval = isunix () +function tf = isunix () - retval = __octave_config_info__ ("unix"); + tf = __octave_config_info__ ("unix"); endfunction diff -r 103efb7e1600 -r 4392386b5ecb scripts/optimization/qp.m --- a/scripts/optimization/qp.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/optimization/qp.m Thu Mar 03 13:37:10 2022 -0500 @@ -347,7 +347,12 @@ in_infeasible = (n_in > 0 && any (Ain*x0-bin < -rtol*(1+abs (bin)))); info = 0; - if (eq_infeasible || in_infeasible) + + if (isdefinite (H) != 1) + info = 2; + endif + + if (info == 0 && (eq_infeasible || in_infeasible)) ## The initial guess is not feasible. ## First, define an xbar that is feasible with respect to the ## equality constraints. @@ -454,3 +459,9 @@ %! %! assert (isstruct (INFO) && isfield (INFO, "info") && (INFO.info == 0)); %! assert ([x obj_qp], [1.0 0.5], eps); + +%!test <*61762> +%! [x, obj, info] = qp ([], [21, 30, 39; 30, 45, 60; 39, 60, 81], [-40; -65; -90]); +%! assert (x, zeros (3, 1)); +%! assert (obj, 0); +%! assert (info.info, 2); diff -r 103efb7e1600 -r 4392386b5ecb scripts/pkg/private/configure_make.m --- a/scripts/pkg/private/configure_make.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/pkg/private/configure_make.m Thu Mar 03 13:37:10 2022 -0500 @@ -53,13 +53,13 @@ endif if (ispc () && ! isunix ()) - # replace all backslashes with forward slashes + ## Replace all backslashes with forward slashes mkoctfile_program = strrep (mkoctfile_program, '\', '/'); octave_config_program = strrep (octave_config_program, '\', '/'); octave_binary = strrep (octave_binary, '\', '/'); endif - # escape spaces in file paths unless they are already escaped + ## Escape spaces in file paths unless they are already escaped mkoctfile_program = regexprep (mkoctfile_program, '([^\\]) ', '$1\\ '); octave_config_program = regexprep (octave_config_program, ... '([^\\]) ', '$1\\ '); diff -r 103efb7e1600 -r 4392386b5ecb scripts/plot/appearance/axis.m --- a/scripts/plot/appearance/axis.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/plot/appearance/axis.m Thu Mar 03 13:37:10 2022 -0500 @@ -83,9 +83,16 @@ ## @item @qcode{"manual"} ## Fix the current axes limits. ## +## @item @qcode{"tickaligned"} +## Fix axes to the limits of the closest ticks. +## ## @item @qcode{"tight"} ## Fix axes to the limits of the data. ## +## @item @qcode{"padded"} +## Fix axes to the limits of the data plus margins of about 7% of the +## data extent. +## ## @item @qcode{"image"} ## Equivalent to @qcode{"tight"} and @qcode{"equal"}. ## @@ -213,8 +220,10 @@ ## aspect ratio elseif (strcmpi (opt, "image")) __axis__ (ca, "equal"); - set (ca, "plotboxaspectratiomode", "auto"); - __do_tight_option__ (ca); + set (ca, "plotboxaspectratiomode", "auto", ... + "xlimmode", "auto", "ylimmode", "auto", ... + "zlimmode", "auto", ... + "xlimitmethod", "tight", "ylimitmethod", "tight"); elseif (strcmpi (opt, "square")) set (ca, "dataaspectratiomode", "auto", "plotboxaspectratio", [1, 1, 1]); @@ -280,10 +289,26 @@ ## fixes the axis limits set (ca, "xlimmode", "manual", "ylimmode", "manual", "zlimmode", "manual"); + elseif (strcmpi (opt, "tickaligned")) + ## sets the axis limits to closest ticks. + set (ca, "xlimmode", "auto", "ylimmode", "auto", ... + "zlimmode", "auto", ... + "xlimitmethod", "tickaligned", ... + "ylimitmethod", "tickaligned", ... + "zlimitmethod", "tickaligned"); elseif (strcmpi (opt, "tight")) ## sets the axis limits to the min and max of all data. - __do_tight_option__ (ca); - + set (ca, "xlimmode", "auto", "ylimmode", "auto", ... + "zlimmode", "auto", ... + "xlimitmethod", "tight", "ylimitmethod", "tight", + "zlimitmethod", "tight"); + elseif (strcmpi (opt, "padded")) + ## sets the axis limits to the min and max of all data plus padding. + set (ca, "xlimmode", "auto", "ylimmode", "auto", ... + "zlimmode", "auto", ... + "xlimitmethod", "padded", ... + "ylimitmethod", "padded", ... + "zlimitmethod", "padded"); ## visibility elseif (strcmpi (opt, "on")) set (ca, "visible", "on"); @@ -376,87 +401,6 @@ endfunction -## Find the limits for axis ("tight"). -## AX should be one of "x", "y", or "z". -function lims = __get_tight_lims__ (ca, ax) - - kids = findobj (ca, "-property", [ax "data"]); - ## The data properties for hggroups mirror their children. - ## Exclude the redundant hggroup values. - hg_kids = findobj (kids, "type", "hggroup"); - kids = setdiff (kids, hg_kids); - if (isempty (kids)) - ## Return the current limits. - ## FIXME: Is this the correct thing to do? - lims = get (ca, [ax "lim"]); - else - data = get (kids, [ax "data"]); - types = get (kids, "type"); - - scale = get (ca, [ax "scale"]); - if (! iscell (data)) - data = {data}; - endif - - ## Extend image data one pixel - idx = strcmp (types, "image"); - if (any (idx) && (ax == "x" || ax == "y")) - imdata = data(idx); - px = arrayfun (@__image_pixel_size__, kids(idx), "uniformoutput", false); - ipx = ifelse (ax == "x", 1, 2); - imdata = cellfun (@(x,dx) [(min (x) - dx(ipx)), (max (x) + dx(ipx))], - imdata, px, "uniformoutput", false); - data(idx) = imdata; - endif - - if (strcmp (scale, "log")) - tmp = data; - data = cellfun (@(x) x(x>0), tmp, "uniformoutput", false); - n = cellfun ("isempty", data); - data(n) = cellfun (@(x) x(x<0), tmp(n), "uniformoutput", false); - endif - data = cellfun (@(x) x(isfinite (x)), data, "uniformoutput", false); - data = data(! cellfun ("isempty", data)); - if (! isempty (data)) - ## Change data from cell array of various sizes to a single column vector - data = cat (1, cellindexmat (data, ":"){:}); - lims = [min(data), max(data)]; - else - lims = [0, 1]; - endif - endif - -endfunction - -function __do_tight_option__ (ca) - - xlim = __get_tight_lims__ (ca, "x"); - if (all (xlim == 0)) - xlim = [-eps, +eps]; - elseif (diff (xlim == 0)) - xlim .*= [1-eps, 1+eps]; - endif - ylim = __get_tight_lims__ (ca, "y"); - if (all (ylim == 0)) - ylim = [-eps, +eps]; - elseif (diff (ylim == 0)) - ylim .*= [1-eps, 1+eps]; - endif - set (ca, "xlim", xlim, "ylim", ylim); - nd = __calc_dimensions__ (ca); - is3dview = (get (ca, "view")(2) != 90); - if (nd > 2 && is3dview) - zlim = __get_tight_lims__ (ca, "z"); - if (all (zlim == 0)) - zlim = [-eps, +eps]; - elseif (diff (zlim == 0)) - zlim .*= [1-eps, 1+eps]; - endif - set (ca, "zlim", zlim); - endif - -endfunction - %!demo %! clf; @@ -618,6 +562,38 @@ %! axis tight; %! title ('"tight" on loglog plot'); +%!demo +%! clf; +%! x = y = 0.5:0.5:12; +%! subplot (3,1,1); +%! plot (x, y, "-s"); +%! axis tickaligned +%! title ("tickaligned"); +%! subplot (3,1,2); +%! plot (x, y, "-s"); +%! axis padded +%! title ("padded"); +%! subplot (3,1,3); +%! plot (x, y, "-s"); +%! axis tight +%! title ("tight"); + +%!demo +%! clf; +%! x = y = 0.5:0.5:12; +%! subplot (3,1,1); +%! loglog (x, y, "-s"); +%! axis tickaligned +%! title ("tickaligned"); +%! subplot (3,1,2); +%! loglog (x, y, "-s"); +%! axis padded +%! title ("padded"); +%! subplot (3,1,3); +%! loglog (x, y, "-s"); +%! axis tight +%! title ("tight"); + %!test %! hf = figure ("visible", "off"); %! unwind_protect @@ -655,6 +631,19 @@ %! close (hf); %! end_unwind_protect +## Test 'axis tight' remains after addition of new data +%!test +%! hf = figure ("visible", "off"); +%! unwind_protect +%! plot (1:10) +%! axis tight; +%! assert (axis (), [1 10 1 10]); +%! plot (1:11) +%! assert (axis (), [1 11 1 11]); +%! unwind_protect_cleanup +%! close (hf); +%! end_unwind_protect + ## Even on errors, axis can display a figure. %!error %! hf = figure ("visible", "off"); diff -r 103efb7e1600 -r 4392386b5ecb scripts/plot/appearance/camlookat.m --- a/scripts/plot/appearance/camlookat.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/plot/appearance/camlookat.m Thu Mar 03 13:37:10 2022 -0500 @@ -281,7 +281,7 @@ %! end_unwind_protect ## compare to Matlab R2016a output -%!test +%!test <61532> %! hf = figure ("visible", "off"); %! unwind_protect %! [x, y, z] = peaks (); diff -r 103efb7e1600 -r 4392386b5ecb scripts/plot/appearance/legend.m --- a/scripts/plot/appearance/legend.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/plot/appearance/legend.m Thu Mar 03 13:37:10 2022 -0500 @@ -308,7 +308,7 @@ "deletefcn", {@reset_cb, hl}); ## Listeners to foreign objects properties are stored for later - ## deletion in "delfunction" + ## deletion in "reset_cb" hax = opts.axes_handles(1); hf = ancestor (hax, "figure"); @@ -350,7 +350,7 @@ addlistener (hl, "textcolor", ... @(h, ~) set (findobj (h, "type", "text"), ... - "color", get (hl, "textcolor"))); + "color", get (hl, "textcolor"))); addlistener (hl, "visible", @update_visible_cb); @@ -1076,14 +1076,22 @@ ## Main line vals = get (hplt(1), lprops); - hicon = __go_line__ (hl, [lprops; vals]{:}); + hicon = __go_line__ (hl, [lprops; vals]{:}, ... + "pickableparts", "all", ... + "buttondownfcn", ... + {@execute_itemhit, hl, hplt, "icon"}); + addproperty ("markerxdata", hicon, "double", 0); addproperty ("markerydata", hicon, "double", 0); ## Additional line for the marker vals = get (hplt(end), mprops); hmarker = __go_line__ (hl, "handlevisibility", "off", ... - "xdata", 0, "ydata", 0, [mprops; vals]{:}); + "xdata", 0, "ydata", 0, [mprops; vals]{:}, ... + "pickableparts", "all", ... + "buttondownfcn", ... + {@execute_itemhit, hl, hplt, "icon"}); + addproperty ("markertruesize", hmarker, "double", NaN); update_marker_cb (hmarker); ## Listeners @@ -1095,7 +1103,8 @@ @(h, ~) set (hmarker, "xdata", get (h, "markerxdata"))); addlistener (hicon, "visible", ... @(h, ~) set (hmarker, "visible", get (h, "visible"))); - addlistener (hmarker, "markersize", @update_marker_cb); + addlistener (hmarker, "markersize", {@update_marker_cb, true}); + addlistener (hmarker, "marker", {@update_marker_cb, false}); add_safe_listener (hl, hplt(1), "beingdeleted", @(~, ~) delete ([hicon hmarker])) if (! strcmp (typ, "__errplot__")) @@ -1127,7 +1136,10 @@ vals {end-1} = mean (vals {end-1}, 1); vals {end} = mean (vals {end}, 1); - hicon = __go_scatter__ (hl, [all_sprops; vals]{:}); + hicon = __go_scatter__ (hl, [all_sprops; vals]{:}, ... + "pickableparts", "all", ... + "buttondownfcn", ... + {@execute_itemhit, hl, hplt, "icon"}); ## Simple Listeners safe_property_link (hplt(1), hicon, sprops); @@ -1151,7 +1163,10 @@ ## Main patch vals = get (hplt(1), pprops); - hicon = __go_patch__ (hl, [pprops; vals]{:}); + hicon = __go_patch__ (hl, [pprops; vals]{:}, ... + "pickableparts", "all", ... + "buttondownfcn", ... + {@execute_itemhit, hl, hplt, "icon"}); addproperty ("innerxdata", hicon, "any", 0); addproperty ("innerydata", hicon, "any", 0); @@ -1159,7 +1174,10 @@ ## Additional patch for the inner contour vals = get (hplt(end), pprops); htmp = __go_patch__ (hl, "handlevisibility", "off", ... - "xdata", 0, "ydata", 0, [pprops; vals]{:}); + "xdata", 0, "ydata", 0, [pprops; vals]{:}, ... + "pickableparts", "all", ... + "buttondownfcn", ... + {@execute_itemhit, hl, hplt, "icon"}); ## Listeners safe_property_link (hplt(1), hicon, pprops); @@ -1177,13 +1195,30 @@ endswitch - htxt = __go_text__ (hl, txtpval{:}, "string", str); + htxt = __go_text__ (hl, txtpval{:}, "string", str, ... + "pickableparts", "all", ... + "buttondownfcn", {@execute_itemhit, hl, hplt, "label"}); + + set (htxt, "buttondownfcn", {@execute_itemhit, hl, hplt, "label"}); addproperty ("peer_object", htxt, "double", base_hplt); addproperty ("peer_object", hicon, "double", base_hplt); endfunction +function execute_itemhit (h, ~, hl, hplt, region) + + fcn = get (hl, "itemhitfcn"); + + if (! isempty (fcn)) + evt = struct ("Peer", hplt, "Region", region, ... + "SelectionType", get (gcbf (), "selectiontype"), ... + "Source", hl, "EventName", "ItemHit"); + fcn (hl, evt) + endif + +endfunction + function safe_property_link (h1, h2, props) for ii = 1:numel (props) @@ -1213,10 +1248,47 @@ endfunction -function update_marker_cb (h, ~) +## Enforce maximum size of marker so it doesn't overflow legend key +function update_marker_cb (h, ~, sz_updated = true) + persistent is_updating = false; + + if (is_updating) + return; + endif + + if (sz_updated) + ## Size was changed + sz = get (h, "markersize"); + set (h, "markertruesize", sz); # store true marker size + + if (sz > 8) + is_updating = true; - if (get (h, "markersize") > 8) - set (h, "markersize", 8); + mark = get (h, "marker"); + if (strcmp (mark, '.')) + set (h, "markersize", min ([sz, 24])); + else + set (h, "markersize", 8); + endif + + is_updating = false; + endif + + else + ## Marker style was changed + sz = get (h, "markertruesize"); + if (sz > 8) + is_updating = true; + + mark = get (h, "marker"); + if (strcmp (mark, '.')) + set (h, "markersize", min ([sz, 24])); + else + set (h, "markersize", 8); + endif + + is_updating = false; + endif endif endfunction @@ -2040,6 +2112,18 @@ %! legend ("Legend Text"); %! title ({"Multi-line", "titles", "are *not* a", "problem"}); +%!demo # bug 61814 +%! clf; +%! data = [ [1:5]' , [5:-1:1]', 2.5*ones(5,1) ]; +%! hp = plot (data); +%! set (hp(1), "marker", 'x', "markersize", 15); +%! set (hp(2), "marker", 'o', "markersize", 30); +%! set (hp(3), "marker", '.', "markersize", 30); +%! legend ({"data1", "data2", "data3"}, "location", "north"); +%! set (hp(2), "marker", '.'); +%! set (hp(3), "marker", 'o'); +%! title ("Marker sizes do not overflow legend box"); + ## Test input validation %!test %! hf = figure ("visible", "off"); diff -r 103efb7e1600 -r 4392386b5ecb scripts/plot/draw/fill.m --- a/scripts/plot/draw/fill.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/plot/draw/fill.m Thu Mar 03 13:37:10 2022 -0500 @@ -141,12 +141,9 @@ ## For Matlab compatibility, return 1 patch object for each column for j = 1 : columns (x) if (one_color) - [htmp, err] = __patch__ (hax, x(:,j), y(:,j), cdata, opts{:}); + htmp = __patch__ (hax, x(:,j), y(:,j), cdata, opts{:}); else - [htmp, err] = __patch__ (hax, x(:,j), y(:,j), cdata(:,j), opts{:}); - endif - if (err) - print_usage (); + htmp = __patch__ (hax, x(:,j), y(:,j), cdata(:,j), opts{:}); endif hlist(end+1, 1) = htmp; endfor diff -r 103efb7e1600 -r 4392386b5ecb scripts/plot/draw/fill3.m --- a/scripts/plot/draw/fill3.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/plot/draw/fill3.m Thu Mar 03 13:37:10 2022 -0500 @@ -154,14 +154,9 @@ ## For Matlab compatibility, return 1 patch object for each column for j = 1 : columns (x) if (one_color) - [htmp, err] = __patch__ (hax, x(:,j), y(:,j), z(:,j), ... - cdata, opts{:}); + htmp = __patch__ (hax, x(:,j), y(:,j), z(:,j), cdata, opts{:}); else - [htmp, err] = __patch__ (hax, x(:,j), y(:,j), z(:,j), ... - cdata(:,j), opts{:}); - endif - if (err) - print_usage (); + htmp = __patch__ (hax, x(:,j), y(:,j), z(:,j), cdata(:,j), opts{:}); endif hlist(end+1, 1) = htmp; endfor diff -r 103efb7e1600 -r 4392386b5ecb scripts/plot/draw/patch.m --- a/scripts/plot/draw/patch.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/plot/draw/patch.m Thu Mar 03 13:37:10 2022 -0500 @@ -28,7 +28,7 @@ ## @deftypefnx {} {} patch (@var{x}, @var{y}, @var{c}) ## @deftypefnx {} {} patch (@var{x}, @var{y}, @var{z}, @var{c}) ## @deftypefnx {} {} patch ("Faces", @var{faces}, "Vertices", @var{verts}, @dots{}) -## @deftypefnx {} {} patch (@dots{}, @var{prop}, @var{val}, @dots{}) +## @deftypefnx {} {} patch (@dots{}, "@var{prop}", @var{val}, @dots{}) ## @deftypefnx {} {} patch (@dots{}, @var{propstruct}, @dots{}) ## @deftypefnx {} {} patch (@var{hax}, @dots{}) ## @deftypefnx {} {@var{h} =} patch (@dots{}) @@ -82,17 +82,11 @@ [hax, varargin] = __plt_get_axis_arg__ ("patch", varargin{:}); - if (isempty (hax)) - hax = gca (); - else + if (! isempty (hax)) hax = hax(1); - endif + endif - [htmp, failed] = __patch__ (hax, varargin{:}); - - if (failed) - print_usage (); - endif + htmp = __patch__ (hax, varargin{:}); if (nargout > 0) h = htmp; @@ -308,3 +302,9 @@ %! unwind_protect_cleanup %! close (hf); %! end_unwind_protect + +## Test input validation +%!error patch (1, 1, 'x') +%!error patch (1, 1, rand (1,2,3)) +%!error patch (1, 1, [1, 2]) +%!error patch (1, 1, {1}) diff -r 103efb7e1600 -r 4392386b5ecb scripts/plot/draw/private/__patch__.m --- a/scripts/plot/draw/private/__patch__.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/plot/draw/private/__patch__.m Thu Mar 03 13:37:10 2022 -0500 @@ -32,153 +32,154 @@ ## Create patch object from x and y with color c and parent p. ## Return handle to patch object. -function [h, failed] = __patch__ (p, varargin) +function h = __patch__ (p, varargin) h = NaN; - failed = false; + nargin = nargin - 1; is_numeric_arg = cellfun (@isnumeric, varargin); if (isempty (varargin)) - args = varargin; + args = {}; elseif (is_numeric_arg(1)) if (nargin < 3 || ! is_numeric_arg(2)) - failed = true; - else - if (nargin > 4 && all (is_numeric_arg(1:4))) - x = varargin{1}; - y = varargin{2}; + print_usage ("patch"); + endif + + if (nargin >= 4 && all (is_numeric_arg(1:4))) + x = varargin{1}; + y = varargin{2}; + z = varargin{3}; + c = varargin{4}; + iarg = 5; + elseif (nargin >= 3 && all (is_numeric_arg(1:3))) + x = varargin{1}; + y = varargin{2}; + if (nargin > 3 && iscolorspec (varargin{4})) z = varargin{3}; c = varargin{4}; iarg = 5; - elseif (nargin > 3 && all (is_numeric_arg(1:3))) - x = varargin{1}; - y = varargin{2}; - if (nargin > 4 && iscolorspec (varargin{4})) - z = varargin{3}; - c = varargin{4}; - iarg = 5; - else - z = []; - c = varargin{3}; - iarg = 4; - endif - elseif (nargin > 2 && all (is_numeric_arg(1:2))) - x = varargin{1}; - y = varargin{2}; + else z = []; - if (iscolorspec (varargin{3})) - c = varargin{3}; - iarg = 4; - else - c = []; - iarg = 3; - endif + c = varargin{3}; + iarg = 4; endif + elseif (nargin >= 3 && all (is_numeric_arg(1:2))) + x = varargin{1}; + y = varargin{2}; + z = []; + if (iscolorspec (varargin{3})) + c = varargin{3}; + iarg = 4; + elseif (nargin == 3) + error ("patch: invalid color specification C"); + else + c = []; + iarg = 3; + endif + endif - if (isvector (x)) - x = x(:); - y = y(:); - z = z(:); - if (isnumeric (c)) - if (isvector (c)) - if (isequal (size (c), [1, 3])) - ## Do nothing, this is a single RGB color specification - elseif (numel (c) == numel (x)) - c = c(:); - endif - elseif (rows (c) != numel (x) && columns (c) == numel (x)) - c = c.'; + if (isvector (x)) + x = x(:); + y = y(:); + z = z(:); + if (isnumeric (c)) + if (isvector (c)) + if (isequal (size (c), [1, 3])) + ## Do nothing, this is a single RGB color specification + elseif (numel (c) == numel (x)) + c = c(:); endif + elseif (rows (c) != numel (x) && columns (c) == numel (x)) + c = c.'; endif endif - args{1} = "xdata"; - args{2} = x; - args{3} = "ydata"; - args{4} = y; - args{5} = "zdata"; - args{6} = z; + endif + args{1} = "xdata"; + args{2} = x; + args{3} = "ydata"; + args{4} = y; + args{5} = "zdata"; + args{6} = z; - if (isnumeric (c)) + if (isnumeric (c) && ! isempty (c)) - if (ndims (c) == 3 && columns (c) == 1) - c = permute (c, [1, 3, 2]); - endif + if (ndims (c) == 3 && columns (c) == 1) + c = permute (c, [1, 3, 2]); + endif - if (isvector (c) && numel (c) == columns (x)) - if (isnan (c)) - args{7} = "facecolor"; - args{8} = [1, 1, 1]; - args{9} = "cdata"; - args{10} = c; - elseif (isnumeric (c)) - args{7} = "facecolor"; - args{8} = "flat"; - args{9} = "cdata"; - args{10} = c; - else - error ("patch: color data C must be numeric"); - endif - elseif (isrow (c) && numel (c) == 3) + if (isvector (c) && numel (c) == columns (x)) + ## One color per face + if (isnan (c)) + args{7} = "facecolor"; + args{8} = [1, 1, 1]; + else args{7} = "facecolor"; - args{8} = c; + args{8} = "flat"; + endif + args{9} = "cdata"; + args{10} = c; + elseif (isrow (c) && numel (c) == 3) + ## One RGB color + args{7} = "facecolor"; + args{8} = c; + args{9} = "cdata"; + args{10} = []; + elseif (ndims (c) == 3 && size (c, 3) == 3) + ## CDATA is specified as 3-D RGB data + if ((rows (c) == 1 && columns (c) == 1) ... + || (rows (c) == 1 && columns (c) == columns (x))) + ## Single patch color or per-face color + args{7} = "facecolor"; + args{8} = "flat"; + args{9} = "cdata"; + args{10} = c; + elseif (rows (c) == rows (x) && columns (c) == columns (x)) + ## Per-vertex color + args{7} = "facecolor"; + args{8} = "interp"; + args{9} = "cdata"; + args{10} = c; + else + error ("patch: invalid TrueColor data C"); + endif + else + ## Color vectors + if (isempty (c)) + args{7} = "facecolor"; + args{8} = "interp"; args{9} = "cdata"; args{10} = []; - elseif (ndims (c) == 3 && size (c, 3) == 3) - ## CDATA is specified as RGB data - if ((rows (c) == 1 && columns (c) == 1) ... - || (rows (c) == 1 && columns (c) == columns (x))) - ## Single patch color or per-face color - args{7} = "facecolor"; - args{8} = "flat"; - args{9} = "cdata"; - args{10} = c; - elseif (rows (c) == rows (x) && columns (c) == columns (x)) - ## Per-vertex color - args{7} = "facecolor"; - args{8} = "interp"; - args{9} = "cdata"; - args{10} = c; - else - error ("patch: Invalid TrueColor data C"); - endif + elseif (size_equal (c, x) && size_equal (c, y)) + args{7} = "facecolor"; + args{8} = "interp"; + args{9} = "cdata"; + args{10} = c; else - ## Color Vectors - if (isempty (c)) - args{7} = "facecolor"; - args{8} = "interp"; - args{9} = "cdata"; - args{10} = []; - elseif (size_equal (c, x) && size_equal (c, y)) - args{7} = "facecolor"; - args{8} = "interp"; - args{9} = "cdata"; - args{10} = c; - else - error ("patch: size of X, Y, and C must be equal"); - endif + error ("patch: size of X, Y, and C must be equal"); endif - elseif (iscolorspec (c)) - args{7} = "facecolor"; - args{8} = tolower (c); - args{9} = "cdata"; - args{10} = []; - else - args{7} = "facecolor"; - args{8} = [0, 0, 0]; - args{9} = "cdata"; - args{10} = []; endif + elseif (iscolorspec (c)) + ## Color specification is a string + args{7} = "facecolor"; + args{8} = tolower (c); + args{9} = "cdata"; + args{10} = []; + elseif (! isempty (c)) + error ("patch: invalid color specification C"); + endif - args = [args, varargin(iarg:end)]; - endif + args = [args, varargin(iarg:end)]; + else + ## "Property"/Value pair input args = varargin; endif - if (! failed) - h = __go_patch__ (p, args{:}); + if (isempty (p)) + p = gca (); endif + h = __go_patch__ (p, args{:}); endfunction diff -r 103efb7e1600 -r 4392386b5ecb scripts/plot/util/findobj.m --- a/scripts/plot/util/findobj.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/plot/util/findobj.m Thu Mar 03 13:37:10 2022 -0500 @@ -217,7 +217,7 @@ numpairs = np - 1; if (! isempty (logicaloperator)) - logicaloperator = shift (logicaloperator, 1); + logicaloperator = circshift (logicaloperator, 1); endif ## Load all objects which qualify for being searched. diff -r 103efb7e1600 -r 4392386b5ecb scripts/plot/util/isaxes.m --- a/scripts/plot/util/isaxes.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/plot/util/isaxes.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,7 +24,7 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} isaxes (@var{h}) +## @deftypefn {} {@var{tf} =} isaxes (@var{h}) ## Return true if @var{h} is an axes graphics handle and false otherwise. ## ## If @var{h} is a matrix then return a logical array which is true where the @@ -32,16 +32,16 @@ ## @seealso{isfigure, ishghandle, isgraphics} ## @end deftypefn -function retval = isaxes (h) +function tf = isaxes (h) if (nargin < 1) print_usage (); endif - retval = ishghandle (h); + tf = ishghandle (h); - if (any (retval)) - retval(retval) = strcmp (get (h(retval), "type"), "axes"); + if (any (tf)) + tf(tf) = strcmp (get (h(tf), "type"), "axes"); endif endfunction diff -r 103efb7e1600 -r 4392386b5ecb scripts/plot/util/isfigure.m --- a/scripts/plot/util/isfigure.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/plot/util/isfigure.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,7 +24,7 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} isfigure (@var{h}) +## @deftypefn {} {@var{tf} =} isfigure (@var{h}) ## Return true if @var{h} is a figure graphics handle and false otherwise. ## ## If @var{h} is a matrix then return a logical array which is true where the @@ -33,16 +33,16 @@ ## @seealso{isaxes, ishghandle, isgraphics} ## @end deftypefn -function retval = isfigure (h) +function tf = isfigure (h) if (nargin < 1) print_usage (); endif - retval = ishghandle (h); + tf = ishghandle (h); - if (any (retval)) - retval(retval) = strcmp (get (h(retval), "type"), "figure"); + if (any (tf)) + tf(tf) = strcmp (get (h(tf), "type"), "figure"); endif endfunction diff -r 103efb7e1600 -r 4392386b5ecb scripts/plot/util/isgraphics.m --- a/scripts/plot/util/isgraphics.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/plot/util/isgraphics.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,8 +24,8 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} isgraphics (@var{h}) -## @deftypefnx {} {} isgraphics (@var{h}, @var{type}) +## @deftypefn {} {@var{tf} =} isgraphics (@var{h}) +## @deftypefnx {} {@var{tf} =} isgraphics (@var{h}, @var{type}) ## Return true if @var{h} is a graphics handle (of type @var{type}) and false ## otherwise. ## @@ -34,7 +34,7 @@ ## @seealso{ishghandle, ishandle, isaxes, isfigure} ## @end deftypefn -function retval = isgraphics (h, type = "") +function tf = isgraphics (h, type = "") if (nargin < 1) print_usage (); @@ -45,10 +45,10 @@ endif ## Octave has no Simulink equivalent so it is sufficient to call ishghandle. - retval = ishghandle (h); + tf = ishghandle (h); - if (nargin == 2 && any (retval)) - retval(retval) = strcmpi (get (h(retval), "type"), type); + if (nargin == 2 && any (tf)) + tf(tf) = strcmpi (get (h(tf), "type"), type); endif endfunction diff -r 103efb7e1600 -r 4392386b5ecb scripts/plot/util/ishandle.m --- a/scripts/plot/util/ishandle.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/plot/util/ishandle.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,7 +24,7 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} ishandle (@var{h}) +## @deftypefn {} {@var{tf} =} ishandle (@var{h}) ## Return true if @var{h} is a handle to a graphics or Java object and false ## otherwise. ## @@ -39,13 +39,13 @@ ## @seealso{ishghandle, isgraphics, isjava} ## @end deftypefn -function retval = ishandle (h) +function tf = ishandle (h) if (nargin < 1) print_usage (); endif - retval = ishghandle (h) | isjava (h); + tf = ishghandle (h) | isjava (h); endfunction diff -r 103efb7e1600 -r 4392386b5ecb scripts/plot/util/ishold.m --- a/scripts/plot/util/ishold.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/plot/util/ishold.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,9 +24,9 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} ishold -## @deftypefnx {} {} ishold (@var{hax}) -## @deftypefnx {} {} ishold (@var{hfig}) +## @deftypefn {} {@var{tf} =} ishold +## @deftypefnx {} {@var{tf} =} ishold (@var{hax}) +## @deftypefnx {} {@var{tf} =} ishold (@var{hfig}) ## Return true if the next plot will be added to the current plot, or ## false if the plot device will be cleared before drawing the next plot. ## @@ -35,7 +35,7 @@ ## @seealso{hold, newplot} ## @end deftypefn -function retval = ishold (h) +function tf = ishold (h) if (nargin == 0) fig = gcf (); @@ -60,7 +60,7 @@ endswitch endif - retval = (strcmp (get (fig, "nextplot"), "add") + tf = (strcmp (get (fig, "nextplot"), "add") && ! isempty (ax) && strcmp (get (ax, "nextplot"), "add")); endfunction diff -r 103efb7e1600 -r 4392386b5ecb scripts/plot/util/private/__opengl_print__.m --- a/scripts/plot/util/private/__opengl_print__.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/plot/util/private/__opengl_print__.m Thu Mar 03 13:37:10 2022 -0500 @@ -71,9 +71,8 @@ gl2ps_device = {sprintf("%snotxt", lower (suffix))}; gl2ps_device{2} = "tex"; if (dos_shell) - ## FIXME: this will only work on MinGW with the MSYS shell - pipeline = {sprintf('cat > "%s-inc.%s"', name, suffix)}; - pipeline{2} = sprintf ('cat > "%s.tex"', name); + pipeline = {sprintf('findstr . > "%s-inc.%s"', name, suffix)}; + pipeline{2} = sprintf ('findstr . > "%s.tex"', name); else pipeline = {sprintf('cat > "%s-inc.%s"', name, suffix)}; pipeline{2} = sprintf ('cat > "%s.tex"', name); diff -r 103efb7e1600 -r 4392386b5ecb scripts/polynomial/pchip.m --- a/scripts/polynomial/pchip.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/polynomial/pchip.m Thu Mar 03 13:37:10 2022 -0500 @@ -111,11 +111,6 @@ ## Compute derivatives. d = __pchip_deriv__ (x, y, 2); - if (iscomplex (y)) - ## __pchip_deriv__ ignores imaginary part. Do it again for imag part. - ## FIXME: Adapt __pchip_deriv__ to correctly handle complex input. - d += 1i * __pchip_deriv__ (x, imag (y), 2); - endif d1 = d(:, 1:n-1); d2 = d(:, 2:n); diff -r 103efb7e1600 -r 4392386b5ecb scripts/polynomial/poly.m --- a/scripts/polynomial/poly.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/polynomial/poly.m Thu Mar 03 13:37:10 2022 -0500 @@ -61,17 +61,21 @@ print_usage (); endif - m = min (size (x)); - n = max (size (x)); - if (m == 0) + if (! isnumeric (x)) + error ("poly: input must be numeric, not type %s", class (x)); + elseif (ndims (x) > 2) + error ("poly: input must be a vector or a square matrix"); + elseif (isempty (x)) y = 1; return; - elseif (m == 1) + elseif (isvector (x)) + n = numel (x); v = x; - elseif (m == n) + elseif (! issquare (x)) + error ("poly: input matrix must be square"); + else + n = size (x,1); v = eig (x); - else - print_usage (); endif y = zeros (1, n+1); @@ -113,4 +117,7 @@ %! assert (y, [1 + 0i, -9 - 3i, 25 + 24i, -17 - 57i, -12 + 36i]); %!error poly () -%!error poly ([1, 2, 3; 4, 5, 6]) +%!error poly ("foo") +%!error poly ({1, "foo"; "bar", 1}) +%!error poly (ones (2, 2, 2)) +%!error poly ([1, 2, 3; 4, 5, 6]) diff -r 103efb7e1600 -r 4392386b5ecb scripts/prefs/ispref.m --- a/scripts/prefs/ispref.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/prefs/ispref.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,9 +24,9 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} ispref ("@var{group}", "@var{pref}") -## @deftypefnx {} {} ispref ("@var{group}", @{"@var{pref1}", "@var{pref2"}, @dots{}@}) -## @deftypefnx {} {} ispref ("@var{group}") +## @deftypefn {} {@var{tf} =} ispref ("@var{group}", "@var{pref}") +## @deftypefnx {} {@var{tf} =} ispref ("@var{group}", @{"@var{pref1}", "@var{pref2"}, @dots{}@}) +## @deftypefnx {} {@var{tf} =} ispref ("@var{group}") ## Return true if the named preference @var{pref} exists in the preference ## group @var{group}. ## @@ -39,7 +39,7 @@ ## @seealso{getpref, addpref, setpref, rmpref} ## @end deftypefn -function retval = ispref (group, pref = "") +function tf = ispref (group, pref = "") if (nargin == 0) print_usage (); @@ -53,16 +53,16 @@ endif if (nargin == 1) - retval = isfield (loadprefs (), group); + tf = isfield (loadprefs (), group); else prefs = loadprefs (); if (isfield (prefs, group)) - retval = isfield (prefs.(group), pref); + tf = isfield (prefs.(group), pref); else if (ischar (pref)) - retval = false; + tf = false; else - retval = false (size (pref)); + tf = false (size (pref)); endif endif endif diff -r 103efb7e1600 -r 4392386b5ecb scripts/sparse/treelayout.m --- a/scripts/sparse/treelayout.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/sparse/treelayout.m Thu Mar 03 13:37:10 2022 -0500 @@ -164,14 +164,14 @@ left_most += 1; x_coordinate_r(par_number) = left_most; max_ht = min (max_ht, level); - if (length (stk) > 1 && find ((shift (stk,1) - stk) == 0) > 1 + if (length (stk) > 1 && find ((circshift (stk,1) - stk) == 0) > 1 && stk(end,2) != stk(end-1,2)) ## Return to the nearest branching the position to return ## position is the position on the stack, where should be ## started further search (there are two nodes which has the ## same parent node). - position = (find ((shift (stk(:,2), 1) - stk(:,2)) == 0))(end) + 1; + position = (find ((circshift (stk(:,2), 1) - stk(:,2)) == 0))(end) + 1; par_number_vec = stk(position:end,2); ## The vector of removed nodes (the content of stack form diff -r 103efb7e1600 -r 4392386b5ecb scripts/sparse/treeplot.m --- a/scripts/sparse/treeplot.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/sparse/treeplot.m Thu Mar 03 13:37:10 2022 -0500 @@ -127,13 +127,13 @@ left_most += 1; x_coordinate_r(par_number) = left_most; max_ht = min (max_ht, level); - if (length (stk) > 1 && find ((shift (stk,1) - stk) == 0) > 1 + if (length (stk) > 1 && find ((circshift (stk,1) - stk) == 0) > 1 && stk(end,2) != stk(end-1,2)) ## Return to the nearest branching the position to return ## position is the position on the stack, where should be ## started further search (there are two nodes which has the ## same parent node). - position = (find ((shift (stk(:,2),1) - stk(:,2)) == 0))(end) + 1; + position = (find ((circshift (stk(:,2),1) - stk(:,2)) == 0))(end) + 1; par_number_vec = stk(position:end,2); ## The vector of removed nodes (the content of stack form ## position to end). diff -r 103efb7e1600 -r 4392386b5ecb scripts/specfun/isprime.m --- a/scripts/specfun/isprime.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/specfun/isprime.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,7 +24,7 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} isprime (@var{x}) +## @deftypefn {} {@var{tf} =} isprime (@var{x}) ## Return a logical array which is true where the elements of @var{x} are prime ## numbers and false where they are not. ## @@ -72,7 +72,7 @@ ## @seealso{primes, factor, gcd, lcm} ## @end deftypefn -function t = isprime (x) +function tf = isprime (x) if (nargin < 1) print_usage (); @@ -81,12 +81,12 @@ endif if (isempty (x)) - t = x; + tf = x; return; endif if (iscomplex (x)) - t = isgaussianprime (x); + tf = isgaussianprime (x); return; endif @@ -101,7 +101,7 @@ ## because of the method used by __isprimelarge__ below. maxp = 37; pr = [2 3 5 7 11 13 17 19 23 29 31 37]; - t = lookup (pr, x, "b"); # quick search for table matches. + tf = lookup (pr, x, "b"); # quick search for table matches. THRESHOLD = 29e9; ## FIXME: THRESHOLD is the input value at which Miller-Rabin @@ -143,7 +143,7 @@ ## Start by dividing through by the small primes until the remaining list ## of entries is small (and most likely prime themselves). pr2 = primes (sqrt (max (m))); - t |= lookup (pr2, x, "b"); + tf |= lookup (pr2, x, "b"); for p = pr2 m = m(rem (m, p) != 0); if (numel (m) < numel (pr) / 10) @@ -160,20 +160,20 @@ ## Add any remaining entries, which are truly prime, to the results. if ( ! isempty (m)) - t |= lookup (sort (m), x, "b"); + tf |= lookup (sort (m), x, "b"); endif endif ## Process remaining entries (everything above THRESHOLD) with Miller-Rabin ii = (x(:)' > THRESHOLD); - t(ii) = __isprimelarge__ (x(ii)); + tf(ii) = __isprimelarge__ (x(ii)); endfunction -function t = isgaussianprime (z) +function tf = isgaussianprime (z) ## Assume prime unless proven otherwise - t = true (size (z)); + tf = true (size (z)); x = real (z); y = imag (z); @@ -183,13 +183,13 @@ xidx = y==0 & mod (x, 4) == 3; yidx = x==0 & mod (y, 4) == 3; - t(xidx) &= isprime (x(xidx)); - t(yidx) &= isprime (y(yidx)); + tf(xidx) &= isprime (x(xidx)); + tf(yidx) &= isprime (y(yidx)); ## Otherwise, prime if x^2 + y^2 is prime zidx = ! (xidx | yidx); # Skip entries that were already evaluated zabs = x(zidx).^2 + y(zidx).^2; - t(zidx) &= isprime (zabs); + tf(zidx) &= isprime (zabs); endfunction diff -r 103efb7e1600 -r 4392386b5ecb scripts/specfun/module.mk --- a/scripts/specfun/module.mk Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/specfun/module.mk Thu Mar 03 13:37:10 2022 -0500 @@ -19,7 +19,6 @@ %reldir%/nchoosek.m \ %reldir%/nthroot.m \ %reldir%/perms.m \ - %reldir%/pow2.m \ %reldir%/primes.m \ %reldir%/reallog.m \ %reldir%/realpow.m \ diff -r 103efb7e1600 -r 4392386b5ecb scripts/specfun/pow2.m --- a/scripts/specfun/pow2.m Thu Mar 03 13:31:24 2022 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,74 +0,0 @@ -######################################################################## -## -## Copyright (C) 1995-2022 The Octave Project Developers -## -## See the file COPYRIGHT.md in the top-level directory of this -## distribution or . -## -## 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 {} {} pow2 (@var{x}) -## @deftypefnx {} {} pow2 (@var{f}, @var{e}) -## With one input argument, compute -## @tex -## $2^x$ -## @end tex -## @ifnottex -## 2 .^ x -## @end ifnottex -## for each element of @var{x}. -## -## With two input arguments, return -## @tex -## $f \cdot 2^e$. -## @end tex -## @ifnottex -## f .* (2 .^ e). -## @end ifnottex -## @seealso{log2, nextpow2, power} -## @end deftypefn - -function y = pow2 (f, e) - - if (nargin < 1) - print_usage (); - endif - - if (nargin == 1) - y = 2 .^ f; - else - y = f .* (2 .^ e); - endif - -endfunction - - -%!test -%! x = [3, 0, -3]; -%! v = [8, 1, .125]; -%! assert (pow2 (x), v, sqrt (eps)); - -%!test -%! x = [3, 0, -3, 4, 0, -4, 5, 0, -5]; -%! y = [-2, -2, -2, 1, 1, 1, 3, 3, 3]; -%! z = x .* (2 .^ y); -%! assert (pow2 (x,y), z, sqrt (eps)); - -%!error pow2 () diff -r 103efb7e1600 -r 4392386b5ecb scripts/statistics/var.m diff -r 103efb7e1600 -r 4392386b5ecb scripts/strings/isletter.m --- a/scripts/strings/isletter.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/strings/isletter.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,7 +24,7 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} isletter (@var{s}) +## @deftypefn {} {@var{tf} =} isletter (@var{s}) ## Return a logical array which is true where the elements of @var{s} ## are letters and false where they are not. ## @@ -32,13 +32,13 @@ ## @seealso{isalpha, isdigit, ispunct, isspace, iscntrl, isalnum} ## @end deftypefn -function retval = isletter (s) +function tf = isletter (s) if (nargin < 1) print_usage (); endif - retval = isalpha (s); + tf = isalpha (s); endfunction diff -r 103efb7e1600 -r 4392386b5ecb scripts/strings/isstring.m --- a/scripts/strings/isstring.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/strings/isstring.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,7 +24,7 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} isstring (@var{s}) +## @deftypefn {} {@var{tf} =} isstring (@var{s}) ## Return true if @var{s} is a string array. ## ## A string array is a data type that stores strings (row vectors of @@ -40,13 +40,13 @@ ## @seealso{ischar, iscellstr, isfloat, isinteger, islogical, isnumeric, isa} ## @end deftypefn -function retval = isstring (s) +function tf = isstring (s) if (nargin < 1) print_usage (); endif - retval = false; + tf = false; endfunction diff -r 103efb7e1600 -r 4392386b5ecb scripts/strings/isstrprop.m --- a/scripts/strings/isstrprop.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/strings/isstrprop.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,7 +24,7 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} isstrprop (@var{str}, @var{prop}) +## @deftypefn {} {@var{tf} =} isstrprop (@var{str}, @var{prop}) ## Test character string properties. ## ## For example: @@ -91,7 +91,7 @@ ## isspace, ispunct, iscntrl, isgraph, isprint, isascii} ## @end deftypefn -function retval = isstrprop (str, prop) +function tf = isstrprop (str, prop) if (nargin != 2) print_usage (); @@ -99,29 +99,29 @@ switch (prop) case "alpha" - retval = isalpha (str); + tf = isalpha (str); case {"alnum", "alphanum"} - retval = isalnum (str); + tf = isalnum (str); case "ascii" - retval = isascii (str); + tf = isascii (str); case "cntrl" - retval = iscntrl (str); + tf = iscntrl (str); case "digit" - retval = isdigit (str); + tf = isdigit (str); case {"graph", "graphic"} - retval = isgraph (str); + tf = isgraph (str); case "lower" - retval = islower (str); + tf = islower (str); case "print" - retval = isprint (str); + tf = isprint (str); case "punct" - retval = ispunct (str); + tf = ispunct (str); case {"space", "wspace"} - retval = isspace (str); + tf = isspace (str); case "upper" - retval = isupper (str); + tf = isupper (str); case "xdigit" - retval = isxdigit (str); + tf = isxdigit (str); otherwise error ("isstrprop: invalid string property"); endswitch diff -r 103efb7e1600 -r 4392386b5ecb scripts/strings/strjust.m --- a/scripts/strings/strjust.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/strings/strjust.m Thu Mar 03 13:37:10 2022 -0500 @@ -94,7 +94,7 @@ endif ## Adjust the column indices. - jdx += shift (idx); + jdx += shift(idx); ## Create a blank matrix and position the nonblank characters. y = repmat (" ", nr, nc); diff -r 103efb7e1600 -r 4392386b5ecb scripts/time/datevec.m --- a/scripts/time/datevec.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/time/datevec.m Thu Mar 03 13:37:10 2022 -0500 @@ -208,6 +208,13 @@ original_f = f; # Store for error messages. + if (any (strchr (f, "hsfYD", 1))) + warning ("Octave:datevec:date-format-spec", ... + ["datevec: Format specifiers for dates should be lower case,", ... + " format specifiers for time should be upper case. ", ... + " Possible issue with 'm' (month) and 'M' (minutes)?"]); + endif + ## Play safe with percent signs. f = strrep (f, "%", "%%"); @@ -461,3 +468,8 @@ %!error datevec ("15:38:21.251", "HH:HH:SS") %!error datevec ("15:38:21.251", "MM:MM:SS") %!error datevec ("15:38:21.251", "HH:SS:SS") +%!fail ("datevec ('2015-03-31 0:00','YYYY-mm-DD HH:MM')", ... +%! "warning", "Format specifiers for dates should be lower case"); +%!fail ("datevec ('2015-03-31 hh:00','yyyy-mm-dd hh:MM')", ... +%! "warning", "format specifiers for time should be upper case"); + diff -r 103efb7e1600 -r 4392386b5ecb scripts/time/is_leap_year.m --- a/scripts/time/is_leap_year.m Thu Mar 03 13:31:24 2022 -0500 +++ b/scripts/time/is_leap_year.m Thu Mar 03 13:37:10 2022 -0500 @@ -24,8 +24,8 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} is_leap_year () -## @deftypefnx {} {} is_leap_year (@var{year}) +## @deftypefn {} {@var{tf} =} is_leap_year () +## @deftypefnx {} {@var{tf} =} is_leap_year (@var{year}) ## Return true if @var{year} is a leap year and false otherwise. ## ## If no year is specified, @code{is_leap_year} uses the current year. @@ -41,14 +41,14 @@ ## @seealso{weekday, eomday, calendar} ## @end deftypefn -function retval = is_leap_year (year) +function tf = is_leap_year (year) if (nargin == 0) t = clock (); year = t(1); endif - retval = (rem (year, 4) == 0 & rem (year, 100) != 0) | (rem (year, 400) == 0); + tf = (rem (year, 4) == 0 & rem (year, 100) != 0) | (rem (year, 400) == 0); endfunction diff -r 103efb7e1600 -r 4392386b5ecb src/mkoctfile.in.cc diff -r 103efb7e1600 -r 4392386b5ecb test/pkg/pkg.tst --- a/test/pkg/pkg.tst Thu Mar 03 13:31:24 2022 -0500 +++ b/test/pkg/pkg.tst Thu Mar 03 13:37:10 2022 -0500 @@ -73,7 +73,9 @@ %!testif HAVE_Z %! for i = 1:numel (mfile_pkg_name) %! silent_pkg_install (mfile_pkg_tgz{i}); -%! system (["chmod -Rf u+w '" prefix "'"]); ## FIXME: Work around bug #53578 +%! if (isunix ()) +%! system (["chmod -Rf u+w '" prefix "'"]); ## FIXME: Work around bug #53578 +%! endif %! pkg ("uninstall", mfile_pkg_name{i}); %! endfor %! @@ -83,7 +85,9 @@ %!testif HAVE_Z %! for i = 1:numel (mfile_pkg_name) %! silent_pkg_install ("-local", mfile_pkg_tgz{i}); -%! system (["chmod -Rf u+w '" prefix "'"]); ## FIXME: Work around bug #53578 +%! if (isunix) +%! system (["chmod -Rf u+w '" prefix "'"]); ## FIXME: Work around bug #53578 +%! endif %! pkg ("uninstall", mfile_pkg_name{i}); %! endfor @@ -111,7 +115,9 @@ %! pkg ("load", name); %! pkg ("unload", name); %! unwind_protect_cleanup -%! system (["chmod -Rf u+w '" prefix "'"]); ## FIXME: Work around bug #53578 +%! if (isunix) +%! system (["chmod -Rf u+w '" prefix "'"]); ## FIXME: Work around bug #53578 +%! endif %! pkg ("uninstall", name); %! end_unwind_protect %! endfor @@ -138,7 +144,9 @@ %! [desc, flag] = pkg ("describe", mfile_pkg_name{1}); %! ## FIXME: this only tests that the describe command runs, %! ## not that the output is in anyway correct. -%! system (["chmod -Rf u+w '" prefix "'"]); ## FIXME: Work around bug #53578 +%! if (isunix) +%! system (["chmod -Rf u+w '" prefix "'"]); ## FIXME: Work around bug #53578 +%! endif %! pkg ("uninstall", mfile_pkg_name{1}); ## -verbose