# HG changeset patch # User Markus Mützel # Date 1661774280 -7200 # Node ID 8340137bb190a190bc68a57029460eff25148cd8 # Parent f5db0112f7e89f46d18add1d0a16f0ce428f9766# Parent 9ad55d2e1bbf35d9aacda4dd493c8c297124413a maint: Merge stable to default. diff -r 9ad55d2e1bbf -r 8340137bb190 .github/workflows/make.yaml --- a/.github/workflows/make.yaml Sun Aug 28 22:44:49 2022 +0200 +++ b/.github/workflows/make.yaml Mon Aug 29 13:58:00 2022 +0200 @@ -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? @@ -435,7 +435,7 @@ key: ccache:${{ matrix.os }}:${{ matrix.msystem }}:${{ github.ref }}:${{ steps.ccache_cache_timestamp.outputs.timestamp }}:${{ github.sha }} restore-keys: | ccache:${{ matrix.os }}:${{ matrix.msystem }}:${{ github.ref }} - ccache:${{ matrix.os }}:${{ matrix.msystem }}:refs/heads/stable + ccache:${{ matrix.os }}:${{ matrix.msystem }}:refs/heads/default - name: configure ccache # Limit the maximum size and switch on compression to avoid exceeding the total disk or cache quota. @@ -519,3 +519,25 @@ [ -n "$(grep -e "FAIL\s*0" ./test-suite.log)" ] || echo "::warning::At least one test failed" [ -z "$(grep -e "REGRESSION" ./test-suite.log)" ] || echo "::warning::At least one regression in test suite" echo Finished analyzing test suite results. + + - name: install and compress + if: matrix.msystem == 'MINGW64' + continue-on-error: true + run: | + echo "::group::Installing Octave" + mkdir -p /c/octave/pkg + make -C ./.build DESTDIR=/c/octave/pkg install + echo "::endgroup::" + echo "::group::Compressing Octave package" + cd /c/octave/pkg + tar -cvzf octave.tar.gz * + echo "::endgroup::" + + - name: upload build artifact + if: matrix.msystem == 'MINGW64' + continue-on-error: true + uses: actions/upload-artifact@v3 + with: + name: ${{ matrix.target-prefix }}-octave-${{ steps.ccache_cache_timestamp.outputs.timestamp }} + path: C:\octave\pkg\octave.tar.gz + retention-days: 7 diff -r 9ad55d2e1bbf -r 8340137bb190 .hgignore --- a/.hgignore Sun Aug 28 22:44:49 2022 +0200 +++ b/.hgignore Mon Aug 29 13:58:00 2022 +0200 @@ -25,7 +25,7 @@ (^|/)config.log$ (^|/)config.status$ -^Makefile\.in$ +(^|/)Makefile\.in$ ^INSTALL$ ## CMake associated files @@ -40,6 +40,7 @@ ## Scripts associated with building Octave ^build-aux/config\.(guess|rpath|sub)$ (^|/)build-aux/check-subst-vars\.sh$ +^build-aux/compile$ ^build-aux/depcomp$ ^build-aux/install-sh$ ^build-aux/ltmain\.sh$ @@ -123,3 +124,4 @@ ## Test associated patterns -tst$ +^.build/* diff -r 9ad55d2e1bbf -r 8340137bb190 Makefile.am --- a/Makefile.am Sun Aug 28 22:44:49 2022 +0200 +++ b/Makefile.am Mon Aug 29 13:58:00 2022 +0200 @@ -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 += \ @@ -458,17 +460,18 @@ if [ -n "`cat $(OCT_FILE_PKG_ADD_FILES)`" ]; then \ $(INSTALL_DATA) oct-file-pkg-add $(DESTDIR)$(octfiledir)/PKG_ADD; \ fi + top_build_dir=`pwd` && \ cd $(DESTDIR)$(octlibdir) && \ for ltlib in $(OCT_FILE_LIBS); do \ f=`echo $$ltlib | $(SED) 's,.*/,,'`; \ - dl=`$(SED) -n -e "s/dlname='\([^']*\)'/\1/p" < $$f`; \ + dl=`$(SED) -n -e "s/dlname='\([^']*\)'/\1/p" < $$top_build_dir/$$ltlib`; \ if [ -n "$$dl" ]; then \ $(INSTALL_PROGRAM) $$dl $(DESTDIR)$(octfiledir)/`echo $$f | $(SED) 's,^lib,,; s,\.la$$,.oct,'`; \ else \ echo "error: dlname is empty in $$ltlib!"; \ exit 1; \ fi; \ - lnames=`$(SED) -n -e "s/library_names='\([^']*\)'/\1/p" < $$f`; \ + lnames=`$(SED) -n -e "s/library_names='\([^']*\)'/\1/p" < $$top_build_dir/$$ltlib`; \ if [ -n "$$lnames" ]; then \ rm -f $$f $$lnames $$dl; \ fi \ diff -r 9ad55d2e1bbf -r 8340137bb190 bootstrap.conf --- a/bootstrap.conf Sun Aug 28 22:44:49 2022 +0200 +++ b/bootstrap.conf Mon Aug 29 13:58:00 2022 +0200 @@ -90,6 +90,7 @@ stat stddef stdio + strcase strdup-posix strerror strptime @@ -100,7 +101,6 @@ sys_times sys_wait tempname - tmpfile uname unicase/u8-tolower unicase/u8-toupper diff -r 9ad55d2e1bbf -r 8340137bb190 build-aux/mk-octave-config-h.sh --- a/build-aux/mk-octave-config-h.sh Sun Aug 28 22:44:49 2022 +0200 +++ b/build-aux/mk-octave-config-h.sh Mon Aug 29 13:58:00 2022 +0200 @@ -100,210 +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 - -/* time type in API is always 64 bits wide */ -# define OCTAVE_TIME_T int64_t - -# 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 @@ -372,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 9ad55d2e1bbf -r 8340137bb190 build-aux/module.mk --- a/build-aux/module.mk Sun Aug 28 22:44:49 2022 +0200 +++ b/build-aux/module.mk Mon Aug 29 13:58:00 2022 +0200 @@ -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 9ad55d2e1bbf -r 8340137bb190 configure.ac --- a/configure.ac Sun Aug 28 22:44:49 2022 +0200 +++ b/configure.ac Mon Aug 29 13:58:00 2022 +0200 @@ -27,7 +27,7 @@ ### Initialize Autoconf AC_PREREQ([2.65]) -AC_INIT([GNU Octave], [7.2.1], [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_MINOR_VERSION=2 -OCTAVE_PATCH_VERSION=1 +OCTAVE_MAJOR_VERSION=8 +OCTAVE_MINOR_VERSION=0 +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) @@ -135,7 +135,7 @@ '${libdir}/octave/${version}/oct/${canonical_host_type}') ## Directories that Octave should search for object files that will be -## dynamically loaded and that are specific to this site (i.e. customizations), +## dynamically loaded and that are specific to this site (i.e., customizations), ## before consulting ${octfiledir}. This should be a colon-separated list of ## directories. OCTAVE_SET_DEFAULT([localoctfiledir], @@ -156,7 +156,7 @@ OCTAVE_SET_DEFAULT([fcnfiledir], '${datadir}/octave/${version}/m') ## Directories that Octave should search for function files specific to this -## site (i.e. customizations), before consulting ${fcnfiledir}. +## site (i.e., customizations), before consulting ${fcnfiledir}. ## This should be a colon-separated list of directories. OCTAVE_SET_DEFAULT([localfcnfiledir], '${datadir}/octave/site/m') @@ -252,7 +252,7 @@ AM_CONDITIONAL([AMCOND_HAVE_ICON_TOOLS], [test -n "$ICOTOOL" && test -n "$RSVG_CONVERT"]) -### Path separator. +### Determine path separator. sepchar=':' AC_ARG_WITH([sepchar], @@ -279,9 +279,9 @@ [Define this to be the path separator for your system, as a string.]) ### Define the path to the shell on the host system. -### Most systems will ensure /bin/sh is the default shell so this can be safely -### ignored by almost everyone. However, when building for Android, for -### example, this will need to be set. +dnl Most systems will ensure /bin/sh is the default shell so this can be safely +dnl ignored by almost everyone. However, there are exceptions, such as +dnl Android, where this will need to be set. SHELL_PATH=/bin/sh AC_ARG_WITH([shell], [AS_HELP_STRING([--with-shell=SHELL], @@ -299,34 +299,6 @@ AC_DEFINE_UNQUOTED([SHELL_PATH], ["$SHELL_PATH"], [Define this to be the path to the shell command interpreter.]) -### Use the system-wide installation of GNU FreeFont if the user requests it. -### By default, Octave includes its own copy of the FreeSans font, which it -### installs in its own directory for use as a fallback default font. If this -### configuration option is used, then do not install our own copy of the fonts -### and assume they can be found in the provided system directory. -SYSTEM_FREEFONT_DIR= -AC_ARG_WITH([system-freefont], - [AS_HELP_STRING([--with-system-freefont=DIR], - [use FreeSans fonts in DIR (default: install and use internal copy)])]) -case $with_system_freefont in - no | "") - SYSTEM_FREEFONT_DIR= - ;; - yes) - AC_MSG_ERROR([directory argument required for --with-system-freefont]) - ;; - *) - SYSTEM_FREEFONT_DIR=$with_system_freefont - ;; -esac -if test -n "$SYSTEM_FREEFONT_DIR"; then - AC_MSG_NOTICE([configuring Octave to use system fonts in $SYSTEM_FREEFONT_DIR]) - AC_DEFINE_UNQUOTED([SYSTEM_FREEFONT_DIR], ["$SYSTEM_FREEFONT_DIR"], - [Define this to be the system directory containing the GNU FreeFont fonts.]) -fi -AM_CONDITIONAL([AMCOND_INSTALL_INTERNAL_FONT_FILES], - [test -z "$SYSTEM_FREEFONT_DIR"]) - ### Determine which C++ compiler to use (we expect to find g++). AC_PROG_CXX @@ -335,14 +307,14 @@ ENABLE_STD_PMR_POLYMORPHIC_ALLOCATOR=no AC_ARG_ENABLE(std-pmr-polymorphic-allocator, [AS_HELP_STRING([--enable-std-pmr-polymorphic-allocator], - [build libraries requiring std::pmr::polymorphic_allocator if possible. This allows more efficient transfer of arrays at the .mex file interface. That also means that all libraries including Octave headers (e.g., .oct files) must be able to compile with that C++17 feature.])], + [build libraries requiring std::pmr::polymorphic_allocator if possible. This allows more efficient transfer of arrays at the .mex file interface. That also means that all libraries including Octave headers (e.g., .oct files) must be able to compile with that C++17 feature.])], [case $enableval in yes) ENABLE_STD_PMR_POLYMORPHIC_ALLOCATOR=yes ;; no) ENABLE_STD_PMR_POLYMORPHIC_ALLOCATOR=no ;; *) AC_MSG_ERROR([bad value $enableval for --enable-std-pmr-polymorphic-allocator]) ;; esac]) -### Check compiler capabilities. +### Determine compiler capabilities. if test $ENABLE_STD_PMR_POLYMORPHIC_ALLOCATOR = yes; then ## Test for flags to fully support C++17. @@ -403,16 +375,16 @@ GXX_VERSION= if test "$GXX" = yes; then - AC_MSG_CHECKING([C++ compiler version number]) - gxx_version=`$CXX -v 2>&1 | $GREP "^.*g.. version" | \ - $SED -e 's/^.*g.. version *//' -e 's/cygnus-//' -e 's/egcs-//' -e 's/ .*//'` - - AX_COMPARE_VERSION([$gxx_version], [lt], [4.1], - [warn_gxx_version="g++ version $gxx_version is likely to cause problems" + AC_CACHE_CHECK([g++ compiler version number], + [octave_cv_gxx_version], + [octave_cv_gxx_version=[`$CXX -v 2>&1 | $GREP "^.*g.. version" | $SED -e 's/^.*g.. version *//' -e 's/cygnus-//' -e 's/egcs-//' -e 's/ .*//'`] + ]) + + AX_COMPARE_VERSION([$octave_cv_gxx_version], [lt], [4.1], + [warn_gxx_version="g++ version $octave_cv_gxx_version is likely to cause problems" OCTAVE_CONFIGURE_WARNING([warn_gxx_version])]) - GXX_VERSION=$gxx_version - AC_MSG_RESULT([$GXX_VERSION]) + GXX_VERSION=$octave_cv_gxx_version fi AC_SUBST(GXX_VERSION) @@ -431,16 +403,16 @@ GCC_VERSION= if test "$GCC" = yes; then - AC_MSG_CHECKING([C compiler version number]) - gcc_version=`$CC -v 2>&1 | $GREP "^.*gcc version" | \ - $SED -e 's/^.*g.. version *//' -e 's/cygnus-//' -e 's/egcs-//' -e 's/ .*//'` - - AX_COMPARE_VERSION([$gcc_version], [lt], [3], - [warn_gcc_version="gcc version $gcc_version is likely to cause problems" + AC_CACHE_CHECK([gcc compiler version number], + [octave_cv_gcc_version], + [octave_cv_gcc_version=[`$CC -v 2>&1 | $GREP "^.*gcc version" | $SED -e 's/^.*g.. version *//' -e 's/cygnus-//' -e 's/egcs-//' -e 's/ .*//'`] + ]) + + AX_COMPARE_VERSION([$octave_cv_gcc_version], [lt], [3], + [warn_gcc_version="gcc version $octave_cv_gcc_version is likely to cause problems" OCTAVE_CONFIGURE_WARNING([warn_gcc_version])]) - GCC_VERSION=$gcc_version - AC_MSG_RESULT([$GCC_VERSION]) + GCC_VERSION=$octave_cv_gcc_version fi AC_SUBST(GCC_VERSION) @@ -487,7 +459,7 @@ dnl in case -lm is needed to compile Fortran programs. AC_CHECK_LIB(m, sin) -### Determine the Fortran compiler and how to invoke it +### Determine the Fortran compiler and how to invoke it. ## Prefer gfortran, but the user's F77 environment variable will override. AC_PROG_F77([gfortran]) @@ -511,10 +483,10 @@ AC_F77_DUMMY_MAIN AC_F77_WRAPPERS -### Must appear after checks for Fortran compiler. +## Must appear after checks for Fortran compiler. OCTAVE_CHECK_FORTRAN_SYMBOL_AND_CALLING_CONVENTIONS -### Must appear after checks for compilers. +## Must appear after checks for all compilers. OCTAVE_DEFINE_MKOCTFILE_DYNAMIC_LINK_OPTIONS ### Use a 64-bit integer type for array dimensions and indexing, if possible. @@ -568,7 +540,7 @@ AC_DEFINE_UNQUOTED(OCTAVE_IDX_TYPE, [$OCTAVE_IDX_TYPE], [Define to the type of octave_idx_type (64 or 32 bit signed integer).]) -### Check for pthread library +### Check for pthread library. AX_PTHREAD dnl Include pthread libs and flags early in case other config tests need them. @@ -586,7 +558,6 @@ AM_CONDITIONAL([OCTAVE_CHECK_BROKEN_PTHREAD_STACKSIZE], [test $octave_cv_broken_pthread_stacksize = yes]) - ### Test whether the compiler supports OpenMP. dnl This is enabled by default to allow the option of using OpenMP in dnl loadable modules. @@ -619,7 +590,7 @@ AC_DEFINE(OCTAVE_ENABLE_OPENMP, 1, [Define to 1 if OpenMP is enabled]) fi -### Start determination of shared vs. static libraries +### Start determination of shared vs. static libraries. ## Use -static if compiling on Alpha OSF/1 1.3 systems. case $canonical_host_type in @@ -670,7 +641,6 @@ AC_MSG_ERROR([You can't disable building both static AND shared libraries!]) fi - ### More configure argument checking related to linking case $host_os in @@ -683,7 +653,7 @@ esac AC_ARG_ENABLE([no-undefined], [AS_HELP_STRING([--enable-no-undefined], - [pass -no-undefined to libtool when linking Octave and its shared libraries. This is done by default for msdosmsvc, mingw*, AIX, BeOS, or OS/2 hosts.])], + [pass -no-undefined to libtool when linking Octave and its shared libraries. This is done by default for msdosmsvc, mingw*, AIX, BeOS, or OS/2 hosts.])], [case $enableval in yes) NO_UNDEFINED_LDFLAG="-no-undefined" ;; no) NO_UNDEFINED_LDFLAG="" ;; @@ -704,16 +674,13 @@ [link_all_deps=no]) AM_CONDITIONAL([AMCOND_LINK_ALL_DEPS], [test $link_all_deps = yes]) -### Check for BLAS and LAPACK libraries: +### Check for BLAS and LAPACK libraries. ## Need to adjust FFLAGS to include correct integer size. save_FFLAGS="$FFLAGS" FFLAGS="$FFLAGS $F77_INTEGER_8_FLAG" -OCTAVE_BLAS_WITH_F77_FUNC([], [], - [ax_blas_ok=yes - AC_MSG_CHECKING([BLAS can be called from Fortran]) - AC_MSG_RESULT([yes assumed for cross compilation])]) +OCTAVE_BLAS AX_LAPACK ## Restore FFLAGS. @@ -724,7 +691,7 @@ save_FFLAGS="$FFLAGS" FFLAGS="-ff2c $FFLAGS $F77_INTEGER_8_FLAG" - OCTAVE_BLAS_WITH_F77_FUNC + OCTAVE_BLAS AX_LAPACK ## Restore FFLAGS, with -ff2c if that was helpful @@ -753,7 +720,7 @@ save_FFLAGS="$FFLAGS" FFLAGS="$FFLAGS $F77_INTEGER_8_FLAG" - OCTAVE_BLAS_WITH_F77_FUNC + OCTAVE_BLAS AX_LAPACK ## Restore FFLAGS. @@ -781,7 +748,7 @@ AC_MSG_ERROR([BLAS and LAPACK libraries are required]) fi -case $ax_blas_integer_size in +case $ax_cv_blas_integer_size in 4) HAVE_64_BIT_BLAS=no ;; @@ -794,8 +761,8 @@ esac OCTAVE_CHECK_SIZEOF_FORTRAN_INTEGER -if test $octave_cv_sizeof_fortran_integer -ne $ax_blas_integer_size; then - if test $ax_blas_integer_size -eq 8; then +if test $octave_cv_sizeof_fortran_integer -ne $ax_cv_blas_integer_size; then + if test $ax_cv_blas_integer_size -eq 8; then case $F77 in *gfortran*) case $F77_INTEGER_8_FLAG in @@ -825,8 +792,8 @@ fi ## We intentionally don't attempt to fix things up if the default ## Fortran integer size is 8 but BLAS appears to use 4-byte integers. - if test $octave_cv_sizeof_fortran_integer -ne $ax_blas_integer_size; then - AC_MSG_ERROR([your Fortran compiler must have an option for setting the default integer size to be the same size as your BLAS library uses ($ax_blas_integer_size bytes). See the file INSTALL for more information.]) + if test $octave_cv_sizeof_fortran_integer -ne $ax_cv_blas_integer_size; then + AC_MSG_ERROR([your Fortran compiler must have an option for setting the default integer size to be the same size as your BLAS library uses ($ax_cv_blas_integer_size bytes). See the file INSTALL for more information.]) fi fi AC_SUBST(F77_INTEGER_8_FLAG) @@ -866,8 +833,9 @@ AM_CONDITIONAL([AMCOND_BUILD_EXTERNAL_LIBXERBLA], [test -n "$BUILD_EXTERNAL_LIBXERBLA"]) -### Dynamic linking is now enabled only if we are building shared -### libs and some API for dynamic linking has been detected. +### Set options for dynamic linking if enabled. +dnl Options set only only if we are building shared libs and some API for +dnl dynamic linking has been detected. dnl FIXME: A lot of the following duplicates the functionality of dnl code generated by the dlopen option for LT_INIT. @@ -1374,7 +1342,40 @@ #endif ]]) -### Check for the Qhull library. +### Configure Bison as push or pull parser. + +ENABLE_COMMAND_LINE_PUSH_PARSER=yes +AC_ARG_ENABLE([command-line-push-parser], + [AS_HELP_STRING([--disable-command-line-push-parser], + [don't use Bison's push parser interface in the command line REPL])], + [if test "$enableval" = no; then ENABLE_COMMAND_LINE_PUSH_PARSER=no; fi], []) +if test $ENABLE_COMMAND_LINE_PUSH_PARSER = yes; then + AC_DEFINE(OCTAVE_ENABLE_COMMAND_LINE_PUSH_PARSER, 1, + [Define to 1 to use Bison's push parser interface in the command line REPL.]) +fi + +### Configure compilation of *experimental* Virtual Machine evaluator. + +ENABLE_VM_EVALUATOR=yes +AC_ARG_ENABLE([vm-evaluator], + [AS_HELP_STRING([--disable-vm-evaluator], + [don't compile *experimental* virtual machine evaluator])], + [if test "$enableval" = no; then ENABLE_VM_EVALUATOR=no; fi], []) +if test $ENABLE_VM_EVALUATOR = yes; then + AC_DEFINE(OCTAVE_ENABLE_VM_EVALUATOR, 1, + [Define to 1 to build experimental Virtual Machine evaluator.]) +fi + +### Check for PCRE regex library. + +OCTAVE_CHECK_LIB(pcre, PCRE, + [], [pcre.h pcre/pcre.h], [pcre_compile], [], [], + [OCTAVE_CHECK_LIB_PCRE_OK([], + [AC_MSG_ERROR([PCRE library must be built with UTF support (--enable-utf)])]) + ], + [libpcre], [REQUIRED]) + +### Check for Qhull library. QHULL_CPPFLAGS= QHULL_LDFLAGS= @@ -1395,16 +1396,7 @@ AC_SUBST(QHULL_LDFLAGS) AC_SUBST(QHULL_LIBS) -### Check for PCRE regex library. - -OCTAVE_CHECK_LIB(pcre, PCRE, - [], [pcre.h pcre/pcre.h], [pcre_compile], [], [], - [OCTAVE_CHECK_LIB_PCRE_OK([], - [AC_MSG_ERROR([PCRE library must be built with UTF support (--enable-utf)])]) - ], - [libpcre], [REQUIRED]) - -### Check for RapidJSON header only library. +### Check for RapidJSON header-only library. check_for_rapidjson=yes AC_ARG_ENABLE([rapidjson], @@ -1462,18 +1454,6 @@ ## Find a termlib to use. OCTAVE_CHECK_LIB_TERMLIB -### Use push parser by default now. - -ENABLE_COMMAND_LINE_PUSH_PARSER=yes -AC_ARG_ENABLE([command-line-push-parser], - [AS_HELP_STRING([--disable-command-line-push-parser], - [don't use Bison's push parser interface in the command line REPL])], - [if test "$enableval" = no; then ENABLE_COMMAND_LINE_PUSH_PARSER=no; fi], []) -if test $ENABLE_COMMAND_LINE_PUSH_PARSER = yes; then - AC_DEFINE(OCTAVE_ENABLE_COMMAND_LINE_PUSH_PARSER, 1, - [Define to 1 to use Bison's push parser interface in the command line REPL.]) -fi - ### Check for ZLIB library. OCTAVE_CHECK_LIB(z, ZLIB, @@ -1521,7 +1501,7 @@ fi ### Check for FFTW library. -### Default to Fortran FFTPACK if it is not available. +dnl Default to Fortran FFTPACK if it is not available. ## Check for FFTW header and library. OCTAVE_CHECK_LIB(fftw3, FFTW3, @@ -1556,7 +1536,7 @@ build_fftw_threads=no fi -## Check for the multithreaded FFTW library. +## Check for multithreaded FFTW library. ## Fallback to singlethreaded if not found or disabled. if test $build_fftw_threads = yes; then OCTAVE_CHECK_FFTW_THREADS(fftw3, fftw_plan_with_nthreads) @@ -1599,7 +1579,7 @@ LIBS="$save_LIBS" CPPFLAGS="$save_CPPFLAGS" -### Checks for cURL header and library. +### Check for cURL library existence and functionality. save_CPPFLAGS="$CPPFLAGS" save_LIBS="$LIBS" @@ -1639,7 +1619,7 @@ [AC_DEFINE(HAVE_SNDFILE, 1, [Define to 1 if sndfile is available.])], [warn_sndfile="sndfile library found, but does not seem to work properly; disabling audio file I/O functions"])]) -### Check for PortAudio +### Check for PortAudio library. OCTAVE_CHECK_LIB(portaudio, PortAudio, [PortAudio library not found. The audioplayer, audiorecorder, and audiodevinfo functions will be disabled.], @@ -1647,7 +1627,7 @@ [], [don't use PortAudio library, disable audio playback and recording], [], [portaudio-2.0]) -### Check for either of Graphics/ImageMagick++ libraries. +### Check for either of GraphicsMagick++/ImageMagick++ libraries. check_magick=yes use_magick=no @@ -1726,7 +1706,7 @@ AC_SUBST(MAGICK_LDFLAGS) AC_SUBST(MAGICK_LIBS) -### Check for X11 libraries +### Check for X11 libraries. AC_PATH_X if test "$have_x" = yes; then @@ -1874,7 +1854,7 @@ AC_SUBST(DEFAULT_TERMINAL_FONT) AC_SUBST(DEFAULT_TERMINAL_FONT_SIZE) -### Check for FLTK library +### Check for FLTK library. check_fltk=yes build_fltk_graphics=no @@ -1989,7 +1969,7 @@ AC_SUBST(FLTK_LDFLAGS) AC_SUBST(FLTK_LIBS) -### Final determination of whether OpenGL graphics can be built +### Final determination of whether OpenGL graphics can be built. if test $build_qt_graphics = no && test $build_fltk_graphics = no; then opengl_graphics=no else @@ -2015,7 +1995,35 @@ AC_SUBST(GL2PS_LIBS) fi -### Check for the qrupdate library +### Use the system-wide installation of GNU FreeFont if the user requests it. +dnl By default, Octave includes its own copy of the FreeSans font which it +dnl installs in its own directory for use as a fallback default font. If this +dnl configuration option is used, then do not install our own copy of the fonts +dnl and assume they can be found in the provided system directory. +SYSTEM_FREEFONT_DIR= +AC_ARG_WITH([system-freefont], + [AS_HELP_STRING([--with-system-freefont=DIR], + [use FreeSans fonts in DIR (default: install and use internal copy)])]) +case $with_system_freefont in + no | "") + SYSTEM_FREEFONT_DIR= + ;; + yes) + AC_MSG_ERROR([directory argument required for --with-system-freefont]) + ;; + *) + SYSTEM_FREEFONT_DIR=$with_system_freefont + ;; +esac +if test -n "$SYSTEM_FREEFONT_DIR"; then + AC_MSG_NOTICE([configuring Octave to use system fonts in $SYSTEM_FREEFONT_DIR]) + AC_DEFINE_UNQUOTED([SYSTEM_FREEFONT_DIR], ["$SYSTEM_FREEFONT_DIR"], + [Define this to be the system directory containing the GNU FreeFont fonts.]) +fi +AM_CONDITIONAL([AMCOND_INSTALL_INTERNAL_FONT_FILES], + [test -z "$SYSTEM_FREEFONT_DIR"]) + +### Check for qrupdate library. dnl No need to adjust FFLAGS because only link is attempted. dnl Must supply proper LIBS, however. @@ -2069,11 +2077,11 @@ SUITESPARSECONFIG_LIBS="$SUITESPARSECONFIG_LIBS $LIB_CLOCK_GETTIME" fi -### Reset below, after all checks for SuiteSparse libraries. +## Save and restore LIBS after all checks for SuiteSparse libraries. suitesparse_save_LIBS="$LIBS" LIBS="$SUITESPARSECONFIG_LIBS $LIBS" -### Check for AMD library +### Check for AMD library. OCTAVE_CHECK_LIB(amd, AMD, [AMD library not found. This will result in some lack of functionality for sparse matrices.], @@ -2081,7 +2089,7 @@ [amd_postorder], [], [don't use AMD library, disable some sparse matrix functionality]) -### Check for CAMD library +### Check for CAMD library. OCTAVE_CHECK_LIB(camd, CAMD, [CAMD library not found. This will result in some lack of functionality for sparse matrices.], @@ -2089,7 +2097,7 @@ [camd_postorder], [], [don't use CAMD library, disable some sparse matrix functionality]) -### Check for COLAMD library +### Check for COLAMD library. OCTAVE_CHECK_LIB(colamd, COLAMD, [COLAMD library not found. This will result in some lack of functionality for sparse matrices.], @@ -2097,7 +2105,7 @@ [colamd], [], [don't use COLAMD library, disable some sparse matrix functionality]) -### Check for CCOLAMD library +### Check for CCOLAMD library. OCTAVE_CHECK_LIB(ccolamd, CCOLAMD, [CCOLAMD library not found. This will result in some lack of functionality for sparse matrices.], @@ -2106,8 +2114,8 @@ [], [don't use CCOLAMD library, disable some sparse matrix functionality]) ### Check for CHOLMOD library. -### If your cholmod library requires cblas, then you will need to configure -### with --with-cholmod="-lcholmod -lcblas". +dnl If your cholmod library requires cblas, then you will need to configure +dnl with --with-cholmod="-lcholmod -lcblas". save_LIBS="$LIBS" LIBS="$COLAMD_LDFLAGS $COLAMD_LIBS $AMD_LDFLAGS $AMD_LIBS $LAPACK_LIBS $BLAS_LIBS $FLIBS $LIBS" @@ -2118,7 +2126,7 @@ [], [don't use CHOLMOD library, disable some sparse matrix functionality]) LIBS="$save_LIBS" -### Check for SPQR library +### Check for SPQR library. save_LIBS="$LIBS" LIBS="$CHOLMOD_LIBS $LIBS" @@ -2129,7 +2137,7 @@ [C++], [don't use SPQR library, disable some sparse matrix functionality]) LIBS="$save_LIBS" -### Check for CXSparse library +### Check for CXSparse library. OCTAVE_CHECK_LIB(cxsparse, CXSparse, [CXSparse library not found. This will result in some lack of functionality for sparse matrices.], @@ -2185,7 +2193,7 @@ [klu.h suitesparse/klu.h klu/klu.h], [klu_solve], [], [don't use KLU library, disable some sparse matrix functionality]) -### SUITESPARSECONFIG_LIBS added to LIBS above. +## Restore LIBS after all suitesparse configuration tests LIBS="$suitesparse_save_LIBS" ## Collections of flags. @@ -2255,11 +2263,11 @@ LDFLAGS="$SUNDIALS_IDA_LDFLAGS $SUNDIALS_NVECSERIAL_LDFLAGS $KLU_LDFLAGS $BLAS_LDFLAGS $LDFLAGS" LIBS="$SUNDIALS_IDA_LIBS $SUNDIALS_NVECSERIAL_LIBS $KLU_LIBS $BLAS_LIBS $FLIBS $LIBS" if test -z "$warn_sundials_nvecserial" && test -z "$warn_sundials_ida"; then - dnl Any of the following tests could determine that SUNDIALS is incompatible - dnl and should be disabled. In that event, they all populate the same - dnl variable with appropriate warning messages, and further tests should be - dnl skipped if a warning message has already been generated that SUNDIALS is - dnl disabled. + dnl Any of the following tests could determine that SUNDIALS is + dnl incompatible and should be disabled. In that event, they all populate + dnl the same variable with appropriate warning messages, and further tests + dnl should be skipped if a warning message has already been generated that + dnl SUNDIALS is disabled. warn_sundials_disabled= if test -z "$warn_sundials_disabled"; then OCTAVE_CHECK_SUNDIALS_COMPATIBLE_API @@ -2281,10 +2289,10 @@ 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. +dnl FIXME: The test on the sunlinsol_klu.h header is a bit of a kluge. dnl How can we do a better job here? Do we need to disable sundials dnl any tests fail, or can we fix __ode15__.cc so that it still partially dnl works when some things are missing (for example, KLU)? @@ -2420,7 +2428,7 @@ ## Under Win32 platform, we want JAVA_HOME to be in MSYS format; that is, ## without colon and backslashes, as it is also used as path separator. ## Use quoted paths as Java may be installed in a path with whitespaces - ## (e.g. C:\Program Files\Java\...). + ## (e.g., C:\Program Files\Java\...). if test -n "$JAVA_HOME"; then JAVA_HOME=`cd "$JAVA_HOME" && pwd` fi @@ -2443,11 +2451,14 @@ fi ## Check Java version is recent enough. - AC_MSG_CHECKING([for Java version]) - java_version=[`"$JAVA" -version 2>&1 | $SED -n -e 's/^[^ ]* version[^0-9"]*"\([^"]*\)".*/\1/p'`] - AC_MSG_RESULT([$java_version]) - java_major=[`echo $java_version | $SED -e 's/^\([0-9][0-9]*\)\.\([0-9][0-9]*\)\..*$/\1/'`] - java_minor=[`echo $java_version | $SED -e 's/^\([0-9][0-9]*\)\.\([0-9][0-9]*\)\..*$/\2/'`] + AC_CACHE_CHECK([for Java version], + [octave_cv_java_version], + [octave_cv_java_version=[`"$JAVA" -version 2>&1 | $SED -n -e 's/^[^ ]* version[^0-9"]*"\([^"]*\)".*/\1/p'`] + ]) + + java_major=[`echo $octave_cv_java_version | $SED -e 's/^\([0-9][0-9]*\)\.\([0-9][0-9]*\)\..*$/\1/'`] + java_minor=[`echo $octave_cv_java_version | $SED -e 's/^\([0-9][0-9]*\)\.\([0-9][0-9]*\)\..*$/\2/'`] + if test $java_major -gt 1 || (test $java_major -eq 1 && test $java_minor -ge 5); then : # Version is OK. Do nothing. else @@ -2456,7 +2467,7 @@ fi ## At this point Win32 systems have enough configuration data. - ## We assume that all appropriate variables (e.g. INCLUDE and LIB) already + ## We assume that all appropriate variables (e.g., INCLUDE and LIB) already ## contain the required paths to compile and link against JDK. case $host_os in msdosmsvc) @@ -2494,55 +2505,59 @@ AC_MSG_CHECKING([for $jvmlib]) - if test -z "$JAVA_LDPATH"; then - ## Run Java to try and determine library path to libjvm.so. - JAVA_TMP_LDPATH=`$JAVA -classpath ${srcdir}/build-aux OctJavaQry JAVA_LDPATH` - JAVA_TMP_LDPATH=`echo $JAVA_TMP_LDPATH | $SED -e "s/${PATH_SEPARATOR}/ /g"` - for dir in $JAVA_TMP_LDPATH; do - if test -f "$dir/$jvmlib"; then - JAVA_LDPATH=$dir - break - fi - done - fi - - if test -z "$JAVA_LDPATH"; then - ## Nothing found. Try Java again using bootpath argument. - JAVA_TMP_LDPATH=`$JAVA -classpath ${srcdir}/build-aux OctJavaQry JAVA_BOOTPATH` - JAVA_TMP_LDPATH="${JAVA_TMP_LDPATH} ${JAVA_TMP_LDPATH}/client ${JAVA_TMP_LDPATH}/server" - for dir in $JAVA_TMP_LDPATH; do - if test -f "$dir/$jvmlib"; then - JAVA_LDPATH=$dir - break + AC_CACHE_VAL([octave_cv_java_ldpath],[ + if test -z "$JAVA_LDPATH"; then + ## Run Java to try and determine library path to libjvm.so. + JAVA_TMP_LDPATH=`$JAVA -classpath ${srcdir}/build-aux OctJavaQry JAVA_LDPATH` + JAVA_TMP_LDPATH=`echo $JAVA_TMP_LDPATH | $SED -e "s/${PATH_SEPARATOR}/ /g"` + for dir in $JAVA_TMP_LDPATH; do + if test -f "$dir/$jvmlib"; then + JAVA_LDPATH=$dir + break + fi + done + fi + + if test -z "$JAVA_LDPATH"; then + ## Nothing found. Try Java again using bootpath argument. + JAVA_TMP_LDPATH=`$JAVA -classpath ${srcdir}/build-aux OctJavaQry JAVA_BOOTPATH` + JAVA_TMP_LDPATH="${JAVA_TMP_LDPATH} ${JAVA_TMP_LDPATH}/client ${JAVA_TMP_LDPATH}/server" + for dir in $JAVA_TMP_LDPATH; do + if test -f "$dir/$jvmlib"; then + JAVA_LDPATH=$dir + break + fi + done + fi + + if test -z "$JAVA_LDPATH"; then + ## Java failed to find its own library path. Guess wildly. + JAVA_TMP_LDPATH=`ls -d $JAVA_HOME/jre/lib/*/client` + JAVA_TMP_LDPATH="${JAVA_TMP_LDPATH} `ls -d $JAVA_HOME/jre/lib/*/server`" + ## Add some paths that might work on Macs. + JAVA_TMP_LDPATH="${JAVA_TMP_LDPATH} ${JAVA_HOME}/../Libraries ${JAVA_HOME}/Libraries" + ## Add some paths that might work on MinGW + JAVA_TMP_LDPATH="${JAVA_TMP_LDPATH} ${JAVA_HOME}/bin/client ${JAVA_HOME}/bin/server" + for dir in $JAVA_TMP_LDPATH; do + if test -f "$dir/$jvmlib"; then + JAVA_LDPATH=$dir + break + fi + done + fi + + ## Verify value passed in option --with-java-libdir + if test -n "$JAVA_LDPATH"; then + if test -f "${JAVA_LDPATH}/$jvmlib"; then + : # libjvm found + else + JAVA_LDPATH="" fi - done - fi - - if test -z "$JAVA_LDPATH"; then - ## Java failed to find its own library path. Guess wildly. - JAVA_TMP_LDPATH=`ls -d $JAVA_HOME/jre/lib/*/client` - JAVA_TMP_LDPATH="${JAVA_TMP_LDPATH} `ls -d $JAVA_HOME/jre/lib/*/server`" - ## Add some paths that might work on Macs. - JAVA_TMP_LDPATH="${JAVA_TMP_LDPATH} ${JAVA_HOME}/../Libraries ${JAVA_HOME}/Libraries" - ## Add some paths that might work on MinGW - JAVA_TMP_LDPATH="${JAVA_TMP_LDPATH} ${JAVA_HOME}/bin/client ${JAVA_HOME}/bin/server" - for dir in $JAVA_TMP_LDPATH; do - if test -f "$dir/$jvmlib"; then - JAVA_LDPATH=$dir - break - fi - done - fi - - ## Verify value passed in option --with-java-libdir - if test -n "$JAVA_LDPATH"; then - if test -f "${JAVA_LDPATH}/$jvmlib"; then - : # libjvm found - else - JAVA_LDPATH="" fi - fi - + + octave_cv_java_ldpath=$JAVA_LDPATH + ]) + JAVA_LDPATH=$octave_cv_java_ldpath if test -z "$JAVA_LDPATH"; then AC_MSG_RESULT([not found]) warn_java="Library $jvmlib not found. Octave will not be able to call Java methods." @@ -2572,13 +2587,19 @@ esac ## Verify jni.h include file exists. - JNI_PATH=`echo $JAVA_CPPFLAGS | $SED -e 's/-I//g'` - have_jni=no - for dir in $JNI_PATH; do - if test -f "${dir}/jni.h"; then have_jni=yes; break; fi - done - if test $have_jni = yes; then - AC_MSG_RESULT([$dir]) + AC_CACHE_VAL([octave_cv_java_have_jni],[ + JNI_PATH=`echo $JAVA_CPPFLAGS | $SED -e 's/-I//g'` + octave_cv_java_have_jni=no + for dir in $JNI_PATH; do + if test -f "${dir}/jni.h"; then + octave_cv_java_have_jni=yes + octave_cv_java_jni_h_path=$dir + break + fi + done + ]) + if test $octave_cv_java_have_jni = yes; then + AC_MSG_RESULT([$octave_cv_java_jni_h_path]) else AC_MSG_RESULT([not found]) warn_java="Include file not found. Octave will not be able to call Java methods." @@ -2664,16 +2685,16 @@ install_build_logs=no AC_ARG_ENABLE([install-build-logs], [AS_HELP_STRING([--enable-install-build-logs], - [install build logs (i.e. config.log) with Octave])], + [install build logs (i.e., config.log) with Octave])], [if test "$enableval" = yes; then install_build_logs=yes; fi]) AM_CONDITIONAL([AMCOND_INSTALL_BUILD_LOGS], [test $install_build_logs = yes]) -### Determine whether libraries should be linked with visibility attributes - -ENABLE_LIB_VISIBILITY_FLAGS=no +### Determine whether libraries should be linked with visibility attributes. + +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 ;; @@ -2706,7 +2727,7 @@ AM_CONDITIONAL([AMCOND_LIB_VISIBILITY_FLAGS], [test $ENABLE_LIB_VISIBILITY_FLAGS = yes]) -### Set flags for symbol visibility +### Set flags for symbol visibility. if test $ENABLE_LIB_VISIBILITY_FLAGS = yes; then EXTERNAL_DLL_DEFS="-DEXTERNAL_DLL" @@ -2886,13 +2907,13 @@ [Define to 1 if compiler supports -Wimplicit-fallthrough warning])]) fi -### These are recommended by the gnulib bootstrap script: +### Recommendations from the gnulib bootstrap script. GNULIB_LINK_DEPS="$FREXPF_LIBM $FREXP_LIBM $GETHOSTNAME_LIB $LIBSOCKET $LIB_CLOCK_GETTIME $LIB_CRYPTO $LIB_GETLOGIN $LIB_NANOSLEEP $LIB_SELECT $LTLIBICONV $LTLIBINTL $LTLIBTHREAD $INTL_MACOSX_LIBS" -### FIXME: This is a kluge to transform $libdir/libiconv.dll.a to -liconv. -### It would probably be better to fix gnulib to not give us an absolute -### file name... +## FIXME: This is a kluge to transform $libdir/libiconv.dll.a to -liconv. +## It would probably be better to fix gnulib to not give us an absolute +## file name... case $host_os in mingw*) @@ -2910,6 +2931,8 @@ AC_SUBST(GNULIB_LINK_DEPS) +### Set variables for link dependencies and options. + BASE_LIBOCTAVE_LINK_DEPS="$CURL_LIBS $SPARSE_XLIBS $ARPACK_LIBS $QRUPDATE_LIBS $FFTW_XLIBS $LAPACK_LIBS $BLAS_LIBS $READLINE_LIBS $TERM_LIBS $LIBGLOB $PCRE_LIBS $DL_LIBS $PTHREAD_LIBS $FLIBS $LIBS" LIBOCTAVE_LINK_DEPS="$BASE_LIBOCTAVE_LINK_DEPS $GNULIB_LINK_DEPS" @@ -2998,15 +3021,16 @@ AC_SUBST(OCTAVE_GUI_LINK_OPTS) ############################################################################## -### Configuration tests done - -### Restore original compilation flags +### Configuration tests done. + +### Restore original compilation flags. CFLAGS="$original_octave_configure_CFLAGS" CXXFLAGS="$original_octave_configure_CXXFLAGS" ### 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 +3128,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 9ad55d2e1bbf -r 8340137bb190 doc/interpreter/contributors.in --- a/doc/interpreter/contributors.in Sun Aug 28 22:44:49 2022 +0200 +++ b/doc/interpreter/contributors.in Mon Aug 29 13:58:00 2022 +0200 @@ -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 9ad55d2e1bbf -r 8340137bb190 doc/interpreter/expr.txi --- a/doc/interpreter/expr.txi Sun Aug 28 22:44:49 2022 +0200 +++ b/doc/interpreter/expr.txi Mon Aug 29 13:58:00 2022 +0200 @@ -817,6 +817,8 @@ @opindex @code{'} @DOCSTRING(ctranspose) +@DOCSTRING(pagectranspose) + @opindex .\ @DOCSTRING(ldivide) @@ -850,6 +852,8 @@ @opindex @code{.'} @DOCSTRING(transpose) +@DOCSTRING(pagetranspose) + @opindex - @DOCSTRING(uminus) diff -r 9ad55d2e1bbf -r 8340137bb190 doc/interpreter/genpropdoc.m --- a/doc/interpreter/genpropdoc.m Sun Aug 28 22:44:49 2022 +0200 +++ b/doc/interpreter/genpropdoc.m Mon Aug 29 13:58:00 2022 +0200 @@ -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 9ad55d2e1bbf -r 8340137bb190 doc/interpreter/gui.txi --- a/doc/interpreter/gui.txi Sun Aug 28 22:44:49 2022 +0200 +++ b/doc/interpreter/gui.txi Mon Aug 29 13:58:00 2022 +0200 @@ -108,6 +108,8 @@ toolkit, although some functionality is available with the @code{fltk} toolkit. There is no support for the @code{gnuplot} toolkit. +@DOCSTRING(uifigure) + @DOCSTRING(uipanel) @DOCSTRING(uibuttongroup) diff -r 9ad55d2e1bbf -r 8340137bb190 doc/interpreter/matrix.txi --- a/doc/interpreter/matrix.txi Sun Aug 28 22:44:49 2022 +0200 +++ b/doc/interpreter/matrix.txi Mon Aug 29 13:58:00 2022 +0200 @@ -112,8 +112,6 @@ @DOCSTRING(circshift) -@DOCSTRING(shift) - @DOCSTRING(shiftdim) @DOCSTRING(sort) diff -r 9ad55d2e1bbf -r 8340137bb190 doc/interpreter/mk-doc-cache.pl --- a/doc/interpreter/mk-doc-cache.pl Sun Aug 28 22:44:49 2022 +0200 +++ b/doc/interpreter/mk-doc-cache.pl Mon Aug 29 13:58:00 2022 +0200 @@ -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 9ad55d2e1bbf -r 8340137bb190 doc/interpreter/sparse.txi --- a/doc/interpreter/sparse.txi Sun Aug 28 22:44:49 2022 +0200 +++ b/doc/interpreter/sparse.txi Mon Aug 29 13:58:00 2022 +0200 @@ -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 9ad55d2e1bbf -r 8340137bb190 etc/HACKING.md --- a/etc/HACKING.md Sun Aug 28 22:44:49 2022 +0200 +++ b/etc/HACKING.md Mon Aug 29 13:58:00 2022 +0200 @@ -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 9ad55d2e1bbf -r 8340137bb190 etc/NEWS.7.md diff -r 9ad55d2e1bbf -r 8340137bb190 etc/NEWS.8.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/etc/NEWS.8.md Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,127 @@ +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). + +- `filter` is now 5X faster, which also speeds up `deconv`, `fftfilt` +and `arma_rnd` by the same amount. + +- `integral` can now output a second argument passing the error +measurement used by the underlying integrator. + +- `perms` now accepts a second argument "unique" to return only unique +permutations for inputs with repeated elements. It is faster and takes +less memory to call `perms ('aaaabbbbcccc', "unique")` than to call +`unique (perms ('aaaabbbbcccc'), "rows")`. + +- `quadgk` can now accept the `ArrayValued` input parameter to handle +array-valued input functions. + +### Graphical User Interface + + +### Graphics backend + +- Additional properties have been added to the `figure` graphics object: + * `"innerposition"` (equivalent to `"position"`) + * `"windowstate"` (not yet implemented) + +### Matlab compatibility + +- `inline` functions now support all Matlab methods. The performance + of `inline` functions has also been improved. + +- `sub2ind` now supports index values outside of the size specified by + the subscripts. + +- `cylinder` now accepts a scalar for the radius argument. + +- `clock` now has an optional second output `ISDST` which indicates if + Daylight Savings Time is in effect for the system's time zone. + +- `print` now accepts option `-image` to specify the "opengl" renderer + and `-vector` to specify the "painters" renderer. + +- `format` now accepts the option "default", which is equivalent to + calling `format` without any options to reset the default state. + +- `quadgk` now stops iterating when `error <= tolerance` while the previous + condition was `error < tolerance`. + +- `var` and `std` now optionally output a second argument containing the mean + or weighted mean. + +- `integral` can now accept the 'ArrayValued' option in combination with + 'RelTol' and 'WayPoints'. + +- The default state for certain graphics properties has been made + consistent with Matlab. + + Object | Property | Default State + ------------|------------------|------------ + `figure` | `"dockcontrols"` | `"on"` + +### Alphabetical list of new functions added in Octave 8 + +* `pagectranspose` +* `pagetranspose` +* `uifigure` + +### 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` + `sparse_auto_mutate` | none (see below) + +- The `sparse_auto_mutate` function no longer has any effect on Octave's + behavior. Previously, after calling `sparse_auto_mutate (true)`, + Octave would automatically convert sparse matrices to full when a + sparse matrix required more memory than simply using full matrix + storage. This setting was `false` by default for compatibility with + Matlab. Now you must manually convert to full storage when desired. + + +- Properties + + The following property names are discouraged, but there is no fixed + date for their removal. + + Object | Property | Replacement + -----------------|-------------|------------ + `uimenu` | `label` | `text` + `uimenu` | `callback` | `menuselectedfcn` + +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 9ad55d2e1bbf -r 8340137bb190 etc/module.mk --- a/etc/module.mk Sun Aug 28 22:44:49 2022 +0200 +++ b/etc/module.mk Mon Aug 29 13:58:00 2022 +0200 @@ -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 9ad55d2e1bbf -r 8340137bb190 libgui/graphics/FigureWindow.cc --- a/libgui/graphics/FigureWindow.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libgui/graphics/FigureWindow.cc Mon Aug 29 13:58:00 2022 +0200 @@ -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 9ad55d2e1bbf -r 8340137bb190 libgui/graphics/Logger.cc --- a/libgui/graphics/Logger.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libgui/graphics/Logger.cc Mon Aug 29 13:58:00 2022 +0200 @@ -65,13 +65,13 @@ return s_instance; } -#define STATIC_LOGGER(fun) \ - void Logger::fun (const char *fmt, ...) \ +#define STATIC_LOGGER(fcn) \ + void Logger::fcn (const char *fmt, ...) \ { \ QMutexLocker lock (s_mutex); \ va_list vl; \ va_start (vl, fmt); \ - instance ()->fun ## V (fmt, vl); \ + instance ()->fcn ## V (fmt, vl); \ va_end (vl); \ } diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/graphics/Menu.cc --- a/libgui/graphics/Menu.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libgui/graphics/Menu.cc Mon Aug 29 13:58:00 2022 +0200 @@ -294,13 +294,13 @@ if (action->isCheckable ()) action->setChecked (! action->isChecked ()); - emit gh_callback_event (m_handle, "callback"); + emit gh_callback_event (m_handle, "menuselectedfcn"); } void Menu::actionHovered (void) { - emit gh_callback_event (m_handle, "callback"); + emit gh_callback_event (m_handle, "menuselectedfcn"); } void diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/graphics/ToolBarButton.cc --- a/libgui/graphics/ToolBarButton.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libgui/graphics/ToolBarButton.cc Mon Aug 29 13:58:00 2022 +0200 @@ -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 9ad55d2e1bbf -r 8340137bb190 libgui/graphics/qopengl-functions.h --- a/libgui/graphics/qopengl-functions.h Sun Aug 28 22:44:49 2022 +0200 +++ b/libgui/graphics/qopengl-functions.h Mon Aug 29 13:58:00 2022 +0200 @@ -63,9 +63,9 @@ #if defined (HAVE_QOPENGLFUNCTIONS_1_1) - void glAlphaFunc (GLenum func, GLclampf ref) + void glAlphaFunc (GLenum fcn, GLclampf ref) { - m_glfcns.glAlphaFunc (func, ref); + m_glfcns.glAlphaFunc (fcn, ref); } void glBegin (GLenum mode) @@ -150,9 +150,9 @@ m_glfcns.glDeleteTextures (n, textures); } - void glDepthFunc (GLenum func) + void glDepthFunc (GLenum fcn) { - m_glfcns.glDepthFunc (func); + m_glfcns.glDepthFunc (fcn); } void glDisable (GLenum cap) diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/qterminal/libqterminal/unix/kpty.cpp --- a/libgui/qterminal/libqterminal/unix/kpty.cpp Sun Aug 28 22:44:49 2022 +0200 +++ b/libgui/qterminal/libqterminal/unix/kpty.cpp Mon Aug 29 13:58:00 2022 +0200 @@ -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 9ad55d2e1bbf -r 8340137bb190 libgui/src/command-widget.cc --- a/libgui/src/command-widget.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libgui/src/command-widget.cc Mon Aug 29 13:58:00 2022 +0200 @@ -32,7 +32,8 @@ #include #include #include -#include +#include +#include #include #include "command-widget.h" @@ -47,44 +48,29 @@ namespace octave { - command_widget::command_widget (base_qobject&, QWidget *p) + command_widget::command_widget (base_qobject& oct_qobj, QWidget *p) : QWidget (p), m_incomplete_parse (false), - m_prompt (new QLabel ("", this)), - m_line_edit (new QLineEdit (this)), - m_output_display (new QTextBrowser (this)), - m_input_color (QColor ()) + m_prompt (QString ()), + m_console (new console (this, oct_qobj)) { QPushButton *pause_button = new QPushButton (tr("Pause"), this); QPushButton *stop_button = new QPushButton (tr("Stop"), this); QPushButton *resume_button = new QPushButton (tr("Continue"), this); - QGroupBox *input_group_box = new QGroupBox (tr("Command Input")); + QGroupBox *input_group_box = new QGroupBox (); QHBoxLayout *input_layout = new QHBoxLayout; - input_layout->addWidget (m_prompt); - input_layout->addWidget (m_line_edit); input_layout->addWidget (pause_button); input_layout->addWidget (stop_button); input_layout->addWidget (resume_button); input_group_box->setLayout (input_layout); - QGroupBox *output_group_box = new QGroupBox (tr("Command Output")); - QHBoxLayout *output_layout = new QHBoxLayout (); - output_layout->addWidget (m_output_display); - output_group_box->setLayout (output_layout); - QVBoxLayout *main_layout = new QVBoxLayout (); - main_layout->addWidget (output_group_box); + main_layout->addWidget (m_console); main_layout->addWidget (input_group_box); setLayout (main_layout); - setFocusProxy (m_line_edit); - - connect (m_line_edit, &QLineEdit::returnPressed, - this, &command_widget::accept_input_line); - - connect (this, &command_widget::clear_line_edit, - m_line_edit, &QLineEdit::clear); + setFocusProxy (m_console); connect (pause_button, &QPushButton::clicked, this, &command_widget::interpreter_pause); @@ -94,39 +80,47 @@ connect (stop_button, &QPushButton::clicked, this, &command_widget::interpreter_stop); + + connect (this, &command_widget::new_command_line_signal, + m_console, &console::new_command_line); + + insert_interpreter_output ("\n\n Welcome to Octave\n\n"); + + } + + void command_widget::init_command_prompt () + { + emit interpreter_event + ([=] (interpreter& interp) + { + // INTERPRETER THREAD + + event_manager& evmgr = interp.get_event_manager (); + input_system& input_sys = interp.get_input_system (); + std::string prompt = input_sys.PS1 (); + evmgr.update_prompt (command_editor::decode_prompt_string (prompt)); + + emit new_command_line_signal (); + }); } void command_widget::update_prompt (const QString& prompt) { - m_prompt->setText (prompt); + m_prompt = prompt; + } + + QString command_widget::prompt () + { + return m_prompt; } void command_widget::insert_interpreter_output (const QString& msg) { - QTextCursor cursor = m_output_display->textCursor (); - - cursor.insertText (msg); - - m_output_display->setTextCursor (cursor); + m_console->append (msg); } - void command_widget::accept_input_line (void) + void command_widget::process_input_line (const QString& input_line) { - QTextCursor cursor = m_output_display->textCursor (); - - QString input_line = m_line_edit->text (); - - QString style; - if (! m_incomplete_parse) - { - style = QString ("
[in]:
") - .arg (m_input_color.name ()); - m_output_display->insertHtml (style); - } - style = QString ("
%2

") - .arg (m_input_color.name ()).arg (input_line); - m_output_display->insertHtml (style); - emit interpreter_event ([=] (interpreter& interp) { @@ -142,9 +136,10 @@ = m_incomplete_parse ? input_sys.PS2 () : input_sys.PS1 (); evmgr.update_prompt (command_editor::decode_prompt_string (prompt)); + + emit new_command_line_signal (); }); - emit clear_line_edit (); } void command_widget::notice_settings (const gui_settings *settings) @@ -158,20 +153,150 @@ term_font.setPointSize (settings->value (cs_font_size).toInt ()); - m_line_edit->setFont (term_font); - m_output_display->setFont (term_font); + m_console->setFont (term_font); // Colors int mode = settings->value (cs_color_mode).toInt (); QColor fgc = settings->color_value (cs_colors[0], mode); QColor bgc = settings->color_value (cs_colors[1], mode); - m_output_display->setStyleSheet (QString ("color: %1; background-color:%2;") + m_console->setStyleSheet (QString ("color: %1; background-color:%2;") .arg (fgc.name ()).arg (bgc.name ())); - m_line_edit->setStyleSheet (QString ("color: %1; background-color:%2;") - .arg (fgc.name ()).arg (bgc.name ())); + } + + + // The console itself using QScintilla. + // This implementation is partly based on the basic concept of + // "qpconsole" as proposed by user "DerManu" in the Qt-forum thread + // https://forum.qt.io/topic/28765/command-terminal-using-qtextedit + + console::console (command_widget *p, base_qobject&) + : QsciScintilla (p), + m_command_position (-1), + m_cursor_position (0), + m_text_changed (false), + m_command_widget (p), + m_last_key_string (QString ()) + { + setMargins (0); + setWrapMode (QsciScintilla::WrapWord); + + connect (this, SIGNAL (cursorPositionChanged (int, int)), + this, SLOT (cursor_position_changed (int, int))); + + connect (this, SIGNAL (textChanged (void)), + this, SLOT (text_changed (void))); + + connect (this, SIGNAL (modificationAttempted (void)), + this, SLOT (move_cursor_to_end (void))); + } + + // Prepare a new command line with the current prompt + void console::new_command_line (const QString& command) + { + if (! text (lines () -1).isEmpty ()) + append ("\n"); + + append_string (m_command_widget->prompt ()); + + int line, index; + getCursorPosition (&line,&index); + m_command_position = positionFromLineIndex (line, index); + + append_string (command); + } + + // Accept the current command line (or block) + void console::accept_command_line () + { + QString input_line = text (lines () - 1); + + if (input_line.startsWith (m_command_widget->prompt ())) + input_line.remove(0, m_command_widget->prompt ().length ()); + + input_line = input_line.trimmed (); + + append_string ("\n"); + + if (input_line.isEmpty ()) + new_command_line (); + else + m_command_widget->process_input_line (input_line); + } + + // Execute a command + void console::execute_command (const QString& command) + { + if (command.trimmed ().isEmpty ()) + return; - m_input_color = interpolate_color (fgc, bgc, 0.75, 0.5); + new_command_line (command); + accept_command_line (); + } + + // Append a string and update the curdor püosition + void console::append_string (const QString& string) + { + setReadOnly (false); + append (string); + + int line, index; + lineIndexFromPosition (text ().length (), &line, &index); + + setCursorPosition (line, index); + } + + // Cursor position changed: Are we in the command line or not? + void console::cursor_position_changed (int line, int col) + { + m_cursor_position = positionFromLineIndex (line, col); + if (m_cursor_position < m_command_position) + { + // We are in the read only area + if (m_text_changed && (m_cursor_position == m_command_position - 1)) + { + setReadOnly (false); + insert (m_command_widget->prompt ().right (1)); // And here we have tried to remove the prompt by Backspace + setCursorPosition (line+1, col); + } + setReadOnly (true); + } + else + setReadOnly (false); // Writable area + + m_text_changed = false; + } + + // User attempted to type on read only mode: move cursor at end and allow + // editing + void console::move_cursor_to_end (void) + { + if ((! m_last_key_string.isEmpty ()) && (m_last_key_string.at (0).isPrint ())) + { + append_string (m_last_key_string); + setReadOnly (true); // Avoid that changing read only text is done afterwards + } + } + + // Text has changed: is cursor still in "writable" area? + // This signal seems to be emitted before cursor position changed. + void console::text_changed (void) + { + m_text_changed = true; + } + + // Re-implement key event + void console::keyPressEvent (QKeyEvent *e) + { + if (e->key () == Qt::Key_Return) + // On "return", accept the current command line + accept_command_line (); + else + { + // Otherwise, store text process the expected event + m_last_key_string = e->text (); + QsciScintilla::keyPressEvent(e); + } } } diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/command-widget.h --- a/libgui/src/command-widget.h Sun Aug 28 22:44:49 2022 +0200 +++ b/libgui/src/command-widget.h Mon Aug 29 13:58:00 2022 +0200 @@ -28,17 +28,55 @@ #include +#include + #include "octave-qobject.h" #include "gui-settings.h" -class QLabel; -class QLineEdit; -class QStrung; -class QTextBrowser; +class QsciScintilla; namespace octave { class base_qobject; + class command_widget; + + class console : public QsciScintilla + { + Q_OBJECT + + public: + + console (command_widget *p, base_qobject& oct_qobj); + + public slots: + + void cursor_position_changed (int line, int col); + + void text_changed (void); + + void move_cursor_to_end (void); + + void new_command_line (const QString& command = QString ()); + + void execute_command (const QString& command); + + protected: + + void keyPressEvent (QKeyEvent *e); + + private: + + void append_string (const QString& string); + + void accept_command_line (void); + + int m_command_position; + int m_cursor_position; + bool m_text_changed; + command_widget *m_command_widget; + QString m_last_key_string; + + }; class command_widget : public QWidget { @@ -48,6 +86,12 @@ command_widget (base_qobject& oct_qobj, QWidget *p); + console * get_console ( ) { return m_console; }; + + void init_command_prompt (); + + QString prompt (void); + signals: void clear_line_edit (void); @@ -59,25 +103,23 @@ void interpreter_event (const fcn_callback& fcn); void interpreter_event (const meth_callback& meth); + void new_command_line_signal (const QString& command = QString ()); + public slots: + void process_input_line (const QString& input_line); + void update_prompt (const QString& prompt); void insert_interpreter_output (const QString& msg); void notice_settings (const gui_settings *settings); - protected slots: - - void accept_input_line (void); - private: bool m_incomplete_parse; - QLabel *m_prompt; - QLineEdit *m_line_edit; - QTextBrowser *m_output_display; - QColor m_input_color; + QString m_prompt; + console *m_console; }; } diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/community-news.cc --- a/libgui/src/community-news.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libgui/src/community-news.cc Mon Aug 29 13:58:00 2022 +0200 @@ -33,6 +33,7 @@ #include "community-news.h" #include "gui-utils.h" +#include "gui-preferences-dw.h" #include "gui-preferences-nr.h" #include "news-reader.h" #include "octave-qobject.h" @@ -78,9 +79,14 @@ resource_manager& rmgr = oct_qobj.get_resource_manager (); gui_settings *settings = rmgr.get_settings (); - // FIXME: should be configurable... See also the icon for the - // release notes window. - QString icon = ":/actions/icons/logo.png"; + QString icon; + QString icon_set = settings->value (dw_icon_set).toString (); + if (icon_set != "NONE") + // No extra icon for Community news, take the one of the release notes + icon = dw_icon_set_names[icon_set] + "ReleaseWidget.png"; + else + icon = dw_icon_set_names[icon_set]; + setWindowIcon (QIcon (icon)); // FIXME: This is a news reader preference, so shouldn't it be used diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/documentation-dock-widget.cc --- a/libgui/src/documentation-dock-widget.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libgui/src/documentation-dock-widget.cc Mon Aug 29 13:58:00 2022 +0200 @@ -38,7 +38,6 @@ : octave_dock_widget ("DocumentationDockWidget", p, oct_qobj), m_docs (new documentation (this, oct_qobj)) { - setWindowIcon (QIcon (":/actions/icons/logo.png")); set_title (tr ("Documentation")); setStatusTip (tr ("See the documentation for help.")); diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/documentation.cc --- a/libgui/src/documentation.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libgui/src/documentation.cc Mon Aug 29 13:58:00 2022 +0200 @@ -96,7 +96,7 @@ m_help_engine->setProperty ("_q_readonly", QVariant::fromValue (true)); - QString tmpdir = QDir::tempPath(); + QString tmpdir = QString::fromStdString (sys::env::get_temp_directory ()); m_collection = QString::fromStdString (sys::tempnam (tmpdir.toStdString (), "oct-qhelp-")); @@ -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 9ad55d2e1bbf -r 8340137bb190 libgui/src/files-dock-widget.cc --- a/libgui/src/files-dock-widget.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libgui/src/files-dock-widget.cc Mon Aug 29 13:58:00 2022 +0200 @@ -41,6 +41,8 @@ #include #include #include +#include +#include #include #include @@ -70,10 +72,116 @@ } }; + // 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) { - setWindowIcon (QIcon (":/actions/icons/logo.png")); set_title (tr ("File Browser")); setToolTip (tr ("Browse your files")); @@ -121,7 +229,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", false, "go-up"), "", m_navigation_tool_bar); directory_up_action->setToolTip (tr ("One directory up")); m_sync_browser_directory_action @@ -146,8 +254,9 @@ popdown_menu->addAction (m_sync_octave_directory_action); popdown_button->setMenu (popdown_menu); popdown_button->setPopupMode (QToolButton::InstantPopup); - popdown_button->setDefaultAction (new QAction (rmgr.icon ("applications-system"), - "", m_navigation_tool_bar)); + popdown_button->setDefaultAction ( + new QAction (rmgr.icon ("folder-settings", false, "applications-system"), + "", m_navigation_tool_bar)); popdown_menu->addSeparator (); popdown_menu->addAction (rmgr.icon ("folder"), @@ -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 9ad55d2e1bbf -r 8340137bb190 libgui/src/files-dock-widget.h --- a/libgui/src/files-dock-widget.h Sun Aug 28 22:44:49 2022 +0200 +++ b/libgui/src/files-dock-widget.h Mon Aug 29 13:58:00 2022 +0200 @@ -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 9ad55d2e1bbf -r 8340137bb190 libgui/src/gui-preferences-dw.h --- a/libgui/src/gui-preferences-dw.h Sun Aug 28 22:44:49 2022 +0200 +++ b/libgui/src/gui-preferences-dw.h Mon Aug 29 13:58:00 2022 +0200 @@ -51,14 +51,13 @@ const gui_pref dw_icon_set ("DockWidgets/widget_icon_set", QVariant ("NONE")); -const struct { QString name; QString path; } dw_icon_set_names[] +const QHash dw_icon_set_names = { // array of possible icon sets (name, path (complete for NONE)) // the first entry here is the default! - {"NONE", ":/actions/icons/logo.png"}, - {"GRAPHIC", ":/actions/icons/graphic_logo_"}, - {"LETTER", ":/actions/icons/letter_logo_"}, - {"", ""} // end marker has empty name + {"NONE", ":/icons/octave/128x128/logo.png"}, + {"GRAPHIC", ":/icons/octave/128x128/graphic_logo_"}, + {"LETTER", ":/icons/octave/128x128/letter_logo_"} }; // The following keys have to be used with .arg (objectName ()) diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/gui-preferences-ed.h --- a/libgui/src/gui-preferences-ed.h Sun Aug 28 22:44:49 2022 +0200 +++ b/libgui/src/gui-preferences-ed.h Mon Aug 29 13:58:00 2022 +0200 @@ -199,6 +199,9 @@ const gui_pref ed_session_lines ("editor/saved_session_lines", QVariant (QStringList ())); +const gui_pref +ed_session_bookmarks ("editor/saved_session_bookmarks", QVariant (QStringList ())); + // Tabs const QStringList ed_tab_position_names (QStringList () diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/gui-preferences-global.h --- a/libgui/src/gui-preferences-global.h Sun Aug 28 22:44:49 2022 +0200 +++ b/libgui/src/gui-preferences-global.h Mon Aug 29 13:58:00 2022 +0200 @@ -84,11 +84,48 @@ 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)); + +enum +{ + EXTRA_STYLE_FUSION_DARK = 0 +} ; +const QStringList +global_extra_styles (QStringList () + << "Fusion-Dark"); + #if defined (Q_OS_MAC) // prevent native file dialogs on MAC by setting the default "false" and // setting the flag for ignoring the pref to "true" (3rd argument) diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/history-dock-widget.cc --- a/libgui/src/history-dock-widget.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libgui/src/history-dock-widget.cc Mon Aug 29 13:58:00 2022 +0200 @@ -310,7 +310,6 @@ m_filter_checkbox = new QCheckBox (); - setWindowIcon (QIcon (":/actions/icons/logo.png")); set_title (tr ("Command History")); setWidget (new QWidget ()); diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/applications-system.png Binary file libgui/src/icons/applications-system.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/applications-system.svg --- a/libgui/src/icons/applications-system.svg Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/bookmark-new.png Binary file libgui/src/icons/bookmark-new.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/bookmark-new.svg --- a/libgui/src/icons/bookmark-new.svg Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/bottom_left_corner.png Binary file libgui/src/icons/bottom_left_corner.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/bottom_right_corner.png Binary file libgui/src/icons/bottom_right_corner.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/bottom_side.png Binary file libgui/src/icons/bottom_side.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/bp-next.png Binary file libgui/src/icons/bp-next.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/bp-next.svg --- a/libgui/src/icons/bp-next.svg Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/bp-prev.png Binary file libgui/src/icons/bp-prev.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/bp-prev.svg --- a/libgui/src/icons/bp-prev.svg Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/bp-rm-all.png Binary file libgui/src/icons/bp-rm-all.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/bp-rm-all.svg --- a/libgui/src/icons/bp-rm-all.svg Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/bp-toggle.png Binary file libgui/src/icons/bp-toggle.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/bp-toggle.svg --- a/libgui/src/icons/bp-toggle.svg Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/circle.png Binary file libgui/src/icons/circle.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/circle.svg --- a/libgui/src/icons/circle.svg Sun Aug 28 22:44:49 2022 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/cross.png Binary file libgui/src/icons/cross.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/cursors/bottom_left_corner.png Binary file libgui/src/icons/cursors/bottom_left_corner.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/cursors/bottom_right_corner.png Binary file libgui/src/icons/cursors/bottom_right_corner.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/cursors/bottom_side.png Binary file libgui/src/icons/cursors/bottom_side.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/cursors/circle.png Binary file libgui/src/icons/cursors/circle.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/cursors/circle.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/cursors/circle.svg Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/cursors/cross.png Binary file libgui/src/icons/cursors/cross.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/cursors/fleur.png Binary file libgui/src/icons/cursors/fleur.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/cursors/hand2.png Binary file libgui/src/icons/cursors/hand2.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/cursors/left_side.png Binary file libgui/src/icons/cursors/left_side.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/cursors/right_side.png Binary file libgui/src/icons/cursors/right_side.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/cursors/top_left_corner.png Binary file libgui/src/icons/cursors/top_left_corner.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/cursors/top_right_corner.png Binary file libgui/src/icons/cursors/top_right_corner.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/cursors/top_side.png Binary file libgui/src/icons/cursors/top_side.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/db-cont.png Binary file libgui/src/icons/db-cont.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/db-cont.svg --- a/libgui/src/icons/db-cont.svg Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/db-step-in.png Binary file libgui/src/icons/db-step-in.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/db-step-in.svg --- a/libgui/src/icons/db-step-in.svg Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/db-step-out.png Binary file libgui/src/icons/db-step-out.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/db-step-out.svg --- a/libgui/src/icons/db-step-out.svg Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/db-step.png Binary file libgui/src/icons/db-step.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/db-step.svg --- a/libgui/src/icons/db-step.svg Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/db-stop.png Binary file libgui/src/icons/db-stop.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/db-stop.svg --- a/libgui/src/icons/db-stop.svg Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/dialog-error.png Binary file libgui/src/icons/dialog-error.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/dialog-error.svg --- a/libgui/src/icons/dialog-error.svg Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/dialog-information.png Binary file libgui/src/icons/dialog-information.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/dialog-information.svg --- a/libgui/src/icons/dialog-information.svg Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/dialog-warning.png Binary file libgui/src/icons/dialog-warning.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/dialog-warning.svg --- a/libgui/src/icons/dialog-warning.svg Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/document-new.png Binary file libgui/src/icons/document-new.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/document-new.svg --- a/libgui/src/icons/document-new.svg Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/document-open.png Binary file libgui/src/icons/document-open.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/document-open.svg --- a/libgui/src/icons/document-open.svg Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/document-print.png Binary file libgui/src/icons/document-print.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/document-print.svg --- a/libgui/src/icons/document-print.svg Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/document-save-as.png Binary file libgui/src/icons/document-save-as.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/document-save-as.svg --- a/libgui/src/icons/document-save-as.svg Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/document-save.png Binary file libgui/src/icons/document-save.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/document-save.svg --- a/libgui/src/icons/document-save.svg Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/edit-copy.png Binary file libgui/src/icons/edit-copy.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/edit-copy.svg --- a/libgui/src/icons/edit-copy.svg Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/edit-cut.png Binary file libgui/src/icons/edit-cut.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/edit-cut.svg --- a/libgui/src/icons/edit-cut.svg Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/edit-delete.png Binary file libgui/src/icons/edit-delete.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/edit-delete.svg --- a/libgui/src/icons/edit-delete.svg Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/edit-find-replace.png Binary file libgui/src/icons/edit-find-replace.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/edit-find-replace.svg --- a/libgui/src/icons/edit-find-replace.svg Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/edit-find.png Binary file libgui/src/icons/edit-find.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/edit-find.svg --- a/libgui/src/icons/edit-find.svg Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/edit-paste.png Binary file libgui/src/icons/edit-paste.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/edit-paste.svg --- a/libgui/src/icons/edit-paste.svg Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/edit-redo.png Binary file libgui/src/icons/edit-redo.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/edit-redo.svg --- a/libgui/src/icons/edit-redo.svg Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/edit-undo.png Binary file libgui/src/icons/edit-undo.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/edit-undo.svg --- a/libgui/src/icons/edit-undo.svg Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/figure-axes.png Binary file libgui/src/icons/figure-axes.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/figure-axes.svg --- a/libgui/src/icons/figure-axes.svg Sun Aug 28 22:44:49 2022 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,328 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/figure-grid.png Binary file libgui/src/icons/figure-grid.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/figure-grid.svg --- a/libgui/src/icons/figure-grid.svg Sun Aug 28 22:44:49 2022 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,357 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/figure-pan.png Binary file libgui/src/icons/figure-pan.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/figure-pan.svg --- a/libgui/src/icons/figure-pan.svg Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/figure-rotate.png Binary file libgui/src/icons/figure-rotate.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/figure-rotate.svg --- a/libgui/src/icons/figure-rotate.svg Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/figure-text.png Binary file libgui/src/icons/figure-text.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/figure-text.svg --- a/libgui/src/icons/figure-text.svg Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/figure-zoom-in.png Binary file libgui/src/icons/figure-zoom-in.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/figure-zoom-in.svg --- a/libgui/src/icons/figure-zoom-in.svg Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/figure-zoom-original.png Binary file libgui/src/icons/figure-zoom-original.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/figure-zoom-original.svg --- a/libgui/src/icons/figure-zoom-original.svg Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/figure-zoom-out.png Binary file libgui/src/icons/figure-zoom-out.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/figure-zoom-out.svg --- a/libgui/src/icons/figure-zoom-out.svg Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/fleur.png Binary file libgui/src/icons/fleur.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/folder-new.png Binary file libgui/src/icons/folder-new.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/folder-new.svg --- a/libgui/src/icons/folder-new.svg Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/folder.png Binary file libgui/src/icons/folder.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/folder.svg --- a/libgui/src/icons/folder.svg Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/go-down.png Binary file libgui/src/icons/go-down.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/go-down.svg --- a/libgui/src/icons/go-down.svg Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/go-first.png Binary file libgui/src/icons/go-first.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/go-first.svg --- a/libgui/src/icons/go-first.svg Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/go-home.png Binary file libgui/src/icons/go-home.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/go-home.svg --- a/libgui/src/icons/go-home.svg Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/go-last.png Binary file libgui/src/icons/go-last.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/go-last.svg --- a/libgui/src/icons/go-last.svg Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/go-next.png Binary file libgui/src/icons/go-next.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/go-next.svg --- a/libgui/src/icons/go-next.svg Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/go-previous.png Binary file libgui/src/icons/go-previous.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/go-previous.svg --- a/libgui/src/icons/go-previous.svg Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/go-up.png Binary file libgui/src/icons/go-up.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/go-up.svg --- a/libgui/src/icons/go-up.svg Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/graphic_logo_DocumentationDockWidget.png Binary file libgui/src/icons/graphic_logo_DocumentationDockWidget.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/graphic_logo_DocumentationDockWidget.svg --- a/libgui/src/icons/graphic_logo_DocumentationDockWidget.svg Sun Aug 28 22:44:49 2022 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,731 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/graphic_logo_Figure.png Binary file libgui/src/icons/graphic_logo_Figure.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/graphic_logo_Figure.svg --- a/libgui/src/icons/graphic_logo_Figure.svg Sun Aug 28 22:44:49 2022 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1226 +0,0 @@ - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/graphic_logo_FileEditor.png Binary file libgui/src/icons/graphic_logo_FileEditor.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/graphic_logo_FileEditor.svg --- a/libgui/src/icons/graphic_logo_FileEditor.svg Sun Aug 28 22:44:49 2022 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1060 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/graphic_logo_FilesDockWidget.png Binary file libgui/src/icons/graphic_logo_FilesDockWidget.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/graphic_logo_FilesDockWidget.svg --- a/libgui/src/icons/graphic_logo_FilesDockWidget.svg Sun Aug 28 22:44:49 2022 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1308 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/graphic_logo_HistoryDockWidget.png Binary file libgui/src/icons/graphic_logo_HistoryDockWidget.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/graphic_logo_HistoryDockWidget.svg --- a/libgui/src/icons/graphic_logo_HistoryDockWidget.svg Sun Aug 28 22:44:49 2022 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1328 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/graphic_logo_NewsDockWidget.png Binary file libgui/src/icons/graphic_logo_NewsDockWidget.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/graphic_logo_NewsDockWidget.svg --- a/libgui/src/icons/graphic_logo_NewsDockWidget.svg Sun Aug 28 22:44:49 2022 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1156 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/graphic_logo_ReleaseWidget.png Binary file libgui/src/icons/graphic_logo_ReleaseWidget.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/graphic_logo_ReleaseWidget.svg --- a/libgui/src/icons/graphic_logo_ReleaseWidget.svg Sun Aug 28 22:44:49 2022 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1156 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/graphic_logo_TerminalDockWidget.png Binary file libgui/src/icons/graphic_logo_TerminalDockWidget.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/graphic_logo_TerminalDockWidget.svg --- a/libgui/src/icons/graphic_logo_TerminalDockWidget.svg Sun Aug 28 22:44:49 2022 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1744 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/graphic_logo_VariableEditor.png Binary file libgui/src/icons/graphic_logo_VariableEditor.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/graphic_logo_VariableEditor.svg --- a/libgui/src/icons/graphic_logo_VariableEditor.svg Sun Aug 28 22:44:49 2022 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1240 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/graphic_logo_WorkspaceView.png Binary file libgui/src/icons/graphic_logo_WorkspaceView.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/graphic_logo_WorkspaceView.svg --- a/libgui/src/icons/graphic_logo_WorkspaceView.svg Sun Aug 28 22:44:49 2022 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1175 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/hand2.png Binary file libgui/src/icons/hand2.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/icons_license --- a/libgui/src/icons/icons_license Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/left_side.png Binary file libgui/src/icons/left_side.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/letter_logo_DocumentationDockWidget.png Binary file libgui/src/icons/letter_logo_DocumentationDockWidget.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/letter_logo_DocumentationDockWidget.svg --- a/libgui/src/icons/letter_logo_DocumentationDockWidget.svg Sun Aug 28 22:44:49 2022 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,363 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - D - - diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/letter_logo_FileEditor.png Binary file libgui/src/icons/letter_logo_FileEditor.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/letter_logo_FileEditor.svg --- a/libgui/src/icons/letter_logo_FileEditor.svg Sun Aug 28 22:44:49 2022 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,375 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - E - - diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/letter_logo_FilesDockWidget.png Binary file libgui/src/icons/letter_logo_FilesDockWidget.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/letter_logo_FilesDockWidget.svg --- a/libgui/src/icons/letter_logo_FilesDockWidget.svg Sun Aug 28 22:44:49 2022 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,375 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - F - - diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/letter_logo_HistoryDockWidget.png Binary file libgui/src/icons/letter_logo_HistoryDockWidget.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/letter_logo_HistoryDockWidget.svg --- a/libgui/src/icons/letter_logo_HistoryDockWidget.svg Sun Aug 28 22:44:49 2022 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,363 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - H - - diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/letter_logo_NewsDockWidget.png Binary file libgui/src/icons/letter_logo_NewsDockWidget.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/letter_logo_NewsDockWidget.svg --- a/libgui/src/icons/letter_logo_NewsDockWidget.svg Sun Aug 28 22:44:49 2022 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,363 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - N - - diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/letter_logo_ReleaseWidget.png Binary file libgui/src/icons/letter_logo_ReleaseWidget.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/letter_logo_ReleaseWidget.svg --- a/libgui/src/icons/letter_logo_ReleaseWidget.svg Sun Aug 28 22:44:49 2022 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,363 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - R - - diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/letter_logo_TerminalDockWidget.png Binary file libgui/src/icons/letter_logo_TerminalDockWidget.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/letter_logo_TerminalDockWidget.svg --- a/libgui/src/icons/letter_logo_TerminalDockWidget.svg Sun Aug 28 22:44:49 2022 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,363 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - C - - diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/letter_logo_VariableEditor.png Binary file libgui/src/icons/letter_logo_VariableEditor.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/letter_logo_VariableEditor.svg --- a/libgui/src/icons/letter_logo_VariableEditor.svg Sun Aug 28 22:44:49 2022 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,332 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - V - - diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/letter_logo_WorkspaceView.png Binary file libgui/src/icons/letter_logo_WorkspaceView.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/letter_logo_WorkspaceView.svg --- a/libgui/src/icons/letter_logo_WorkspaceView.svg Sun Aug 28 22:44:49 2022 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,375 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - W - - diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/license.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/license.md Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,137 @@ +# 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 excusively used by octave are created by the +Octave developers using elements of the tango icon theme: + +- bp-next +- bp-prev +- bp-rm_all +- bp-toggle +- db-cont +- db-step-in +- db-step-out +- db-step +- db-stop +- system-run + + +## Icons by Octave developers + +The icons in the directory **octave** are created by the Octave developers. + +### Icons by Luís Eduardo Ribeiro Guerra + +The icons are maintained in this +[repository on github](https://github.com/luisrguerra/cc0-fluent-icons) +under the CC0 1.0 Universal license. + +- applications-system +- bookmark-new +- bp-next +- bp-prev +- bp-rm-all +- bp-toggle +- db-cont +- db-step-in +- db-step-out +- db-step +- db-stop +- dialog-error +- dialog-information +- document-new +- document-open +- document-print +- document-save-as +- document-save +- edit-copy +- edit-cut +- edit-find-replace +- edit-find +- edit-paste +- edit-redo +- edit-undo +- folder-new +- figure-axes +- figure-grid +- figure-pan +- figure-rotate +- figure-text +- figure-zoom-in +- figure-zoom-original +- figure-zoom-out +- folder-settings +- folder-up +- folder +- go-down +- go-first +- go-home +- go-last +- go-next +- go-previous +- go-up +- system-run +- user-home +- view-zoom-in +- view-zoom-out +- view-zoom-original + +### Icons containing elements from the Tango theme + +- graphic_logo_DocumentationDockWidget +- graphic_logo_Figure +- graphic_logo_FileEditor +- graphic_logo_FilesDockWidget +- graphic_logo_HistoryDockWidget +- graphic_logo_NewsDockWidget +- graphic_logo_ReleaseWidget +- graphic_logo_TerminalDockWidget +- graphic_logo_WorkspaceView +- letter_logo_DocumentationDockWidget +- letter_logo_FileEditor +- letter_logo_FilesDockWidget +- letter_logo_HistoryDockWidget +- letter_logo_NewsDockWidget +- letter_logo_ReleaseWidget +- letter_logo_TerminalDockWidget +- letter_logo_WorkspaceView +- plot-xy-curve + +### Icons created independently + +- logo +- widget-close +- widget-dock +- widget-undock + + +## 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 +- bottom_right_corner +- bottom_side +- cross +- fleur +- hand2 +- left_side +- right_side +- top_left_corner +- top_right_corner +- top_side + +## Cursor created by the Octave developers + +The following cursors are created by the Octave developers with elements from the DMZ theme: + +- circle diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/logo.png Binary file libgui/src/icons/logo.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/applications-system.png Binary file libgui/src/icons/octave/128x128/applications-system.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/bookmark-new.png Binary file libgui/src/icons/octave/128x128/bookmark-new.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/bp-next.png Binary file libgui/src/icons/octave/128x128/bp-next.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/bp-prev.png Binary file libgui/src/icons/octave/128x128/bp-prev.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/bp-rm-all.png Binary file libgui/src/icons/octave/128x128/bp-rm-all.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/bp-toggle.png Binary file libgui/src/icons/octave/128x128/bp-toggle.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/db-cont.png Binary file libgui/src/icons/octave/128x128/db-cont.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/db-step-in.png Binary file libgui/src/icons/octave/128x128/db-step-in.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/db-step-out.png Binary file libgui/src/icons/octave/128x128/db-step-out.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/db-step.png Binary file libgui/src/icons/octave/128x128/db-step.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/db-stop.png Binary file libgui/src/icons/octave/128x128/db-stop.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/dialog-error.png Binary file libgui/src/icons/octave/128x128/dialog-error.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/dialog-information.png Binary file libgui/src/icons/octave/128x128/dialog-information.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/document-new.png Binary file libgui/src/icons/octave/128x128/document-new.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/document-open.png Binary file libgui/src/icons/octave/128x128/document-open.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/document-print.png Binary file libgui/src/icons/octave/128x128/document-print.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/document-save-as.png Binary file libgui/src/icons/octave/128x128/document-save-as.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/document-save.png Binary file libgui/src/icons/octave/128x128/document-save.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/edit-copy.png Binary file libgui/src/icons/octave/128x128/edit-copy.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/edit-cut.png Binary file libgui/src/icons/octave/128x128/edit-cut.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/edit-find-replace.png Binary file libgui/src/icons/octave/128x128/edit-find-replace.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/edit-find.png Binary file libgui/src/icons/octave/128x128/edit-find.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/edit-paste.png Binary file libgui/src/icons/octave/128x128/edit-paste.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/edit-redo.png Binary file libgui/src/icons/octave/128x128/edit-redo.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/edit-undo.png Binary file libgui/src/icons/octave/128x128/edit-undo.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/figure-axes.png Binary file libgui/src/icons/octave/128x128/figure-axes.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/figure-grid.png Binary file libgui/src/icons/octave/128x128/figure-grid.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/figure-pan.png Binary file libgui/src/icons/octave/128x128/figure-pan.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/figure-rotate.png Binary file libgui/src/icons/octave/128x128/figure-rotate.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/figure-text.png Binary file libgui/src/icons/octave/128x128/figure-text.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/figure-zoom-in.png Binary file libgui/src/icons/octave/128x128/figure-zoom-in.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/figure-zoom-original.png Binary file libgui/src/icons/octave/128x128/figure-zoom-original.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/figure-zoom-out.png Binary file libgui/src/icons/octave/128x128/figure-zoom-out.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/folder-new.png Binary file libgui/src/icons/octave/128x128/folder-new.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/folder-settings.png Binary file libgui/src/icons/octave/128x128/folder-settings.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/folder-up.png Binary file libgui/src/icons/octave/128x128/folder-up.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/folder.png Binary file libgui/src/icons/octave/128x128/folder.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/go-down.png Binary file libgui/src/icons/octave/128x128/go-down.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/go-first.png Binary file libgui/src/icons/octave/128x128/go-first.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/go-home.png Binary file libgui/src/icons/octave/128x128/go-home.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/go-last.png Binary file libgui/src/icons/octave/128x128/go-last.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/go-next.png Binary file libgui/src/icons/octave/128x128/go-next.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/go-previous.png Binary file libgui/src/icons/octave/128x128/go-previous.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/go-up.png Binary file libgui/src/icons/octave/128x128/go-up.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/graphic_logo_DocumentationDockWidget.png Binary file libgui/src/icons/octave/128x128/graphic_logo_DocumentationDockWidget.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/graphic_logo_Figure.png Binary file libgui/src/icons/octave/128x128/graphic_logo_Figure.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/graphic_logo_FileEditor.png Binary file libgui/src/icons/octave/128x128/graphic_logo_FileEditor.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/graphic_logo_FilesDockWidget.png Binary file libgui/src/icons/octave/128x128/graphic_logo_FilesDockWidget.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/graphic_logo_HistoryDockWidget.png Binary file libgui/src/icons/octave/128x128/graphic_logo_HistoryDockWidget.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/graphic_logo_NewsDockWidget.png Binary file libgui/src/icons/octave/128x128/graphic_logo_NewsDockWidget.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/graphic_logo_ReleaseWidget.png Binary file libgui/src/icons/octave/128x128/graphic_logo_ReleaseWidget.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/graphic_logo_TerminalDockWidget.png Binary file libgui/src/icons/octave/128x128/graphic_logo_TerminalDockWidget.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/graphic_logo_VariableEditor.png Binary file libgui/src/icons/octave/128x128/graphic_logo_VariableEditor.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/graphic_logo_WorkspaceView.png Binary file libgui/src/icons/octave/128x128/graphic_logo_WorkspaceView.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/letter_logo_DocumentationDockWidget.png Binary file libgui/src/icons/octave/128x128/letter_logo_DocumentationDockWidget.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/letter_logo_FileEditor.png Binary file libgui/src/icons/octave/128x128/letter_logo_FileEditor.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/letter_logo_FilesDockWidget.png Binary file libgui/src/icons/octave/128x128/letter_logo_FilesDockWidget.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/letter_logo_HistoryDockWidget.png Binary file libgui/src/icons/octave/128x128/letter_logo_HistoryDockWidget.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/letter_logo_NewsDockWidget.png Binary file libgui/src/icons/octave/128x128/letter_logo_NewsDockWidget.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/letter_logo_ReleaseWidget.png Binary file libgui/src/icons/octave/128x128/letter_logo_ReleaseWidget.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/letter_logo_TerminalDockWidget.png Binary file libgui/src/icons/octave/128x128/letter_logo_TerminalDockWidget.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/letter_logo_VariableEditor.png Binary file libgui/src/icons/octave/128x128/letter_logo_VariableEditor.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/letter_logo_WorkspaceView.png Binary file libgui/src/icons/octave/128x128/letter_logo_WorkspaceView.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/logo.png Binary file libgui/src/icons/octave/128x128/logo.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/plot-xy-curve.png Binary file libgui/src/icons/octave/128x128/plot-xy-curve.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/system-run.png Binary file libgui/src/icons/octave/128x128/system-run.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/user-home.png Binary file libgui/src/icons/octave/128x128/user-home.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/view-zoom-in.png Binary file libgui/src/icons/octave/128x128/view-zoom-in.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/view-zoom-original.png Binary file libgui/src/icons/octave/128x128/view-zoom-original.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/view-zoom-out.png Binary file libgui/src/icons/octave/128x128/view-zoom-out.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/widget-close-light.png Binary file libgui/src/icons/octave/128x128/widget-close-light.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/widget-close.png Binary file libgui/src/icons/octave/128x128/widget-close.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/widget-dock-light.png Binary file libgui/src/icons/octave/128x128/widget-dock-light.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/widget-dock.png Binary file libgui/src/icons/octave/128x128/widget-dock.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/widget-undock-light.png Binary file libgui/src/icons/octave/128x128/widget-undock-light.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/128x128/widget-undock.png Binary file libgui/src/icons/octave/128x128/widget-undock.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/index.theme --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/index.theme Mon Aug 29 13:58:00 2022 +0200 @@ -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 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/scalable/dialog-information.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/dialog-information.svg Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/scalable/folder-settings.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/folder-settings.svg Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/scalable/go-home.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/go-home.svg Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,731 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1226 @@ + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1060 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1308 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1328 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1156 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1156 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1744 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1240 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1175 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,363 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + D + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,375 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + E + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,375 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + F + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,363 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + H + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,363 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + N + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,363 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + R + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,363 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + C + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,332 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + V + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,375 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + W + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/scalable/view-zoom-in.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/view-zoom-in.svg Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/scalable/view-zoom-original.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/view-zoom-original.svg Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/octave/scalable/view-zoom-out.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/octave/scalable/view-zoom-out.svg Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,78 @@ + + + + + + + + + image/svg+xml + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,78 @@ + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1 @@ + \ No newline at end of file diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/plot-xy-curve.png Binary file libgui/src/icons/plot-xy-curve.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/plot-xy-curve.svg --- a/libgui/src/icons/plot-xy-curve.svg Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/preferences-system.png Binary file libgui/src/icons/preferences-system.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/preferences-system.svg --- a/libgui/src/icons/preferences-system.svg Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/right_side.png Binary file libgui/src/icons/right_side.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/system-run.png Binary file libgui/src/icons/system-run.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/system-run.svg --- a/libgui/src/icons/system-run.svg Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/tango/128x128/applications-system.png Binary file libgui/src/icons/tango/128x128/applications-system.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/tango/128x128/bookmark-new.png Binary file libgui/src/icons/tango/128x128/bookmark-new.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/tango/128x128/bp-next.png Binary file libgui/src/icons/tango/128x128/bp-next.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/tango/128x128/bp-prev.png Binary file libgui/src/icons/tango/128x128/bp-prev.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/tango/128x128/bp-rm-all.png Binary file libgui/src/icons/tango/128x128/bp-rm-all.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/tango/128x128/bp-toggle.png Binary file libgui/src/icons/tango/128x128/bp-toggle.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/tango/128x128/db-cont.png Binary file libgui/src/icons/tango/128x128/db-cont.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/tango/128x128/db-step-in.png Binary file libgui/src/icons/tango/128x128/db-step-in.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/tango/128x128/db-step-out.png Binary file libgui/src/icons/tango/128x128/db-step-out.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/tango/128x128/db-step.png Binary file libgui/src/icons/tango/128x128/db-step.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/tango/128x128/db-stop.png Binary file libgui/src/icons/tango/128x128/db-stop.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/tango/128x128/dialog-error.png Binary file libgui/src/icons/tango/128x128/dialog-error.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/tango/128x128/dialog-information.png Binary file libgui/src/icons/tango/128x128/dialog-information.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/tango/128x128/dialog-warning.png Binary file libgui/src/icons/tango/128x128/dialog-warning.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/tango/128x128/document-new.png Binary file libgui/src/icons/tango/128x128/document-new.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/tango/128x128/document-open.png Binary file libgui/src/icons/tango/128x128/document-open.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/tango/128x128/document-print.png Binary file libgui/src/icons/tango/128x128/document-print.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/tango/128x128/document-save-as.png Binary file libgui/src/icons/tango/128x128/document-save-as.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/tango/128x128/document-save.png Binary file libgui/src/icons/tango/128x128/document-save.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/tango/128x128/edit-copy.png Binary file libgui/src/icons/tango/128x128/edit-copy.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/tango/128x128/edit-cut.png Binary file libgui/src/icons/tango/128x128/edit-cut.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/tango/128x128/edit-delete.png Binary file libgui/src/icons/tango/128x128/edit-delete.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/tango/128x128/edit-find-replace.png Binary file libgui/src/icons/tango/128x128/edit-find-replace.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/tango/128x128/edit-find.png Binary file libgui/src/icons/tango/128x128/edit-find.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/tango/128x128/edit-paste.png Binary file libgui/src/icons/tango/128x128/edit-paste.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/tango/128x128/edit-redo.png Binary file libgui/src/icons/tango/128x128/edit-redo.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/tango/128x128/edit-undo.png Binary file libgui/src/icons/tango/128x128/edit-undo.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/tango/128x128/folder-new.png Binary file libgui/src/icons/tango/128x128/folder-new.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/tango/128x128/folder.png Binary file libgui/src/icons/tango/128x128/folder.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/tango/128x128/go-down.png Binary file libgui/src/icons/tango/128x128/go-down.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/tango/128x128/go-first.png Binary file libgui/src/icons/tango/128x128/go-first.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/tango/128x128/go-home.png Binary file libgui/src/icons/tango/128x128/go-home.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/tango/128x128/go-last.png Binary file libgui/src/icons/tango/128x128/go-last.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/tango/128x128/go-next.png Binary file libgui/src/icons/tango/128x128/go-next.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/tango/128x128/go-previous.png Binary file libgui/src/icons/tango/128x128/go-previous.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/tango/128x128/go-up.png Binary file libgui/src/icons/tango/128x128/go-up.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/tango/128x128/preferences-system.png Binary file libgui/src/icons/tango/128x128/preferences-system.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/tango/128x128/user-home.png Binary file libgui/src/icons/tango/128x128/user-home.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/tango/128x128/view-refresh.png Binary file libgui/src/icons/tango/128x128/view-refresh.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/tango/128x128/view-zoom-in.png Binary file libgui/src/icons/tango/128x128/view-zoom-in.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/tango/128x128/view-zoom-original.png Binary file libgui/src/icons/tango/128x128/view-zoom-original.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/tango/128x128/view-zoom-out.png Binary file libgui/src/icons/tango/128x128/view-zoom-out.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/tango/index.theme --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgui/src/icons/tango/index.theme Mon Aug 29 13:58:00 2022 +0200 @@ -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 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,247 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + System Applications + + + Jakub Steiner + + + http://jimmac.musichall.cz/ + + + system + applications + group + category + admin + root + + + + + + + + + + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,672 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + New Bookmark + + + bookmark + remember + favorite + + + + + + Andreas Nilsson + + + + + + Jakub Steiner + + + create bookmark action + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1072 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + Lapo Calamandrei + + + + + + media + player + record + music + sound + video + + + + + + + + + + + + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + Lapo Calamandrei + + + + + + media + player + record + music + sound + video + + + + + + + + + + + + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1243 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + Lapo Calamandrei + + + + + + media + player + record + music + sound + video + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,948 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + Lapo Calamandrei + + + + + + media + player + record + music + sound + video + + + + + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1162 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + Jakub Steiner + + + http://jimmac.musichall.cz/ + + + system + applications + group + category + admin + root + + + + + + + + + + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1185 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + Lapo Calamandrei + + + + + + media + stop + playback + video + music + + + + + Jakub Steiner + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1190 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + Lapo Calamandrei + + + + + + media + stop + playback + video + music + + + + + Jakub Steiner + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1197 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + Lapo Calamandrei + + + + + + media + stop + playback + video + music + + + + + Jakub Steiner + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,677 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + Lapo Calamandrei + + + + + + media + stop + playback + video + music + + + + + Jakub Steiner + + + + + + + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,330 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + Rodney Dawes + + + + + Jakub Steiner, Garrett LeSage + + + + Dialog Error + + + + + + + + + + + + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,1159 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Info + + + Jakub Steiner + + + + + dialog + info + + + http://jimmac.musichall.cz + + + + Garrett LeSage + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,373 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Dialog Warning + 2005-10-14 + + + Andreas Nilsson + + + + + Jakub Steiner, Garrett LeSage + + + + + dialog + warning + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,448 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + New Document + + + Jakub Steiner + + + http://jimmac.musichall.cz + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -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 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -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 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,663 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Save As + + + Jakub Steiner + + + + + hdd + hard drive + save as + io + store + + + + + http://jimmac.musichall.cz + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,619 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Save + + + Jakub Steiner + + + + + hdd + hard drive + save + io + store + + + + + http://jimmac.musichall.cz + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,328 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Edit Copy + 2005-10-15 + + + Andreas Nilsson + + + + + edit + copy + + + + + + Jakub Steiner + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,508 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Edit Cut + + + Garrett Le Sage + + + + + edit + cut + clipboard + + + + + + Jakub Steiner + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Delete + 2005-12-28 + + + Andreas Nilsson + + + http://tango-project.org + + + delete + remove + + + + + + + + + + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,974 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Edit Find Replace + + + edit + find + locate + search + + + + + + Garrett LeSage + + + + + + Jakub Steiner, Steven Garrity + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,750 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Edit Find + + + edit + find + locate + search + + + + + + Steven Garrity + + + + + + Jakub Steiner + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,531 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Edit Paste + 2005-10-10 + + + Andreas Nilsson + + + + + edit + paste + + + + + + Jakub Steiner + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,231 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + Jakub Steiner + + + http://jimmac.musichall.cz + + Edit Redo + + + edit + redo + again + reapply + + + + + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,230 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + Jakub Steiner + + + http://jimmac.musichall.cz + + Edit Undo + + + edit + undo + revert + + + + + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,452 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + New Folder + + + + Jakub Steiner + + + + http://jimmac.musichall.cz + + + folder + directory + create + new + + + + + Tuomas Kuosmanen + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,424 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Folder Icon + + + + Jakub Steiner + + + + http://jimmac.musichall.cz + + + folder + directory + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,200 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + Jakub Steiner + + + http://jimmac.musichall.cz + + Go Down + + + go + lower + down + arrow + pointer + > + + + + + Andreas Nilsson + + + + + + + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,204 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + Jakub Steiner + + + http://jimmac.musichall.cz + + Go Previous + + + go + previous + left + arrow + pointer + < + + + + + Andreas Nilsson + + + + + + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,445 @@ + +image/svg+xmlGo HomeJakub Steinerhttp://jimmac.musichall.czhomereturngodefaultuserdirectoryTuomas Kuosmanen + + + + + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,204 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + Jakub Steiner + + + http://jimmac.musichall.cz + + Go Next + + + go + next + right + arrow + pointer + > + + + + + Andreas Nilsson + + + + + + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,192 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + Jakub Steiner + + + http://jimmac.musichall.cz + + Go Next + + + go + next + right + arrow + pointer + > + + + + + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,854 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + Jakub Steiner + + + http://jimmac.musichall.cz + + Go Previous + + + go + previous + left + arrow + pointer + < + + + + + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + Jakub Steiner + + + http://jimmac.musichall.cz + + Go Up + + + go + higher + up + arrow + pointer + > + + + + + Andreas Nilsson + + + + + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,398 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + Jakub Steiner + + + http://jimmac.musichall.cz + + Preferences System + + + preferences + settings + control panel + tweaks + system + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,529 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Home Folder Icon + + + + Jakub Steiner + + + + http://jimmac.musichall.cz + + + folder + directory + home + user + + + + + Garrett LeSage + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,393 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + Jakub Steiner + + + http://jimmac.musichall.cz + + View Refresh + + + reload + refresh + view + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,436 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Add + 2006-01-04 + + + Andreas Nilsson + + + http://tango-project.org + + + add + plus + + + + + + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,371 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + 2006-01-04 + + + Andreas Nilsson + + + http://tango-project.org + + + add + plus + + + + + + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 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 Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,424 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Remove + 2006-01-04 + + + Andreas Nilsson + + + http://tango-project.org + + + remove + delete + + + + + + + + + + + + + + + + + diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/top_left_corner.png Binary file libgui/src/icons/top_left_corner.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/top_right_corner.png Binary file libgui/src/icons/top_right_corner.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/top_side.png Binary file libgui/src/icons/top_side.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/user-home.png Binary file libgui/src/icons/user-home.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/user-home.svg --- a/libgui/src/icons/user-home.svg Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/view-refresh.png Binary file libgui/src/icons/view-refresh.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/view-refresh.svg --- a/libgui/src/icons/view-refresh.svg Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/widget-close-light.png Binary file libgui/src/icons/widget-close-light.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/widget-close-light.svg --- a/libgui/src/icons/widget-close-light.svg Sun Aug 28 22:44:49 2022 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ - - - - - - - - - - - image/svg+xml - - - - - - - - - diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/widget-close.png Binary file libgui/src/icons/widget-close.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/widget-close.svg --- a/libgui/src/icons/widget-close.svg Sun Aug 28 22:44:49 2022 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ - - - - - - - - - - - image/svg+xml - - - - - - - - - diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/widget-dock-light.png Binary file libgui/src/icons/widget-dock-light.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/widget-dock-light.svg --- a/libgui/src/icons/widget-dock-light.svg Sun Aug 28 22:44:49 2022 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,95 +0,0 @@ - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/widget-dock.png Binary file libgui/src/icons/widget-dock.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/widget-dock.svg --- a/libgui/src/icons/widget-dock.svg Sun Aug 28 22:44:49 2022 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,95 +0,0 @@ - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/widget-undock-light.png Binary file libgui/src/icons/widget-undock-light.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/widget-undock-light.svg --- a/libgui/src/icons/widget-undock-light.svg Sun Aug 28 22:44:49 2022 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,92 +0,0 @@ - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/widget-undock.png Binary file libgui/src/icons/widget-undock.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/widget-undock.svg --- a/libgui/src/icons/widget-undock.svg Sun Aug 28 22:44:49 2022 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,104 +0,0 @@ - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/zoom-in.png Binary file libgui/src/icons/zoom-in.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/zoom-in.svg --- a/libgui/src/icons/zoom-in.svg Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/zoom-original.png Binary file libgui/src/icons/zoom-original.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/zoom-original.svg --- a/libgui/src/icons/zoom-original.svg Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/zoom-out.png Binary file libgui/src/icons/zoom-out.png has changed diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/icons/zoom-out.svg --- a/libgui/src/icons/zoom-out.svg Sun Aug 28 22:44:49 2022 +0200 +++ /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 9ad55d2e1bbf -r 8340137bb190 libgui/src/m-editor/file-editor-interface.h --- a/libgui/src/m-editor/file-editor-interface.h Sun Aug 28 22:44:49 2022 +0200 +++ b/libgui/src/m-editor/file-editor-interface.h Mon Aug 29 13:58:00 2022 +0200 @@ -98,7 +98,8 @@ bool breakpoint_marker = false, bool insert = true, const QString& cond = "", - int index = -1) = 0; + int index = -1, + const QString& bookmarks = QString ()) = 0; }; } diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/m-editor/file-editor-tab.cc --- a/libgui/src/m-editor/file-editor-tab.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libgui/src/m-editor/file-editor-tab.cc Mon Aug 29 13:58:00 2022 +0200 @@ -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 @@ -1122,6 +1134,27 @@ m_edit_area->setCursorPosition (prevline, 0); } + + QString file_editor_tab::get_all_bookmarks () + { + QString bmlist; + int line = 0; + + while (line > -1) + { + line = m_edit_area->markerFindNext (line, (1 << marker::bookmark)); + if (line > -1) + { + if (! bmlist.isEmpty ()) + bmlist += ","; + bmlist += QString::number (line); + line++; // search from next line, otherwise same line found again + } + } + + return bmlist; + } + void file_editor_tab::remove_bookmark (const QWidget *ID) { if (ID != this) @@ -1844,9 +1877,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 +2215,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 (); @@ -2207,7 +2239,7 @@ // open the file for writing (use QIODevice::ReadWrite for avoiding // truncating the previous file contents) - if (! file.open (QIODevice::ReadWrite)) + if (! file.open (QIODevice::WriteOnly)) { // Unsuccessful, begin watching file again if it was being // watched previously. @@ -2248,37 +2280,47 @@ out.flush (); QApplication::restoreOverrideCursor (); - file.resize (file.pos()); - 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 9ad55d2e1bbf -r 8340137bb190 libgui/src/m-editor/file-editor-tab.h --- a/libgui/src/m-editor/file-editor-tab.h Sun Aug 28 22:44:49 2022 +0200 +++ b/libgui/src/m-editor/file-editor-tab.h Mon Aug 29 13:58:00 2022 +0200 @@ -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: @@ -275,8 +276,12 @@ void update_lexer (void); void show_dialog (QDialog *dlg, bool modal); + public: + int check_file_modified (bool remove = false); + QString get_all_bookmarks (void); + private: void do_comment_selected_text (bool comment, bool input_str = false); void do_indent_selected_text (bool indent); diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/m-editor/file-editor.cc --- a/libgui/src/m-editor/file-editor.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libgui/src/m-editor/file-editor.cc Mon Aug 29 13:58:00 2022 +0200 @@ -337,12 +337,16 @@ QStringList session_lines = settings->value (ed_session_lines).toStringList (); + QStringList session_bookmarks + = settings->value (ed_session_bookmarks).toStringList (); + // fill a list of the struct and sort it (depending on index) QList s_data; bool do_encoding = (session_encodings.count () == sessionFileNames.count ()); bool do_index = (session_index.count () == sessionFileNames.count ()); bool do_lines = (session_lines.count () == sessionFileNames.count ()); + bool do_bookmarks = (session_bookmarks.count () == sessionFileNames.count ()); for (int n = 0; n < sessionFileNames.count (); ++n) { @@ -351,13 +355,15 @@ continue; session_data item = { 0, -1, sessionFileNames.at (n), - QString (), QString ()}; + QString (), QString (), QString ()}; if (do_lines) item.line = session_lines.at (n).toInt (); if (do_index) item.index = session_index.at (n).toInt (); if (do_encoding) item.encoding = session_encodings.at (n); + if (do_bookmarks) + item.bookmarks = session_bookmarks.at (n); s_data << item; } @@ -367,7 +373,8 @@ // finally open the files with the desired encoding in the desired order for (int n = 0; n < s_data.count (); ++n) request_open_file (s_data.at (n).file_name, s_data.at (n).encoding, - s_data.at (n).line); + s_data.at (n).line, false, false, true, "", -1, + s_data.at (n).bookmarks); } void file_editor::activate (void) @@ -440,6 +447,7 @@ QStringList fet_encodings; QStringList fet_index; QStringList fet_lines; + QStringList fet_bookmarks; std::list editor_tab_lst = m_tab_widget->tab_list (); @@ -460,6 +468,8 @@ int l, c; editor_tab->qsci_edit_area ()->getCursorPosition (&l, &c); fet_lines.append (index.setNum (l + 1)); + + fet_bookmarks.append (editor_tab->get_all_bookmarks ()); } } @@ -467,6 +477,7 @@ settings->setValue (ed_session_enc.key, fet_encodings); settings->setValue (ed_session_ind.key, fet_index); settings->setValue (ed_session_lines.key, fet_lines); + settings->setValue (ed_session_bookmarks.key, fet_bookmarks); settings->sync (); } @@ -676,6 +687,11 @@ { // INTERPRETER THREAD + // Act as though this action was entered at the command propmt + // so that the interpreter will check for updated file time + // stamps. + Vlast_prompt_time.stamp (); + tree_evaluator& tw = interp.get_evaluator (); if (tw.in_debug_repl ()) @@ -1167,7 +1183,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 +1217,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 +1245,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); } } @@ -1329,10 +1332,13 @@ // in several Qt versions (https://bugreports.qt.io/browse/QTBUG-61092) if (! rotated) { + QString icon = global_icon_paths.at (ICON_THEME_OCTAVE) + "widget-close.png"; + QString close_button_css_mac ( "QTabBar::close-button" - " { width: 6px; image: url(:/actions/icons/widget-close.png);" - " subcontrol-position: button; }\n" + " { image: url(" + icon + ");" + " padding: 4px;" + " subcontrol-position: bottom; }\n" "QTabBar::close-button:hover" " { background-color: #cccccc; }"); @@ -1540,7 +1546,8 @@ const QString& encoding, int line, bool debug_pointer, bool breakpoint_marker, bool insert, - const QString& cond, int index) + const QString& cond, int index, + const QString& bookmarks) { resource_manager& rmgr = m_octave_qobj.get_resource_manager (); gui_settings *settings = rmgr.get_settings (); @@ -1716,6 +1723,17 @@ } } + if (! bookmarks.isEmpty ()) + { + // Restore bookmarks + for (const auto& bms : bookmarks.split (',')) + { + int bm = bms.toInt (); + if (fileEditorTab) + fileEditorTab->qsci_edit_area ()->markerAdd (bm, marker::bookmark); + } + } + if (! ((breakpoint_marker || debug_pointer) && is_editor_console_tabbed ())) { // update breakpoint pointers, really show editor @@ -2215,15 +2233,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 (); @@ -2379,7 +2398,6 @@ this, &file_editor::active_tab_changed); resize (500, 400); - setWindowIcon (QIcon (":/actions/icons/logo.png")); set_title (tr ("Editor")); check_actions (); @@ -2704,7 +2722,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 +2749,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 9ad55d2e1bbf -r 8340137bb190 libgui/src/m-editor/file-editor.h --- a/libgui/src/m-editor/file-editor.h Sun Aug 28 22:44:49 2022 +0200 +++ b/libgui/src/m-editor/file-editor.h Mon Aug 29 13:58:00 2022 +0200 @@ -82,6 +82,7 @@ QString file_name; QString new_file_name; QString encoding; + QString bookmarks; bool operator < (const session_data& other) const { @@ -89,6 +90,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; @@ -307,7 +314,8 @@ const QString& encoding = QString (), int line = -1, bool debug_pointer = false, bool breakpoint_marker = false, bool insert = true, - const QString& cond = "", int index = -1); + const QString& cond = "", int index = -1, + const QString& bookmarks = QString ()); void request_preferences (bool); void request_styles_preferences (bool); @@ -487,7 +495,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 9ad55d2e1bbf -r 8340137bb190 libgui/src/m-editor/find-dialog.cc --- a/libgui/src/m-editor/find-dialog.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libgui/src/m-editor/find-dialog.cc Mon Aug 29 13:58:00 2022 +0200 @@ -94,7 +94,6 @@ m_in_sel (false), m_sel_beg (-1), m_sel_end (-1) { setWindowTitle (tr ("Editor: Find and Replace")); - setWindowIcon (QIcon (":/actions/icons/find.png")); m_search_label = new QLabel (tr ("Find &what:")); m_search_line_edit = new QComboBox (this); diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/m-editor/octave-qscintilla.cc --- a/libgui/src/m-editor/octave-qscintilla.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libgui/src/m-editor/octave-qscintilla.cc Mon Aug 29 13:58:00 2022 +0200 @@ -948,8 +948,11 @@ // Remove line and column from first line of error message only // if it is related to the tmp itself, i.e. only if the - // the error stack size is 0 or 1 - if (stack.size () < 2) + // the error stack size is 0, 1, or, if in debug mode, 2 + size_t max_stack_size = 1; + if (dbg) + max_stack_size = 2; + if (stack.size () <= max_stack_size) { QRegExp rx ("source: error sourcing file [^\n]*$"); if (new_msg.contains (rx)) @@ -984,9 +987,12 @@ } } - // Drop first stack level, i.e. temporary function file + // Drop first stack level, which is the temporary function file, + // or, if in debug mode, drop first two stack levels if (stack.size () > 0) stack.pop_back (); + if (dbg && (stack.size () > 0)) + stack.pop_back (); // Clean up before throwing the modified error. emit ctx_menu_run_finished_signal (show_dbg_file, err_line, diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/main-window.cc --- a/libgui/src/main-window.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libgui/src/main-window.cc Mon Aug 29 13:58:00 2022 +0200 @@ -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 @@ -170,6 +172,7 @@ QApplication *qapp = m_octave_qobj.qapplication (); m_default_style = qapp->style ()->objectName (); + m_default_palette = qapp->palette (); gui_settings *settings = rmgr.get_settings (); @@ -279,6 +282,11 @@ connect (cmd_widget, &QTerminal::clear_command_window_request, this, &main_window::handle_clear_command_window_request); } + else + { + connect (this, &main_window::execute_command_signal, + m_command_window, &terminal_dock_widget::execute_command_signal); + } } void main_window::adopt_documentation_widget (void) @@ -828,7 +836,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); @@ -855,7 +862,7 @@ void main_window::open_octave_packages_page (void) { - QDesktopServices::openUrl (QUrl ("https://octave.org/packages.html")); + QDesktopServices::openUrl (QUrl ("https://packages.octave.org/index.html")); } void main_window::open_contribute_page (void) @@ -910,32 +917,28 @@ if (preferred_style == global_style.def.toString ()) preferred_style = m_default_style; - QStyle *new_style = QStyleFactory::create (preferred_style); - if (new_style) + QApplication* qapp = m_octave_qobj.qapplication(); + + if (preferred_style == global_extra_styles.at (EXTRA_STYLE_FUSION_DARK)) { - QApplication *qapp = m_octave_qobj.qapplication (); - - qapp->setStyle (new_style); + QStyle *new_style = QStyleFactory::create (QStringLiteral("Fusion")); + if (new_style) + qapp->setStyle (new_style); + qapp->setPalette (getFusionDarkPalette()); + qapp->setStyleSheet ("QToolTip { color: #ffffff; background-color: #2a82da; border: 1px solid white; }"); + } + else + { + QStyle *new_style = QStyleFactory::create (preferred_style); + if (new_style) + { + qapp->setPalette (m_default_palette); + qapp->setStyle (new_style); + } } // the widget's icons (when floating) - QString icon_set - = settings->value (dw_icon_set).toString (); - - int count = 0; - int icon_set_found = 0; // default - - while (! dw_icon_set_names[count].name.isEmpty ()) - { - // while not end of data - if (dw_icon_set_names[count].name == icon_set) - { - // data of desired icon set found - icon_set_found = count; - break; - } - count++; - } + QString icon_set = settings->value (dw_icon_set).toString (); QString icon; for (auto *widget : dock_widget_list ()) @@ -944,8 +947,8 @@ if (! name.isEmpty ()) { // if child has a name - icon = dw_icon_set_names[icon_set_found].path; // prefix | octave-logo - if (dw_icon_set_names[icon_set_found].name != "NONE") + icon = dw_icon_set_names[icon_set]; + if (icon_set != "NONE") icon += name + ".png"; // add widget name and ext. widget->setWindowIcon (QIcon (icon)); } @@ -1012,6 +1015,33 @@ } + QPalette main_window::getFusionDarkPalette() + { + QPalette darkPalette; + darkPalette.setColor(QPalette::Window, QColor(53, 53, 53)); + darkPalette.setColor(QPalette::WindowText, Qt::white); + darkPalette.setColor(QPalette::Disabled, QPalette::WindowText, QColor(127, 127, 127)); + darkPalette.setColor(QPalette::Base, QColor(42, 42, 42)); + darkPalette.setColor(QPalette::AlternateBase, QColor(66, 66, 66)); + darkPalette.setColor(QPalette::ToolTipBase, Qt::white); + darkPalette.setColor(QPalette::ToolTipText, Qt::white); + darkPalette.setColor(QPalette::Text, Qt::white); + darkPalette.setColor(QPalette::Disabled, QPalette::Text, QColor(127, 127, 127)); + darkPalette.setColor(QPalette::Dark, QColor(35, 35, 35)); + darkPalette.setColor(QPalette::Shadow, QColor(20, 20, 20)); + darkPalette.setColor(QPalette::Button, QColor(53, 53, 53)); + darkPalette.setColor(QPalette::ButtonText, Qt::white); + darkPalette.setColor(QPalette::Disabled, QPalette::ButtonText, QColor(127, 127, 127)); + darkPalette.setColor(QPalette::BrightText, Qt::red); + darkPalette.setColor(QPalette::Link, QColor(42, 130, 218)); + darkPalette.setColor(QPalette::Highlight, QColor(42, 130, 218)); + darkPalette.setColor(QPalette::Disabled, QPalette::Highlight, QColor(80, 80, 80)); + darkPalette.setColor(QPalette::HighlightedText, Qt::white); + darkPalette.setColor(QPalette::Disabled, QPalette::HighlightedText, QColor(127, 127, 127)); + + return darkPalette; + } + void main_window::prepare_to_exit (void) { // Find files dialog is constructed dynamically, not at time of main_window @@ -1116,19 +1146,26 @@ void main_window::execute_command_in_terminal (const QString& command) { - emit interpreter_event - ([=] (void) - { - // INTERPRETER THREAD - - std::string pending_input = command_editor::get_current_line (); - - command_editor::set_initial_input (pending_input); - command_editor::replace_line (command.toStdString ()); - command_editor::redisplay (); - command_editor::interrupt_event_loop (); - command_editor::accept_line (); - }); + if (m_octave_qobj.experimental_terminal_widget ()) + { + emit execute_command_signal (command); + } + else + { + emit interpreter_event + ([=] (void) + { + // INTERPRETER THREAD + + std::string pending_input = command_editor::get_current_line (); + + command_editor::set_initial_input (pending_input); + command_editor::replace_line (command.toStdString ()); + command_editor::redisplay (); + command_editor::interrupt_event_loop (); + command_editor::accept_line (); + }); + } focus_console_after_command (); } @@ -1555,24 +1592,20 @@ // setting the geometry to the max. available geometry. However, on // X11, the available geometry (excluding task bar etc.) is equal to // the total geometry leading to a full screen mode without window - // decorations. This in turn can be avoided by reducing the max. - // size by a few pixels. - - // Get available geometry for current screen. + // decorations. This in turn can be avoided by explicitly adding + // a title bar in the window flags. + + // Get available geometry for current screen and set this + // window's geometry to it. QScreen *s = windowHandle ()->screen (); QRect av_geom = s->availableGeometry (); - - QList screen_list = QGuiApplication::screens (); - if (screen_list.length () > 1) - { - // If we have more than one monitor and available and total - // geometry are the same, reduce this too large geometry - QRect new_geom (av_geom.x () + 1, av_geom.y () + 1, - av_geom.width ()-2, av_geom.height ()-2); - setGeometry (new_geom); - } - else - setGeometry (av_geom); // Set (correct) available geometry + setGeometry (av_geom); // Set (correct) available geometry + + // Force full title bar + setWindowFlags(Qt::WindowTitleHint + | Qt::WindowMinMaxButtonsHint + | Qt::WindowSystemMenuHint + | Qt::WindowCloseButtonHint); } if (! restoreState (settings->value (mw_state).toByteArray ())) @@ -1781,6 +1814,7 @@ }); } + m_command_window->init_command_prompt (); focus_command_window (); // make sure that the command window has focus } @@ -2020,7 +2054,7 @@ void main_window::construct (void) { - setWindowIcon (QIcon (":/actions/icons/logo.png")); + setWindowIcon (QIcon (dw_icon_set_names["NONE"])); interpreter_qobject *interp_qobj = m_octave_qobj.interpreter_qobj (); @@ -2592,7 +2626,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", false, "go-up"), tr ("One directory up")); QAction *current_dir_search = m_main_tool_bar->addAction (rmgr.icon ("folder"), diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/main-window.h --- a/libgui/src/main-window.h Sun Aug 28 22:44:49 2022 +0200 +++ b/libgui/src/main-window.h Mon Aug 29 13:58:00 2022 +0200 @@ -129,6 +129,8 @@ void interpreter_event (const fcn_callback& fcn); void interpreter_event (const meth_callback& meth); + void execute_command_signal (const QString& command); + public slots: void focus_changed (QWidget *w_old, QWidget *w_new); @@ -153,10 +155,10 @@ void open_donate_page (void); void process_settings_dialog_request (const QString& desired_tab = QString ()); - void show_about_octave (void); void notice_settings (const gui_settings *settings, bool update_by_worker = false); + QPalette getFusionDarkPalette(); void prepare_to_exit (void); void go_to_previous_widget (void); void reset_windows (void); @@ -309,6 +311,7 @@ QString m_default_encoding; QString m_default_style; + QPalette m_default_palette; //! Toolbar. diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/module.mk --- a/libgui/src/module.mk Sun Aug 28 22:44:49 2022 +0200 +++ b/libgui/src/module.mk Mon Aug 29 13:58:00 2022 +0200 @@ -1,113 +1,254 @@ 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-information.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-settings.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-home.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/view-zoom-in.png \ + %reldir%/icons/octave/128x128/view-zoom-original.png \ + %reldir%/icons/octave/128x128/view-zoom-out.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-information.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-settings.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-home.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/view-zoom-in.svg \ + %reldir%/icons/octave/scalable/view-zoom-original.svg \ + %reldir%/icons/octave/scalable/view-zoom-out.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.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.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 9ad55d2e1bbf -r 8340137bb190 libgui/src/octave-dock-widget.cc --- a/libgui/src/octave-dock-widget.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libgui/src/octave-dock-widget.cc Mon Aug 29 13:58:00 2022 +0200 @@ -73,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); @@ -85,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); @@ -233,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 ("")); @@ -311,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 @@ -370,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 @@ -798,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 9ad55d2e1bbf -r 8340137bb190 libgui/src/octave-qobject.cc --- a/libgui/src/octave-qobject.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libgui/src/octave-qobject.cc Mon Aug 29 13:58:00 2022 +0200 @@ -313,6 +313,7 @@ // After settings. config_translators (); + m_resource_manager.config_icon_theme (); // Initilize the shortcut-manager m_shortcut_manager.init_data (); @@ -473,10 +474,13 @@ this, &base_qobject::interpreter_stop); connect (qt_link (), &qt_interpreter_events::interpreter_output_signal, - m_terminal_widget, &terminal_dock_widget::interpreter_output); + m_terminal_widget, &terminal_dock_widget::interpreter_output_signal); connect (qt_link (), &qt_interpreter_events::update_prompt_signal, - m_terminal_widget, &terminal_dock_widget::update_prompt); + m_terminal_widget, &terminal_dock_widget::update_prompt_signal); + + connect (qt_link (), &qt_interpreter_events::new_command_line_signal, + m_terminal_widget, &terminal_dock_widget::new_command_line_signal); connect_interpreter_events (cmd_widget); } @@ -731,7 +735,7 @@ QPointer base_qobject::release_notes_widget (void) { if (! m_release_notes) - m_release_notes = QPointer (new release_notes ()); + m_release_notes = QPointer (new release_notes (*this)); return m_release_notes; } diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/qt-interpreter-events.cc --- a/libgui/src/qt-interpreter-events.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libgui/src/qt-interpreter-events.cc Mon Aug 29 13:58:00 2022 +0200 @@ -510,9 +510,12 @@ if (m_octave_qobj.experimental_terminal_widget () && m_octave_qobj.have_terminal_window ()) { + // Output the exception message std::ostringstream buf; ee.display (buf); emit interpreter_output_signal (QString::fromStdString (buf.str ())); + // Create w new command line + emit new_command_line_signal (); } else { diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/qt-interpreter-events.h --- a/libgui/src/qt-interpreter-events.h Sun Aug 28 22:44:49 2022 +0200 +++ b/libgui/src/qt-interpreter-events.h Mon Aug 29 13:58:00 2022 +0200 @@ -287,8 +287,9 @@ void show_community_news_signal (int serial); void show_release_notes_signal (void); - // Note: this signal currently not used by the old terminal widget. + // Note: the next two signals are currently not used by the old terminal widget. void interpreter_output_signal (const QString& msg); + void new_command_line_signal (const QString& msg = QString ()); void gui_status_update_signal (const QString& feature, const QString& status); diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/release-notes.cc --- a/libgui/src/release-notes.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libgui/src/release-notes.cc Mon Aug 29 13:58:00 2022 +0200 @@ -38,6 +38,7 @@ #include "release-notes.h" #include "gui-utils.h" +#include "gui-preferences-dw.h" #include "gui-preferences-nr.h" #include "news-reader.h" #include "octave-qobject.h" @@ -46,19 +47,20 @@ namespace octave { - release_notes::release_notes (void) - : QWidget (nullptr), m_browser (nullptr), - m_release_notes_icon (":/actions/icons/logo.png") + release_notes::release_notes (base_qobject& oct_qobj) + : QWidget (nullptr), m_browser (nullptr) { -#if 0 - // The following code was in main-window.cc. How should that be - // handled here? - if (dw_icon_set_names[icon_set_found].name != "NONE") - m_release_notes_icon = dw_icon_set_names[icon_set_found].path + + resource_manager& rmgr = oct_qobj.get_resource_manager (); + gui_settings *settings = rmgr.get_settings (); + + // The icon + QString icon_set = settings->value (dw_icon_set).toString (); + if (icon_set != "NONE") + m_release_notes_icon = dw_icon_set_names[icon_set] + "ReleaseWidget.png"; else - m_release_notes_icon = ":/actions/icons/logo.png"; -#endif + m_release_notes_icon = dw_icon_set_names[icon_set]; std::string news_file = config::oct_etc_dir () + "/NEWS"; diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/release-notes.h --- a/libgui/src/release-notes.h Sun Aug 28 22:44:49 2022 +0200 +++ b/libgui/src/release-notes.h Mon Aug 29 13:58:00 2022 +0200 @@ -41,7 +41,7 @@ public: - release_notes (void); + release_notes (base_qobject& qct_qobj); ~release_notes (void) = default; diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/resource-manager.cc --- a/libgui/src/resource-manager.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libgui/src/resource-manager.cc Mon Aug 29 13:58:00 2022 +0200 @@ -27,6 +27,8 @@ # include "config.h" #endif +#include + #include #include #include @@ -38,11 +40,7 @@ #include #include #include -#if defined (HAVE_QSTANDARDPATHS) -# include -#else -# include -#endif +#include #include @@ -67,7 +65,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 +183,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 +625,26 @@ 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, + const QString& icon_alt_name) { - // 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"); - // 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); + if (QIcon::hasThemeIcon (icon_name)) + return QIcon (QIcon::fromTheme (icon_name)); + else if ((! icon_alt_name.isEmpty ()) && QIcon::hasThemeIcon (icon_alt_name)) + return QIcon (QIcon::fromTheme (icon_alt_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 @@ -676,6 +727,7 @@ combo->setMaxVisibleItems (12); } + QPointer resource_manager::create_tmp_file (const QString& extension, const QString& contents) @@ -685,8 +737,7 @@ ext = QString (".") + ext; // Create octave dir within temp. dir - QString tmp_dir = QDir::tempPath () + QDir::separator() + "octave"; - QDir::temp ().mkdir ("octave"); + QString tmp_dir = QString::fromStdString (sys::env::get_temp_directory ()); // Create temp. file QPointer tmp_file diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/resource-manager.h --- a/libgui/src/resource-manager.h Sun Aug 28 22:44:49 2022 +0200 +++ b/libgui/src/resource-manager.h Mon Aug 29 13:58:00 2022 +0200 @@ -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,8 @@ void update_network_settings (void); - QIcon icon (const QString& icon_name, bool fallback = true); + QIcon icon (const QString& icon_name, bool octave_only = false, + const QString& icon_alt_name = QString ()); void get_codecs (QStringList *codecs); @@ -122,6 +124,8 @@ gui_settings *m_default_settings; QList m_temporary_files; + + QStringList m_icon_fallbacks; }; } diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/resource.qrc --- a/libgui/src/resource.qrc Sun Aug 28 22:44:49 2022 +0200 +++ b/libgui/src/resource.qrc Mon Aug 29 13:58:00 2022 +0200 @@ -1,94 +1,136 @@ - - 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-information.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-settings.png + icons/octave/128x128/folder-up.png + icons/octave/128x128/go-down.png + icons/octave/128x128/go-first.png + icons/octave/128x128/go-home.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/view-zoom-in.png + icons/octave/128x128/view-zoom-original.png + icons/octave/128x128/view-zoom-out.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/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 9ad55d2e1bbf -r 8340137bb190 libgui/src/settings-dialog.cc --- a/libgui/src/settings-dialog.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libgui/src/settings-dialog.cc Mon Aug 29 13:58:00 2022 +0200 @@ -116,6 +116,7 @@ // Global style QStringList styles = QStyleFactory::keys(); + styles.append (global_extra_styles); combo_styles->addItems (styles); combo_styles->insertItem (0, global_style.def.toString ()); combo_styles->insertSeparator (1); @@ -137,7 +138,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 +1023,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 9ad55d2e1bbf -r 8340137bb190 libgui/src/settings-dialog.ui --- a/libgui/src/settings-dialog.ui Sun Aug 28 22:44:49 2022 +0200 +++ b/libgui/src/settings-dialog.ui Mon Aug 29 13:58:00 2022 +0200 @@ -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 9ad55d2e1bbf -r 8340137bb190 libgui/src/terminal-dock-widget.cc --- a/libgui/src/terminal-dock-widget.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libgui/src/terminal-dock-widget.cc Mon Aug 29 13:58:00 2022 +0200 @@ -53,6 +53,7 @@ if (m_experimental_terminal_widget) { command_widget *widget = new command_widget (oct_qobj, this); + console *con = widget->get_console (); connect (this, &terminal_dock_widget::settings_changed, widget, &command_widget::notice_settings); @@ -63,6 +64,12 @@ connect (this, &terminal_dock_widget::interpreter_output_signal, widget, &command_widget::insert_interpreter_output); + connect (this, &terminal_dock_widget::execute_command_signal, + con, &console::execute_command); + + connect (this, &terminal_dock_widget::new_command_line_signal, + con, &console::new_command_line); + m_terminal = widget; } else @@ -83,7 +90,6 @@ m_terminal->setObjectName ("OctaveTerminal"); m_terminal->setFocusPolicy (Qt::StrongFocus); - setWindowIcon (QIcon (":/actions/icons/logo.png")); set_title (tr ("Command Window")); setWidget (m_terminal); @@ -144,16 +150,13 @@ emit settings_changed (settings); } - void terminal_dock_widget::interpreter_output (const QString& msg) + void terminal_dock_widget::init_command_prompt () { if (m_experimental_terminal_widget) - emit interpreter_output_signal (msg); + { + command_widget *cmd = get_command_widget (); + if (cmd) + cmd->init_command_prompt (); + } } - - void terminal_dock_widget::update_prompt (const QString& prompt) - { - if (m_experimental_terminal_widget) - emit update_prompt_signal (prompt); - } - } diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/terminal-dock-widget.h --- a/libgui/src/terminal-dock-widget.h Sun Aug 28 22:44:49 2022 +0200 +++ b/libgui/src/terminal-dock-widget.h Mon Aug 29 13:58:00 2022 +0200 @@ -49,6 +49,8 @@ bool has_focus (void) const; + void init_command_prompt (); + // FIXME: The next two functions could be eliminated (or combined) // if we had a common interface for the old and new terminal // widgets. @@ -63,24 +65,21 @@ void settings_changed (const gui_settings *settings); - // Note: UPDATE_PROMPT_SIGNAL and INTERPRETER_OUTPUT_SIGNAL are + // Note: the following four signals are // currently only used by the new experimental terminal widget. void update_prompt_signal (const QString&); void interpreter_output_signal (const QString&); + void new_command_line_signal (const QString& = QString ()); + + void execute_command_signal (const QString&); + public slots: void notice_settings (const gui_settings *settings); - // Note: INTERPRETER_OUTPUT and UPDATE_PROMPT are currently only - // used by the new experimental terminal widget. - - void interpreter_output (const QString&); - - void update_prompt (const QString&); - private: bool m_experimental_terminal_widget; diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/variable-editor.cc --- a/libgui/src/variable-editor.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libgui/src/variable-editor.cc Mon Aug 29 13:58:00 2022 +0200 @@ -51,6 +51,7 @@ #include "builtin-defun-decls.h" #include "dw-main-window.h" #include "gui-preferences-cs.h" +#include "gui-preferences-dw.h" #include "gui-preferences-global.h" #include "gui-preferences-sc.h" #include "gui-preferences-ve.h" @@ -171,7 +172,8 @@ { if (toplevel) { - m_dock_action->setIcon (QIcon (":/actions/icons/widget-dock.png")); + m_dock_action->setIcon (QIcon (global_icon_paths.at (ICON_THEME_OCTAVE) + + "widget-dock.png")); m_dock_action->setToolTip (tr ("Dock widget")); setWindowFlags (Qt::Window); @@ -188,7 +190,8 @@ } else { - m_dock_action->setIcon (QIcon (":/actions/icons/widget-undock.png")); + m_dock_action->setIcon (QIcon (global_icon_paths.at (ICON_THEME_OCTAVE) + + "widget-undock.png")); m_dock_action->setToolTip (tr ("Undock widget")); setFocus (); @@ -1113,7 +1116,6 @@ { set_title (tr ("Variable Editor")); setStatusTip (tr ("Edit variables.")); - setWindowIcon (QIcon (":/actions/icons/logo.png")); setAttribute (Qt::WA_AlwaysShowToolTips); m_main->setParent (this); diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/welcome-wizard.cc --- a/libgui/src/welcome-wizard.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libgui/src/welcome-wizard.cc Mon Aug 29 13:58:00 2022 +0200 @@ -37,6 +37,7 @@ #include #endif +#include "gui-preferences-dw.h" #include "gui-preferences-nr.h" #include "octave-qobject.h" #include "welcome-wizard.h" @@ -47,7 +48,7 @@ make_octave_logo (QWidget *p = nullptr, int height = 100) { QLabel *logo = new QLabel (p); - QPixmap logo_pixmap (":/actions/icons/logo.png"); + QPixmap logo_pixmap (dw_icon_set_names["NONE"]); logo->setPixmap (logo_pixmap.scaledToHeight (height)); return logo; }; diff -r 9ad55d2e1bbf -r 8340137bb190 libgui/src/workspace-view.cc --- a/libgui/src/workspace-view.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libgui/src/workspace-view.cc Mon Aug 29 13:58:00 2022 +0200 @@ -55,7 +55,6 @@ m_filter (new QComboBox (this)), m_filter_widget (new QWidget (this)) { - setWindowIcon (QIcon (":/actions/icons/logo.png")); set_title (tr ("Workspace")); setStatusTip (tr ("View the variables in the active workspace.")); diff -r 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/__eigs__.cc --- a/libinterp/corefcn/__eigs__.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/__eigs__.cc Mon Aug 29 13:58:00 2022 +0200 @@ -195,7 +195,7 @@ SparseComplexMatrix ascm, bscm, bsct; int b_arg = 0; bool have_b = false; - bool have_a_fun = false; + bool have_a_fcn = false; bool a_is_complex = false; bool b_is_complex = false; bool symmetric = false; @@ -234,7 +234,7 @@ n = args(1).nint_value (); arg_offset = 1; - have_a_fun = true; + have_a_fcn = true; } else { @@ -343,7 +343,7 @@ } // isreal is ignored if A is not a function - if (have_a_fun) + if (have_a_fcn) { tmp = map.getfield ("isreal"); if (tmp.is_defined ()) @@ -398,7 +398,7 @@ error ("eigs: incorrect number of arguments"); // Test undeclared (no issym) matrix inputs for symmetry - if (! sym_tested && ! have_a_fun) + if (! sym_tested && ! have_a_fcn) { if (a_is_complex) { @@ -452,7 +452,7 @@ ComplexMatrix eig_vec; ComplexColumnVector eig_val; - if (have_a_fun) + if (have_a_fcn) { if (b_is_sparse) nconv = EigsComplexNonSymmetricFunc @@ -520,7 +520,7 @@ ComplexMatrix eig_vec; ComplexColumnVector eig_val; - if (have_a_fun) + if (have_a_fcn) { if (b_is_sparse) nconv = EigsComplexNonSymmetricFunc @@ -574,7 +574,7 @@ Matrix eig_vec; ColumnVector eig_val; - if (have_a_fun) + if (have_a_fcn) { if (b_is_sparse) nconv = EigsRealSymmetricFunc @@ -624,7 +624,7 @@ ComplexMatrix eig_vec; ComplexColumnVector eig_val; - if (have_a_fun) + if (have_a_fcn) { if (b_is_sparse) nconv = EigsRealNonSymmetricFunc diff -r 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/__ftp__.cc --- a/libinterp/corefcn/__ftp__.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/__ftp__.cc Mon Aug 29 13:58:00 2022 +0200 @@ -82,7 +82,7 @@ DEFMETHOD (__ftp_pwd__, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} __ftp_pwd__ (@var{handle}) +@deftypefn {} {@var{pwd} =} __ftp_pwd__ (@var{handle}) Undocumented internal function @end deftypefn */) { @@ -122,7 +122,8 @@ DEFMETHOD (__ftp_dir__, interp, args, nargout, doc: /* -*- texinfo -*- -@deftypefn {} {} __ftp_dir__ (@var{handle}) +@deftypefn {} {} __ftp_dir__ (@var{handle}) +@deftypefnx {} {@var{S} =} __ftp_dir__ (@var{handle}) Undocumented internal function @end deftypefn */) { @@ -248,7 +249,7 @@ DEFMETHOD (__ftp_mode__, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} __ftp_mode__ (@var{handle}) +@deftypefn {} {@var{mode} =} __ftp_mode__ (@var{handle}) Undocumented internal function @end deftypefn */) { @@ -345,7 +346,8 @@ DEFMETHOD (__ftp_mput__, interp, args, nargout, doc: /* -*- texinfo -*- -@deftypefn {} {} __ftp_mput__ (@var{handle}, @var{files}) +@deftypefn {} {} __ftp_mput__ (@var{handle}, @var{files}) +@deftypefnx {} {@var{filelist} =} __ftp_mput__ (@var{handle}, @var{files}) Undocumented internal function @end deftypefn */) { diff -r 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/__isprimelarge__.cc --- a/libinterp/corefcn/__isprimelarge__.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/__isprimelarge__.cc Mon Aug 29 13:58:00 2022 +0200 @@ -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; @@ -189,7 +190,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 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/__lin_interpn__.cc --- a/libinterp/corefcn/__lin_interpn__.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/__lin_interpn__.cc Mon Aug 29 13:58:00 2022 +0200 @@ -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 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/__magick_read__.cc --- a/libinterp/corefcn/__magick_read__.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/__magick_read__.cc Mon Aug 29 13:58:00 2022 +0200 @@ -1677,7 +1677,7 @@ // done in Octave language), and then again for the actual reading. DEFUN (__magick_ping__, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} __magick_ping__ (@var{fname}, @var{idx}) +@deftypefn {} {@var{fmt} =} __magick_ping__ (@var{fname}, @var{idx}) Ping image information with GraphicsMagick or ImageMagick. This is a private internal function not intended for direct use. @@ -1910,7 +1910,7 @@ DEFUN (__magick_finfo__, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} __magick_finfo__ (@var{fname}) +@deftypefn {} {@var{infostruct} =} __magick_finfo__ (@var{fname}) Read image information with GraphicsMagick or ImageMagick. This is a private internal function not intended for direct use. @@ -2361,7 +2361,7 @@ DEFUN (__magick_formats__, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} __magick_imformats__ (@var{formats}) +@deftypefn {} {@var{fmt_struct} =} __magick_imformats__ (@var{formats}) Fill formats info with GraphicsMagick CoderInfo. @seealso{imfinfo, imformats, imread, imwrite} diff -r 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/__pchip_deriv__.cc --- a/libinterp/corefcn/__pchip_deriv__.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/__pchip_deriv__.cc Mon Aug 29 13:58:00 2022 +0200 @@ -43,7 +43,7 @@ DEFUN (__pchip_deriv__, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} __pchip_deriv__ (@var{x}, @var{y}, @var{dim}) +@deftypefn {} {@var{d} =} __pchip_deriv__ (@var{x}, @var{y}, @var{dim}) Undocumented internal function. @end deftypefn */) { @@ -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 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/besselj.cc --- a/libinterp/corefcn/besselj.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/besselj.cc Mon Aug 29 13:58:00 2022 +0200 @@ -83,7 +83,7 @@ while (0) octave_value_list -do_bessel (enum bessel_type type, const char *fn, +do_bessel (enum bessel_type type, const char *fcn, const octave_value_list& args, int nargout) { int nargin = args.length (); @@ -112,7 +112,7 @@ scaled = opt_arg.bool_value (); if (rpt_error) - error ("%s: OPT must be 0 (or false) or 1 (or true)", fn); + error ("%s: OPT must be 0 (or false) or 1 (or true)", fcn); } octave_value alpha_arg = args(0); @@ -122,11 +122,11 @@ { if (alpha_arg.is_scalar_type ()) { - float alpha = args(0).xfloat_value ("%s: ALPHA must be a scalar or matrix", fn); + float alpha = args(0).xfloat_value ("%s: ALPHA must be a scalar or matrix", fcn); if (x_arg.is_scalar_type ()) { - FloatComplex x = x_arg.xfloat_complex_value ("%s: X must be a scalar or matrix", fn); + FloatComplex x = x_arg.xfloat_complex_value ("%s: X must be a scalar or matrix", fcn); octave_idx_type ierr; octave_value result; @@ -139,7 +139,7 @@ } else { - FloatComplexNDArray x = x_arg.xfloat_complex_array_value ("%s: X must be a scalar or matrix", fn); + FloatComplexNDArray x = x_arg.xfloat_complex_array_value ("%s: X must be a scalar or matrix", fcn); Array ierr; octave_value result; @@ -161,10 +161,10 @@ if (args0_is_row_vector && args1_is_col_vector) { - FloatRowVector ralpha = args(0).xfloat_row_vector_value ("%s: ALPHA must be a scalar or matrix", fn); + FloatRowVector ralpha = args(0).xfloat_row_vector_value ("%s: ALPHA must be a scalar or matrix", fcn); FloatComplexColumnVector cx - = x_arg.xfloat_complex_column_vector_value ("%s: X must be a scalar or matrix", fn); + = x_arg.xfloat_complex_column_vector_value ("%s: X must be a scalar or matrix", fcn); Array ierr; octave_value result; @@ -177,11 +177,11 @@ } else { - FloatNDArray alpha = args(0).xfloat_array_value ("%s: ALPHA must be a scalar or matrix", fn); + FloatNDArray alpha = args(0).xfloat_array_value ("%s: ALPHA must be a scalar or matrix", fcn); if (x_arg.is_scalar_type ()) { - FloatComplex x = x_arg.xfloat_complex_value ("%s: X must be a scalar or matrix", fn); + FloatComplex x = x_arg.xfloat_complex_value ("%s: X must be a scalar or matrix", fcn); Array ierr; octave_value result; @@ -194,7 +194,7 @@ } else { - FloatComplexNDArray x = x_arg.xfloat_complex_array_value ("%s: X must be a scalar or matrix", fn); + FloatComplexNDArray x = x_arg.xfloat_complex_array_value ("%s: X must be a scalar or matrix", fcn); Array ierr; octave_value result; @@ -212,11 +212,11 @@ { if (alpha_arg.is_scalar_type ()) { - double alpha = args(0).xdouble_value ("%s: ALPHA must be a scalar or matrix", fn); + double alpha = args(0).xdouble_value ("%s: ALPHA must be a scalar or matrix", fcn); if (x_arg.is_scalar_type ()) { - Complex x = x_arg.xcomplex_value ("%s: X must be a scalar or matrix", fn); + Complex x = x_arg.xcomplex_value ("%s: X must be a scalar or matrix", fcn); octave_idx_type ierr; octave_value result; @@ -229,7 +229,7 @@ } else { - ComplexNDArray x = x_arg.xcomplex_array_value ("%s: X must be a scalar or matrix", fn); + ComplexNDArray x = x_arg.xcomplex_array_value ("%s: X must be a scalar or matrix", fcn); Array ierr; octave_value result; @@ -251,10 +251,10 @@ if (args0_is_row_vector && args1_is_col_vector) { - RowVector ralpha = args(0).xrow_vector_value ("%s: ALPHA must be a scalar or matrix", fn); + RowVector ralpha = args(0).xrow_vector_value ("%s: ALPHA must be a scalar or matrix", fcn); ComplexColumnVector cx - = x_arg.xcomplex_column_vector_value ("%s: X must be a scalar or matrix", fn); + = x_arg.xcomplex_column_vector_value ("%s: X must be a scalar or matrix", fcn); Array ierr; octave_value result; @@ -267,11 +267,11 @@ } else { - NDArray alpha = args(0).xarray_value ("%s: ALPHA must be a scalar or matrix", fn); + NDArray alpha = args(0).xarray_value ("%s: ALPHA must be a scalar or matrix", fcn); if (x_arg.is_scalar_type ()) { - Complex x = x_arg.xcomplex_value ("%s: X must be a scalar or matrix", fn); + Complex x = x_arg.xcomplex_value ("%s: X must be a scalar or matrix", fcn); Array ierr; octave_value result; @@ -284,7 +284,7 @@ } else { - ComplexNDArray x = x_arg.xcomplex_array_value ("%s: X must be a scalar or matrix", fn); + ComplexNDArray x = x_arg.xcomplex_array_value ("%s: X must be a scalar or matrix", fcn); Array ierr; octave_value result; @@ -355,6 +355,10 @@ /* %!# Function besselj is tested along with other bessels at the end of this file + +## besselj specific BIST +%!assert <*48316> (! any (isnan (besselj (1, 10.^[5:12])))) + */ DEFUN (bessely, args, nargout, @@ -466,6 +470,10 @@ /* %!# Function besseli is tested along with other bessels at the end of this file + +## besseli specific BIST +%!assert (! isinf (besseli (0, 700))) + */ DEFUN (besselk, args, nargout, @@ -616,12 +624,16 @@ DEFUN (airy, args, nargout, doc: /* -*- texinfo -*- -@deftypefn {} {[@var{a}, @var{ierr}] =} airy (@var{k}, @var{z}, @var{opt}) +@deftypefn {} {@var{a} =} airy (@var{z}) +@deftypefnx {} {@var{a} =} airy (@var{k}, @var{z}) +@deftypefnx {} {@var{a} =} airy (@var{k}, @var{z}, @var{scale}) +@deftypefnx {} {[@var{a}, @var{ierr}] =} airy (@dots{}) + Compute Airy functions of the first and second kind, and their derivatives. @example @group - K Function Scale factor (if "opt" is supplied) + K Function Scale factor (if @var{scale} is true) --- -------- --------------------------------------- 0 Ai (Z) exp ((2/3) * Z * sqrt (Z)) 1 dAi(Z)/dZ exp ((2/3) * Z * sqrt (Z)) @@ -633,9 +645,12 @@ The function call @code{airy (@var{z})} is equivalent to @code{airy (0, @var{z})}. -The result is the same size as @var{z}. +The optional third input @var{scale} determines whether to +apply scaling as described above. It is false by default. -If requested, @var{ierr} contains the following status information and +The result @var{a} is the same size as @var{z}. + +The optional output @var{ierr} contains the following status information and is the same size as the result. @enumerate 0 @@ -677,50 +692,91 @@ error ("airy: K must be 0, 1, 2, or 3"); } - bool scale = (nargin == 3); + bool scale = (nargin == 3) && args(2).xbool_value ("airy: scale option must be a logical value"); int idx = (nargin == 1 ? 0 : 1); + Array ierr; + octave_value result; + if (args(idx).is_single_type ()) { FloatComplexNDArray z = args(idx).xfloat_complex_array_value ("airy: Z must be a complex matrix"); - Array ierr; - octave_value result; + if (kind > 1) + result = math::biry (z, kind == 3, scale, ierr); + else + result = math::airy (z, kind == 1, scale, ierr); + } + else + { + ComplexNDArray z = args(idx).xcomplex_array_value ("airy: Z must be a complex matrix"); if (kind > 1) result = math::biry (z, kind == 3, scale, ierr); else result = math::airy (z, kind == 1, scale, ierr); - - retval(0) = result; - if (nargout > 1) - retval(1) = NDArray (ierr); } - else - { - ComplexNDArray z = args(idx).xcomplex_array_value ("airy: Z must be a complex matrix"); - Array ierr; - octave_value result; - - if (kind > 1) - result = math::biry (z, kind == 3, scale, ierr); - else - result = math::airy (z, kind == 1, scale, ierr); - - retval(0) = result; - if (nargout > 1) - retval(1) = NDArray (ierr); - } + retval(0) = result; + if (nargout > 1) + retval(1) = NDArray (ierr); return retval; } /* -FIXME: Function airy does not yet have BIST tests +%!test <*62321> +%! assert (airy (0, +1, false), 0.1352924163128814, 1e-15); +%! assert (airy (0, -1, false), 0.5355608832923521, 1e-15); +%! assert (airy (0, +i, false), 0.3314933054321411 - 0.3174498589684437i, 1e-15); +%! assert (airy (0, -i, false), 0.3314933054321411 + 0.3174498589684437i, 1e-15); +%! assert (airy (0, +1, true), 0.2635136447491401, 1e-15); +%! assert (airy (0, -1, true), 0.4208904755499093 - 0.3311746779333462i, 1e-15); +%! assert (airy (0, +i, true), 0.2743053542644657 - 0.0825606941400591i, 1e-15); +%! assert (airy (0, -i, true), 0.2743053542644657 + 0.0825606941400591i, 1e-15); +%! assert (airy (1, +1, false), -0.1591474412967932, 1e-15); +%! assert (airy (1, -1, false), -0.0101605671166451, 1e-15); +%! assert (airy (1, +i, false), -0.4324926598418070 + 0.0980478562292432i, 1e-15); +%! assert (airy (1, -i, false), -0.4324926598418070 - 0.0980478562292432i, 1e-15); +%! assert (airy (1, +1, true), -0.3099768889605148, 1e-15); +%! assert (airy (1, -1, true), -0.0079850602592406 + 0.0062829878869967i, 1e-15); +%! assert (airy (1, +i, true), -0.2682792317254506 - 0.0680655016581369i, 1e-15); +%! assert (airy (1, -i, true), -0.2682792317254506 + 0.0680655016581369i, 1e-15); +%! assert (airy (2, +1, false), 1.2074235949528715, 1e-15); +%! assert (airy (2, -1, false), 0.1039973894969446, 1e-15); +%! assert (airy (2, +i, false), 0.6488582083303949 + 0.3449586347680484i, 1e-15); +%! assert (airy (2, -i, false), 0.6488582083303949 - 0.3449586347680484i, 1e-15); +%! assert (airy (2, +1, true), 0.6199119435726786, 1e-15); +%! assert (airy (2, -1, true), 0.1039973894969446, 1e-15); +%! assert (airy (2, +i, true), 0.4049686654663902 + 0.2152973271658010i, 1e-15); +%! assert (airy (2, -i, true), 0.4049686654663902 - 0.2152973271658010i, 1e-15); +%! assert (airy (3, +1, false), 0.9324359333927754, 1e-15); +%! assert (airy (3, -1, false), 0.5923756264227923, 1e-15); +%! assert (airy (3, +i, false), 0.1350266467108190 - 0.1288373867812549i, 1e-15); +%! assert (airy (3, -i, false), 0.1350266467108190 + 0.1288373867812549i, 1e-15); +%! assert (airy (3, +1, true), 0.4787285706049846, 1e-15); +%! assert (airy (3, -1, true), 0.5923756264227923, 1e-15); +%! assert (airy (3, +i, true), 0.0842735134099415 - 0.0804106412111761i, 1e-15); +%! assert (airy (3, -i, true), 0.0842735134099415 + 0.0804106412111761i, 1e-15); +%! z = -1 - 1e-6i; +%! s1 = exp (2/3 * z * sqrt(z)); +%! s2 = exp (-abs (real (2/3 * z * sqrt(z)))); +%! assert (airy (0, z, true), s1 * airy (0, z, false), 1e-15); +%! assert (airy (1, z, true), s1 * airy (1, z, false), 1e-15); +%! assert (airy (2, z, true), s2 * airy (2, z, false), 1e-15); +%! assert (airy (3, z, true), s2 * airy (3, z, false), 1e-15); + +Input validation tests +%!error airy () +%!error airy (0, 1, 2, 3) +%!error airy ("foo", 2, false) +%!error airy (3743, 2, false) +%!error airy (0, 2, "foo") +%!error airy (0, "foo", false) */ + /* ## Test values computed with GP/PARI version 2.3.3 %!shared alpha, x, jx, yx, ix, kx, nix diff -r 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/bitfcns.cc --- a/libinterp/corefcn/bitfcns.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/bitfcns.cc Mon Aug 29 13:58:00 2022 +0200 @@ -361,7 +361,7 @@ DEFUN (bitand, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} bitand (@var{x}, @var{y}) +@deftypefn {} {@var{z} =} bitand (@var{x}, @var{y}) Return the bitwise AND of non-negative integers. @var{x}, @var{y} must be in the range [0,intmax] @@ -377,7 +377,7 @@ DEFUN (bitor, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} bitor (@var{x}, @var{y}) +@deftypefn {} {@var{z} =} bitor (@var{x}, @var{y}) Return the bitwise OR of non-negative integers @var{x} and @var{y}. @seealso{bitor, bitxor, bitset, bitget, bitcmp, bitshift, intmax, flintmax} @@ -392,7 +392,7 @@ DEFUN (bitxor, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} bitxor (@var{x}, @var{y}) +@deftypefn {} {@var{z} =} bitxor (@var{x}, @var{y}) Return the bitwise XOR of non-negative integers @var{x} and @var{y}. @seealso{bitand, bitor, bitset, bitget, bitcmp, bitshift, intmax, flintmax} @@ -536,14 +536,13 @@ DEFUN (bitshift, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} bitshift (@var{a}, @var{k}) -@deftypefnx {} {} bitshift (@var{a}, @var{k}, @var{n}) -Return a @var{k} bit shift of @var{n}-digit unsigned integers in @var{a}. +@deftypefn {} {@var{B} =} bitshift (@var{A}, @var{k}) +@deftypefnx {} {@var{B} =} bitshift (@var{A}, @var{k}, @var{n}) +Return a @var{k} bit shift of @var{n}-digit unsigned integers in @var{A}. A positive @var{k} leads to a left shift; A negative value to a right shift. -If @var{n} is omitted it defaults to 64. -@var{n} must be in the range [1,64]. +If @var{n} is omitted it defaults to 64. @var{n} must be in the range [1,64]. @example @group @@ -658,10 +657,10 @@ DEFUN (flintmax, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} flintmax () -@deftypefnx {} {} flintmax ("double") -@deftypefnx {} {} flintmax ("single") -@deftypefnx {} {} flintmax (@var{var}) +@deftypefn {} {@var{Imax} =} flintmax () +@deftypefnx {} {@var{Imax} =} flintmax ("double") +@deftypefnx {} {@var{Imax} =} flintmax ("single") +@deftypefnx {} {@var{Imax} =} flintmax (@var{var}) Return the largest integer that can be represented consecutively in a floating point value. @@ -726,9 +725,9 @@ DEFUN (intmax, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} intmax () -@deftypefnx {} {} intmax ("@var{type}") -@deftypefnx {} {} intmax (@var{var}) +@deftypefn {} {@var{Imax} =} intmax () +@deftypefnx {} {@var{Imax} =} intmax ("@var{type}") +@deftypefnx {} {@var{Imax} =} intmax (@var{var}) Return the largest integer that can be represented by a specific integer type. The input is either a string @qcode{"@var{type}"} specifying an integer type, @@ -840,9 +839,9 @@ DEFUN (intmin, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} intmin () -@deftypefnx {} {} intmin ("@var{type}") -@deftypefnx {} {} intmin (@var{var}) +@deftypefn {} {@var{Imin} =} intmin () +@deftypefnx {} {@var{Imin} =} intmin ("@var{type}") +@deftypefnx {} {@var{Imin} =} intmin (@var{var}) Return the smallest integer that can be represented by a specific integer type. The input is either a string @qcode{"@var{type}"} specifying an integer type, @@ -954,13 +953,13 @@ DEFUN (sizemax, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} sizemax () +@deftypefn {} {@var{max_numel} =} sizemax () Return the largest value allowed for the size of an array. If Octave is compiled with 64-bit indexing, the result is of class int64, -otherwise it is of class int32. The maximum array size is slightly -smaller than the maximum value allowable for the relevant class as reported -by @code{intmax}. +otherwise it is of class int32. The maximum array size is slightly smaller +than the maximum value allowable for the relevant class as reported by +@code{intmax}. @seealso{intmax} @end deftypefn */) { diff -r 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/bsxfun.cc --- a/libinterp/corefcn/bsxfun.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/bsxfun.cc Mon Aug 29 13:58:00 2022 +0200 @@ -324,7 +324,7 @@ DEFMETHOD (bsxfun, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} bsxfun (@var{f}, @var{A}, @var{B}) +@deftypefn {} {@var{C} =} bsxfun (@var{f}, @var{A}, @var{B}) Apply a binary function @var{f} element-by-element to two array arguments @var{A} and @var{B}, expanding singleton dimensions in either input argument as necessary. @@ -343,16 +343,16 @@ if (args.length () != 3) print_usage (); - octave_value func = args(0); - if (func.is_string ()) + octave_value fcn = args(0); + if (fcn.is_string ()) { - std::string name = func.string_value (); + std::string name = fcn.string_value (); symbol_table& symtab = interp.get_symbol_table (); - func = symtab.find_function (name); + fcn = symtab.find_function (name); - if (func.is_undefined ()) + if (fcn.is_undefined ()) error ("bsxfun: invalid function name: %s", name.c_str ()); } else if (! (args(0).is_function_handle () || args(0).is_inline_function ())) @@ -363,14 +363,14 @@ const octave_value A = args(1); const octave_value B = args(2); - if (func.is_builtin_function () - || (func.is_function_handle () && ! A.isobject () && ! B.isobject ())) + if (fcn.is_builtin_function () + || (fcn.is_function_handle () && ! A.isobject () && ! B.isobject ())) { // This may break if the default behavior is overridden. But if you // override arithmetic operators for builtin classes, you should expect // mayhem anyway (constant folding etc). Querying is_overloaded() may // not be exactly what we need here. - octave_function *fcn_val = func.function_value (); + octave_function *fcn_val = fcn.function_value (); if (fcn_val) { octave_value tmp = maybe_optimized_builtin (fcn_val->name (), A, B); @@ -414,14 +414,14 @@ octave_value_list inputs (2); inputs(0) = A; inputs(1) = B; - retval = feval (func, inputs, 1); + retval = feval (fcn, inputs, 1); } else if (dvc.numel () < 1) { octave_value_list inputs (2); inputs(0) = A.resize (dvc); inputs(1) = B.resize (dvc); - retval = feval (func, inputs, 1); + retval = feval (fcn, inputs, 1); } else { @@ -463,7 +463,7 @@ if (maybe_update_column (Bc, B, dvb, dvc, i, idxB)) inputs(1) = Bc; - octave_value_list tmp = feval (func, inputs, 1); + octave_value_list tmp = feval (fcn, inputs, 1); #define BSXINIT(T, CLS, EXTRACTOR) \ (result_type == CLS) \ @@ -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. @@ -754,7 +756,7 @@ ## Test automatic bsxfun % %!test -%! funs = {@plus, @minus, @times, @rdivide, @ldivide, @power, @max, @min, ... +%! fcns = {@plus, @minus, @times, @rdivide, @ldivide, @power, @max, @min, ... %! @rem, @mod, @atan2, @hypot, @eq, @ne, @lt, @le, @gt, @ge, ... %! @and, @or, @xor }; %! @@ -770,28 +772,28 @@ %! x = rand (3) * 10-5; %! y = rand (3,1) * 10-5; %! -%! for i=1:length (funs) +%! for i=1:length (fcns) %! for j = 1:length (float_types) %! for k = 1:length (int_types) %! -%! fun = funs{i}; +%! fcn = fcns{i}; %! f_type = float_types{j}; %! i_type = int_types{k}; %! -%! assert (bsxfun (fun, f_type (x), i_type (y)), ... -%! fun (f_type(x), i_type (y))); -%! assert (bsxfun (fun, f_type (y), i_type (x)), ... -%! fun (f_type(y), i_type (x))); +%! assert (bsxfun (fcn, f_type (x), i_type (y)), ... +%! fcn (f_type(x), i_type (y))); +%! assert (bsxfun (fcn, f_type (y), i_type (x)), ... +%! fcn (f_type(y), i_type (x))); %! -%! assert (bsxfun (fun, i_type (x), i_type (y)), ... -%! fun (i_type (x), i_type (y))); -%! assert (bsxfun (fun, i_type (y), i_type (x)), ... -%! fun (i_type (y), i_type (x))); +%! assert (bsxfun (fcn, i_type (x), i_type (y)), ... +%! fcn (i_type (x), i_type (y))); +%! assert (bsxfun (fcn, i_type (y), i_type (x)), ... +%! fcn (i_type (y), i_type (x))); %! -%! assert (bsxfun (fun, f_type (x), f_type (y)), ... -%! fun (f_type (x), f_type (y))); -%! assert (bsxfun (fun, f_type(y), f_type(x)), ... -%! fun (f_type (y), f_type (x))); +%! assert (bsxfun (fcn, f_type (x), f_type (y)), ... +%! fcn (f_type (x), f_type (y))); +%! assert (bsxfun (fcn, f_type(y), f_type(x)), ... +%! fcn (f_type (y), f_type (x))); %! endfor %! endfor %! endfor @@ -813,6 +815,33 @@ %! r = bsxfun (@times, im, mask); %! assert (r(:,:,1), repmat (single ([0, 0, 1+i, 1+i]), [4, 1])); +## automatic broadcasting with inplace times operator +%!test <38466> +%! a = ones (2, 2, 2); +%! b = 2 * ones (2, 1); +%! a .*= b; +%! assert (a, 2 * ones (2, 2, 2)); + +%!test <38466> +%! a = ones (2, 2, 2); +%! b = 2 * ones (1, 2); +%! a .*= b; +%! assert (a, 2 * ones (2, 2, 2)); + +%!test <38466> +%! a = ones (2, 2, 2); +%! b = 2 * ones (2, 2); +%! a .*= b; +%! assert (a, 2 * ones (2, 2, 2)); + +%!test +%! a = ones (2, 2, 2); +%! b = 2 * ones (1, 1, 2); +%! a .*= b; +%! assert (a, 2 * ones (2, 2, 2)); + +%!assert (ones (2,2,2) .* ones (1,2), ones (2,2,2)); + */ OCTAVE_NAMESPACE_END diff -r 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/call-stack.cc --- a/libinterp/corefcn/call-stack.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/call-stack.cc Mon Aug 29 13:58:00 2022 +0200 @@ -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. @@ -1174,7 +1174,7 @@ @deftypefn {} {} who @deftypefnx {} {} who pattern @dots{} @deftypefnx {} {} who option pattern @dots{} -@deftypefnx {} {C =} who ("pattern", @dots{}) +@deftypefnx {} {C =} who (@dots{}) List currently defined variables matching the given patterns. Valid pattern syntax is the same as described for the @code{clear} command. diff -r 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/cellfun.cc --- a/libinterp/corefcn/cellfun.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/cellfun.cc Mon Aug 29 13:58:00 2022 +0200 @@ -71,7 +71,7 @@ get_output_list (error_system& es, octave_idx_type count, octave_idx_type nargout, const octave_value_list& inputlist, - octave_value& func, + octave_value& fcn, octave_value& error_handler) { octave_value_list tmp; @@ -80,14 +80,13 @@ try { - tmp = feval (func, inputlist, nargout); + tmp = feval (fcn, inputlist, nargout); } catch (const execution_exception& ee) { if (error_handler.is_defined ()) { - interpreter& interp - = __get_interpreter__ ("get_output_list"); + interpreter& interp = __get_interpreter__ (); es.save_exception (ee); interp.recover_from_exception (); @@ -270,20 +269,21 @@ DEFMETHOD (cellfun, interp, args, nargout, doc: /* -*- texinfo -*- -@deftypefn {} {} cellfun (@var{name}, @var{C}) -@deftypefnx {} {} cellfun ("size", @var{C}, @var{k}) -@deftypefnx {} {} cellfun ("isclass", @var{C}, @var{class}) -@deftypefnx {} {} cellfun (@var{func}, @var{C}) -@deftypefnx {} {} cellfun (@var{func}, @var{C}, @var{D}) -@deftypefnx {} {[@var{a}, @dots{}] =} cellfun (@dots{}) -@deftypefnx {} {} cellfun (@dots{}, "ErrorHandler", @var{errfunc}) -@deftypefnx {} {} cellfun (@dots{}, "UniformOutput", @var{val}) +@deftypefn {} {@var{A} =} cellfun ("@var{fcn}", @var{C}) +@deftypefnx {} {@var{A} =} cellfun ("size", @var{C}, @var{k}) +@deftypefnx {} {@var{A} =} cellfun ("isclass", @var{C}, @var{class}) +@deftypefnx {} {@var{A} =} cellfun (@@@var{fcn}, @var{C}) +@deftypefnx {} {@var{A} =} cellfun (@var{fcn}, @var{C}) +@deftypefnx {} {@var{A} =} cellfun (@var{fcn}, @var{C1}, @var{C2}, @dots{}) +@deftypefnx {} {[@var{A1}, @var{A2}, @dots{}] =} cellfun (@dots{}) +@deftypefnx {} {@var{A} =} cellfun (@dots{}, "ErrorHandler", @var{errfcn}) +@deftypefnx {} {@var{A} =} cellfun (@dots{}, "UniformOutput", @var{val}) -Evaluate the function named @var{name} on the elements of the cell array +Evaluate the function named "@var{fcn}" on the elements of the cell array @var{C}. Elements in @var{C} are passed on to the named function individually. The -function @var{name} can be one of the functions +function @var{fcn} can be one of the functions @table @code @item isempty @@ -316,11 +316,10 @@ Return 1 for elements of @var{class}. @end table -Additionally, @code{cellfun} accepts an arbitrary function @var{func} -in the form of an inline function, function handle, or the name of a -function (in a character string). The function can take one or more -arguments, with the inputs arguments given by @var{C}, @var{D}, etc. -Equally the function can return one or more output arguments. For example: +Additionally, @code{cellfun} accepts an arbitrary function @var{fcn} in the +form of an inline function, function handle, or the name of a function (in a +character string). The function can take one or more arguments, with the +inputs arguments given by @var{C1}, @var{C2}, etc. For example: @example @group @@ -329,9 +328,10 @@ @end group @end example -The number of output arguments of @code{cellfun} matches the number of -output arguments of the function. The outputs of the function will be -collected into the output arguments of @code{cellfun} like this: +The number of output arguments of @code{cellfun} matches the number of output +arguments of the function and can be greater than one. When there are multiple +outputs of the function they will be collected into the output arguments of +@code{cellfun} like this: @example @group @@ -348,14 +348,14 @@ @end group @end example -Note that per default the output argument(s) are arrays of the same size as +Note that, per default, the output argument(s) are arrays of the same size as the input arguments. Input arguments that are singleton (1x1) cells will be automatically expanded to the size of the other arguments. -If the parameter @qcode{"UniformOutput"} is set to true (the default), -then the function must return scalars which will be concatenated into the -return array(s). If @qcode{"UniformOutput"} is false, the outputs are -concatenated into a cell array (or cell arrays). For example: +If the parameter @qcode{"UniformOutput"} is set to true (the default), then the +function must return scalars which will be concatenated into the return +array(s). If @qcode{"UniformOutput"} is false, the outputs are concatenated +into a cell array (or cell arrays). For example: @example @group @@ -365,17 +365,17 @@ @end group @end example -Given the parameter @qcode{"ErrorHandler"}, then @var{errfunc} defines a -function to call in case @var{func} generates an error. The form of the +Given the parameter @qcode{"ErrorHandler"}, then @var{errfcn} defines a +function to call in case @var{fcn} generates an error. The form of the function is @example -function [@dots{}] = errfunc (@var{s}, @dots{}) +function [@dots{}] = errfcn (@var{s}, @dots{}) @end example @noindent -where there is an additional input argument to @var{errfunc} relative to -@var{func}, given by @var{s}. This is a structure with the elements +where there is an additional input argument to @var{errfcn} relative to +@var{fcn}, given by @var{s}. This is a structure with the elements @qcode{"identifier"}, @qcode{"message"}, and @qcode{"index"} giving respectively the error identifier, the error message, and the index into the input arguments of the element that caused the error. For example: @@ -388,18 +388,18 @@ @end group @end example -Use @code{cellfun} intelligently. The @code{cellfun} function is a -useful tool for avoiding loops. It is often used with anonymous -function handles; however, calling an anonymous function involves an -overhead quite comparable to the overhead of an m-file function. -Passing a handle to a built-in function is faster, because the -interpreter is not involved in the internal loop. For example: +Use @code{cellfun} intelligently. The @code{cellfun} function is a useful tool +for avoiding loops. It is often used with anonymous function handles; however, +calling an anonymous function involves an overhead quite comparable to the +overhead of an m-file function. Passing a handle to a built-in function is +faster, because the interpreter is not involved in the internal loop. For +example: @example @group -a = @{@dots{}@} -v = cellfun (@@(x) det (x), a); # compute determinants -v = cellfun (@@det, a); # faster +C = @{@dots{}@} +v = cellfun (@@(x) det (x), C); # compute determinants +v = cellfun (@@det, C); # 40% faster @end group @end example @@ -417,11 +417,11 @@ octave_value_list retval; int nargout1 = (nargout < 1 ? 1 : nargout); - octave_value func = args(0); + octave_value fcn = args(0); symbol_table& symtab = interp.get_symbol_table (); - if (func.is_string ()) + if (fcn.is_string ()) { retval = try_cellfun_internal_ops (args, nargin); @@ -433,18 +433,18 @@ std::string name = args(0).string_value (); if (! valid_identifier (name)) - func = get_function_handle (interp, args(0), "x"); + fcn = get_function_handle (interp, args(0), "x"); else { - func = symtab.find_function (name); + fcn = symtab.find_function (name); - if (func.is_undefined ()) + if (fcn.is_undefined ()) error ("cellfun: invalid function NAME: %s", name.c_str ()); } } - if (! func.is_function_handle () && ! func.is_inline_function () - && ! func.is_function ()) + if (! fcn.is_function_handle () && ! fcn.is_inline_function () + && ! fcn.is_function ()) error ("cellfun: argument NAME must be a string or function handle"); bool uniform_output = true; @@ -456,7 +456,7 @@ // more specific function class, so this can result in fewer polymorphic // function calls as the function gets called for each value of the array. { - if (func.is_function_handle () || func.is_inline_function ()) + if (fcn.is_function_handle () || fcn.is_inline_function ()) { // FIXME: instead of checking for overloaded functions as we did // previously but is no longer possible, we could check whether @@ -466,7 +466,7 @@ goto nevermind; } - std::string name = func.function_value () -> name (); + std::string name = fcn.function_value () -> name (); octave_value f = symtab.find_function (name); if (f.is_defined ()) @@ -489,7 +489,7 @@ // Okay, we tried, doesn't work, let's do the best we can instead // and avoid polymorphic calls for each element of the array. - func = f; + fcn = f; } } @@ -559,7 +559,7 @@ } const octave_value_list tmp - = get_output_list (es, count, nargout, inputlist, func, + = get_output_list (es, count, nargout, inputlist, fcn, error_handler); int tmp_numel = tmp.length (); @@ -645,7 +645,7 @@ } const octave_value_list tmp - = get_output_list (es, count, nargout, inputlist, func, + = get_output_list (es, count, nargout, inputlist, fcn, error_handler); if (nargout > 0 && tmp.length () < nargout) @@ -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; */ @@ -1026,31 +1055,38 @@ DEFMETHOD (arrayfun, interp, args, nargout, doc: /* -*- texinfo -*- -@deftypefn {} {} arrayfun (@var{func}, @var{A}) -@deftypefnx {} {@var{x} =} arrayfun (@var{func}, @var{A}) -@deftypefnx {} {@var{x} =} arrayfun (@var{func}, @var{A}, @var{b}, @dots{}) -@deftypefnx {} {[@var{x}, @var{y}, @dots{}] =} arrayfun (@var{func}, @var{A}, @dots{}) -@deftypefnx {} {} arrayfun (@dots{}, "UniformOutput", @var{val}) -@deftypefnx {} {} arrayfun (@dots{}, "ErrorHandler", @var{errfunc}) +@deftypefn {} {@var{B} =} arrayfun (@var{fcn}, @var{A}) +@deftypefnx {} {@var{B} =} arrayfun (@var{fcn}, @var{A1}, @var{A2}, @dots{}) +@deftypefnx {} {[@var{B1}, @var{B2}, @dots{}] =} arrayfun (@var{fcn}, @var{A}, @dots{}) +@deftypefnx {} {@var{B} =} arrayfun (@dots{}, "UniformOutput", @var{val}) +@deftypefnx {} {@var{B} =} arrayfun (@dots{}, "ErrorHandler", @var{errfcn}) Execute a function on each element of an array. This is useful for functions that do not accept array arguments. If the -function does accept array arguments it is better to call the function +function does accept array arguments it is @emph{better} to call the function directly. -The first input argument @var{func} can be a string, a function -handle, an inline function, or an anonymous function. The input -argument @var{A} can be a logic array, a numeric array, a string -array, a structure array, or a cell array. By a call of the function -@code{arrayfun} all elements of @var{A} are passed on to the named -function @var{func} individually. +The first input argument @var{fcn} can be a string, a function handle, an +inline function, or an anonymous function. The input argument @var{A} can be a +logical array, a numeric array, a string array, a structure array, or a cell +array. @code{arrayfun} passes all elements of @var{A} individually to the +function @var{fcn} and collects the results. The equivalent pseudo-code is -The named function can also take more than two input arguments, with -the input arguments given as third input argument @var{b}, fourth -input argument @var{c}, @dots{} If given more than one array input -argument then all input arguments must have the same sizes, for -example: +@example +@group +cls = class (@var{fcn} (@var{A}(1)); +@var{B} = zeros (size (@var{A}), cls); +for i = 1:numel (@var{A}) + @var{B}(i) = @var{fcn} (@var{A}(i)) +endfor +@end group +@end example + +The named function can also take more than two input arguments, with the input +arguments given as third input argument @var{A2}, fourth input argument +@var{A2}, @dots{} If given more than one array input argument then all input +arguments must have the same sizes. For example: @example @group @@ -1061,10 +1097,10 @@ If the parameter @var{val} after a further string input argument @qcode{"UniformOutput"} is set @code{true} (the default), then the named -function @var{func} must return a single element which then will be -concatenated into the return value and is of type matrix. Otherwise, -if that parameter is set to @code{false}, then the outputs are -concatenated in a cell array. For example: +function @var{fcn} must return a single element which then will be concatenated +into the return value and is of type matrix. Otherwise, if that parameter is +set to @code{false}, then the outputs are concatenated in a cell array. For +example: @example @group @@ -1078,9 +1114,8 @@ @end group @end example -If more than one output arguments are given then the named function -must return the number of return values that also are expected, for -example: +If more than one output arguments are given then the named function must return +the number of return values that also are expected, for example: @example @group @@ -1104,25 +1139,24 @@ @end group @end example -If the parameter @var{errfunc} after a further string input argument +If the parameter @var{errfcn} after a further string input argument @qcode{"ErrorHandler"} is another string, a function handle, an inline -function, or an anonymous function, then @var{errfunc} defines a -function to call in the case that @var{func} generates an error. -The definition of the function must be of the form +function, or an anonymous function, then @var{errfcn} defines a function to +call in the case that @var{fcn} generates an error. The definition of the +function must be of the form @example -function [@dots{}] = errfunc (@var{s}, @dots{}) +function [@dots{}] = errfcn (@var{s}, @dots{}) @end example @noindent -where there is an additional input argument to @var{errfunc} -relative to @var{func}, given by @var{s}. This is a structure with -the elements @qcode{"identifier"}, @qcode{"message"}, and -@qcode{"index"} giving, respectively, the error identifier, the error -message, and the index of the array elements that caused the error. The -size of the output argument of @var{errfunc} must have the same size as the -output argument of @var{func}, otherwise a real error is thrown. For -example: +where there is an additional input argument to @var{errfcn} relative to +@var{fcn}, given by @var{s}. This is a structure with the elements +@qcode{"identifier"}, @qcode{"message"}, and @qcode{"index"} giving, +respectively, the error identifier, the error message, and the index of the +array elements that caused the error. The size of the output argument of +@var{errfcn} must have the same size as the output argument of @var{fcn}, +otherwise a real error is thrown. For example: @example @group @@ -1147,22 +1181,22 @@ octave_value_list retval; int nargout1 = (nargout < 1 ? 1 : nargout); bool symbol_table_lookup = false; - octave_value func = args(0); + octave_value fcn = args(0); symbol_table& symtab = interp.get_symbol_table (); - if (func.is_string ()) + if (fcn.is_string ()) { // See if we can convert the string into a function. std::string name = args(0).string_value (); if (! valid_identifier (name)) - func = get_function_handle (interp, args(0), "x"); + fcn = get_function_handle (interp, args(0), "x"); else { - func = symtab.find_function (name); + fcn = symtab.find_function (name); - if (func.is_undefined ()) + if (fcn.is_undefined ()) error_with_id ("Octave:invalid-input-arg", "arrayfun: invalid function NAME: %s", name.c_str ()); @@ -1171,8 +1205,8 @@ } } - if (func.is_function_handle () || func.is_inline_function () - || func.is_function ()) + if (fcn.is_function_handle () || fcn.is_inline_function () + || fcn.is_function ()) { // The following is an optimization because the symbol table can give a // more specific function class, so this can result in fewer polymorphic @@ -1180,7 +1214,7 @@ if (! symbol_table_lookup) { - if (func.is_function_handle () || func.class_name () == "inline") + if (fcn.is_function_handle () || fcn.class_name () == "inline") { // FIXME: instead of checking for overloaded functions as // we did previously but is no longer possible, we could @@ -1192,10 +1226,10 @@ } octave_value f - = symtab.find_function (func.function_value () -> name ()); + = symtab.find_function (fcn.function_value () -> name ()); if (f.is_defined ()) - func = f; + fcn = f; } nevermind: @@ -1266,7 +1300,7 @@ } const octave_value_list tmp - = get_output_list (es, count, nargout, inputlist, func, + = get_output_list (es, count, nargout, inputlist, fcn, error_handler); if (nargout > 0 && tmp.length () < nargout) @@ -1358,7 +1392,7 @@ } const octave_value_list tmp - = get_output_list (es, count, nargout, inputlist, func, + = get_output_list (es, count, nargout, inputlist, fcn, error_handler); if (nargout > 0 && tmp.length () < nargout) @@ -1537,19 +1571,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 +1607,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 +1652,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 +1995,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 +2052,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 +2116,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 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/chol.cc --- a/libinterp/corefcn/chol.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/chol.cc Mon Aug 29 13:58:00 2022 +0200 @@ -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)) @@ -359,7 +360,7 @@ DEFUN (cholinv, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} cholinv (@var{A}) +@deftypefn {} {@var{Ainv} =} cholinv (@var{A}) Compute the inverse of the symmetric positive definite matrix @var{A} using the Cholesky@tie{}factorization. @seealso{chol, chol2inv, inv} @@ -483,13 +484,13 @@ DEFUN (chol2inv, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} chol2inv (@var{U}) +@deftypefn {} {@var{Ainv} =} chol2inv (@var{R}) Invert a symmetric, positive definite square matrix from its Cholesky -decomposition, @var{U}. +decomposition, @var{R}. -Note that @var{U} should be an upper-triangular matrix with positive -diagonal elements. @code{chol2inv (@var{U})} provides -@code{inv (@var{U}'*@var{U})} but it is much faster than using @code{inv}. +Note that @var{R} should be an upper-triangular matrix with positive diagonal +elements. @code{chol2inv (@var{U})} provides @code{inv (@var{R}'*@var{R})} but +is much faster than using @code{inv}. @seealso{chol, cholinv, inv} @end deftypefn */) { diff -r 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/conv2.cc --- a/libinterp/corefcn/conv2.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/conv2.cc Mon Aug 29 13:58:00 2022 +0200 @@ -40,9 +40,9 @@ DEFUN (conv2, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} conv2 (@var{A}, @var{B}) -@deftypefnx {} {} conv2 (@var{v1}, @var{v2}, @var{m}) -@deftypefnx {} {} conv2 (@dots{}, @var{shape}) +@deftypefn {} {@var{C} =} conv2 (@var{A}, @var{B}) +@deftypefnx {} {@var{C} =} conv2 (@var{v1}, @var{v2}, @var{m}) +@deftypefnx {} {@var{C} =} conv2 (@dots{}, @var{shape}) Return the 2-D convolution of @var{A} and @var{B}. The size of the result is determined by the optional @var{shape} argument diff -r 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/daspk.cc --- a/libinterp/corefcn/daspk.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/daspk.cc Mon Aug 29 13:58:00 2022 +0200 @@ -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; @@ -367,11 +367,11 @@ double tzero = out_times (0); - DAEFunc func (daspk_user_function); + DAEFunc fcn (daspk_user_function); if (daspk_jac.is_defined ()) - func.set_jacobian_function (daspk_user_jacobian); + fcn.set_jacobian_function (daspk_user_jacobian); - DASPK dae (state, deriv, tzero, func); + DASPK dae (state, deriv, tzero, fcn); dae.set_options (daspk_opts); Matrix output; diff -r 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/dasrt.cc --- a/libinterp/corefcn/dasrt.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/dasrt.cc Mon Aug 29 13:58:00 2022 +0200 @@ -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; @@ -432,7 +432,7 @@ if (dasrt_fcn.is_undefined ()) error ("dasrt: FCN argument is not a valid function name or handle"); - DAERTFunc func (dasrt_user_f); + DAERTFunc fcn (dasrt_user_f); argp++; @@ -457,7 +457,7 @@ { argp++; - func.set_constraint_function (dasrt_user_cf); + fcn.set_constraint_function (dasrt_user_cf); } } @@ -485,11 +485,11 @@ } if (dasrt_jac.is_defined ()) - func.set_jacobian_function (dasrt_user_j); + fcn.set_jacobian_function (dasrt_user_j); DASRT_result output; - DASRT dae = DASRT (state, stateprime, tzero, func); + DASRT dae = DASRT (state, stateprime, tzero, fcn); dae.set_options (dasrt_opts); diff -r 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/dassl.cc --- a/libinterp/corefcn/dassl.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/dassl.cc Mon Aug 29 13:58:00 2022 +0200 @@ -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; @@ -367,11 +367,11 @@ double tzero = out_times (0); - DAEFunc func (dassl_user_function); + DAEFunc fcn (dassl_user_function); if (dassl_jac.is_defined ()) - func.set_jacobian_function (dassl_user_jacobian); + fcn.set_jacobian_function (dassl_user_jacobian); - DASSL dae (state, deriv, tzero, func); + DASSL dae (state, deriv, tzero, fcn); dae.set_options (dassl_opts); diff -r 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/data.cc --- a/libinterp/corefcn/data.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/data.cc Mon Aug 29 13:58:00 2022 +0200 @@ -70,14 +70,14 @@ DEFUN (all, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} all (@var{x}) -@deftypefnx {} {} all (@var{x}, @var{dim}) +@deftypefn {} {@var{tf} =} all (@var{x}) +@deftypefnx {} {@var{tf} =} all (@var{x}, @var{dim}) For a vector argument, return true (logical 1) if all elements of the vector are nonzero. -For a matrix argument, return a row vector of logical ones and -zeros with each element indicating whether all of the elements of the -corresponding column of the matrix are nonzero. For example: +For a matrix argument, return a row vector of logical ones and zeros with each +element indicating whether all of the elements of the corresponding column of +the matrix are nonzero. For example: @example @group @@ -86,8 +86,7 @@ @end group @end example -If the optional argument @var{dim} is supplied, work along dimension -@var{dim}. +If the optional argument @var{dim} is supplied, work along dimension @var{dim}. @seealso{any} @end deftypefn */) { @@ -128,14 +127,14 @@ DEFUN (any, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} any (@var{x}) -@deftypefnx {} {} any (@var{x}, @var{dim}) +@deftypefn {} {@var{tf} =} any (@var{x}) +@deftypefnx {} {@var{tf} =} any (@var{x}, @var{dim}) For a vector argument, return true (logical 1) if any element of the vector is nonzero. -For a matrix argument, return a row vector of logical ones and -zeros with each element indicating whether any of the elements of the -corresponding column of the matrix are nonzero. For example: +For a matrix argument, return a row vector of logical ones and zeros with each +element indicating whether any of the elements of the corresponding column of +the matrix are nonzero. For example: @example @group @@ -144,8 +143,8 @@ @end group @end example -If the optional argument @var{dim} is supplied, work along dimension -@var{dim}. For example: +If the optional argument @var{dim} is supplied, work along dimension @var{dim}. +For example: @example @group @@ -195,13 +194,13 @@ DEFUN (atan2, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} atan2 (@var{y}, @var{x}) -Compute atan (@var{y} / @var{x}) for corresponding elements of @var{y} -and @var{x}. - -@var{y} and @var{x} must match in size and orientation. The signs of -elements of @var{y} and @var{x} are used to determine the quadrants of each -resulting value. +@deftypefn {} {@var{angle} =} atan2 (@var{y}, @var{x}) +Compute atan (@var{y} / @var{x}) for corresponding elements of @var{y} and +@var{x}. + +@var{y} and @var{x} must match in size and orientation. The signs of elements +of @var{y} and @var{x} are used to determine the quadrants of each resulting +value. This function is equivalent to @code{arg (complex (@var{x}, @var{y}))}. @seealso{tan, tand, tanh, atanh} @@ -365,8 +364,8 @@ DEFUN (hypot, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} hypot (@var{x}, @var{y}) -@deftypefnx {} {} hypot (@var{x}, @var{y}, @var{z}, @dots{}) +@deftypefn {} {@var{h} =} hypot (@var{x}, @var{y}) +@deftypefnx {} {@var{h} =} hypot (@var{x}, @var{y}, @var{z}, @dots{}) Compute the element-by-element square root of the sum of the squares of @var{x} and @var{y}. @@ -571,7 +570,7 @@ DEFUN (rem, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} rem (@var{x}, @var{y}) +@deftypefn {} {@var{r} =} rem (@var{x}, @var{y}) Return the remainder of the division @code{@var{x} / @var{y}}. The remainder is computed using the expression @@ -703,8 +702,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 @@ -750,7 +751,7 @@ DEFUN (mod, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} mod (@var{x}, @var{y}) +@deftypefn {} {@var{m} =} mod (@var{x}, @var{y}) Compute the modulo of @var{x} and @var{y}. Conceptually this is given by @@ -995,8 +996,8 @@ DEFUN (cumprod, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} cumprod (@var{x}) -@deftypefnx {} {} cumprod (@var{x}, @var{dim}) +@deftypefn {} {@var{y} =} cumprod (@var{x}) +@deftypefnx {} {@var{y} =} cumprod (@var{x}, @var{dim}) Cumulative product of elements along dimension @var{dim}. If @var{dim} is omitted, it defaults to the first non-singleton dimension. @@ -1020,12 +1021,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]) @@ -1038,10 +1042,10 @@ DEFUN (cumsum, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} cumsum (@var{x}) -@deftypefnx {} {} cumsum (@var{x}, @var{dim}) -@deftypefnx {} {} cumsum (@dots{}, "native") -@deftypefnx {} {} cumsum (@dots{}, "double") +@deftypefn {} {@var{y} =} cumsum (@var{x}) +@deftypefnx {} {@var{y} =} cumsum (@var{x}, @var{dim}) +@deftypefnx {} {@var{y} =} cumsum (@dots{}, "native") +@deftypefnx {} {@var{y} =} cumsum (@dots{}, "double") Cumulative sum of elements along dimension @var{dim}. If @var{dim} is omitted, it defaults to the first non-singleton dimension. @@ -1170,12 +1174,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 +1261,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 +1320,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]) @@ -1320,10 +1346,10 @@ DEFUN (prod, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} prod (@var{x}) -@deftypefnx {} {} prod (@var{x}, @var{dim}) -@deftypefnx {} {} prod (@dots{}, "native") -@deftypefnx {} {} prod (@dots{}, "double") +@deftypefn {} {@var{y} =} prod (@var{x}) +@deftypefnx {} {@var{y} =} prod (@var{x}, @var{dim}) +@deftypefnx {} {@var{y} =} prod (@dots{}, "native") +@deftypefnx {} {@var{y} =} prod (@dots{}, "double") Product of elements along dimension @var{dim}. If @var{dim} is omitted, it defaults to the first non-singleton dimension. @@ -1464,14 +1490,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 +1535,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)) @@ -1651,7 +1680,7 @@ std::string cname = ov.class_name (); - symbol_table& symtab = __get_symbol_table__ ("attempt_type_conversion"); + symbol_table& symtab = __get_symbol_table__ (); octave_value fcn = symtab.find_method (dtype, cname); @@ -1717,7 +1746,7 @@ std::string dtype = get_dispatch_type (ovl); - symbol_table& symtab = __get_symbol_table__ ("do_class_concat"); + symbol_table& symtab = __get_symbol_table__ (); octave_value fcn = symtab.find_method (cattype, dtype); @@ -1996,7 +2025,7 @@ DEFUN (horzcat, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} horzcat (@var{array1}, @var{array2}, @dots{}, @var{arrayN}) +@deftypefn {} {@var{A} =} horzcat (@var{array1}, @var{array2}, @dots{}, @var{arrayN}) Return the horizontal concatenation of N-D array objects, @var{array1}, @var{array2}, @dots{}, @var{arrayN} along dimension 2. @@ -2004,8 +2033,11 @@ new matrices. For example: @example -@var{hcat} = [ @var{array1}, @var{array2}, @dots{} ] +@var{A} = [ @var{array1}, @var{array2}, @dots{} ] @end example + +This syntax is slightly more efficient because the Octave parser can +concatenate the arrays without the overhead of a function call. @seealso{cat, vertcat} @end deftypefn */) { @@ -2235,7 +2267,7 @@ DEFUN (vertcat, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} vertcat (@var{array1}, @var{array2}, @dots{}, @var{arrayN}) +@deftypefn {} {@var{A} =} vertcat (@var{array1}, @var{array2}, @dots{}, @var{arrayN}) Return the vertical concatenation of N-D array objects, @var{array1}, @var{array2}, @dots{}, @var{arrayN} along dimension 1. @@ -2243,8 +2275,11 @@ new matrices. For example: @example -@var{vcat} = [ @var{array1}; @var{array2}; @dots{} ] +@var{A} = [ @var{array1}; @var{array2}; @dots{} ] @end example + +This syntax is slightly more efficient because the Octave parser can +concatenate the arrays without the overhead of a function call. @seealso{cat, horzcat} @end deftypefn */) { @@ -2254,14 +2289,15 @@ /* %!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, , doc: /* -*- texinfo -*- -@deftypefn {} {} cat (@var{dim}, @var{array1}, @var{array2}, @dots{}, @var{arrayN}) -Return the concatenation of N-D array objects, @var{array1}, -@var{array2}, @dots{}, @var{arrayN} along dimension @var{dim}. +@deftypefn {} {@var{A} =} cat (@var{dim}, @var{array1}, @var{array2}, @dots{}, @var{arrayN}) +Return the concatenation of N-D array objects, @var{array1}, @var{array2}, +@dots{}, @var{arrayN} along dimension @var{dim}. @example @group @@ -2273,8 +2309,8 @@ @end group @end example -Alternatively, we can concatenate @var{A} and @var{B} along the -second dimension in the following way: +Alternatively, we can concatenate @var{A} and @var{B} along the second +dimension in the following way: @example @group @@ -2282,9 +2318,8 @@ @end group @end example -@var{dim} can be larger than the dimensions of the N-D array objects -and the result will thus have @var{dim} dimensions as the -following example shows: +@var{dim} can be larger than the dimensions of the N-D array objects and the +result will thus have @var{dim} dimensions as the following example shows: @example @group @@ -2321,11 +2356,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 +2377,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 +2396,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 +2413,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 @@ -2482,7 +2529,7 @@ DEFUN (permute, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} permute (@var{A}, @var{perm}) +@deftypefn {} {@var{B} =} permute (@var{A}, @var{perm}) Return the generalized transpose for an N-D array object @var{A}. The permutation vector @var{perm} must contain the elements @@ -2515,7 +2562,7 @@ DEFUN (ipermute, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} ipermute (@var{A}, @var{iperm}) +@deftypefn {} {@var{A} =} ipermute (@var{B}, @var{iperm}) The inverse of the @code{permute} function. The expression @@ -2534,13 +2581,13 @@ DEFUN (length, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} length (@var{a}) -Return the length of the object @var{a}. +@deftypefn {} {@var{n} =} length (@var{A}) +Return the length of the object @var{A}. The length is 0 for empty objects, 1 for scalars, and the number of elements for vectors. For matrix or N-dimensional objects, the length is the number of elements along the largest dimension -(equivalent to @w{@code{max (size (@var{a}))}}). +(equivalent to @w{@code{max (size (@var{A}))}}). @seealso{numel, size} @end deftypefn */) { @@ -2552,12 +2599,12 @@ DEFUN (ndims, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} ndims (@var{a}) -Return the number of dimensions of @var{a}. +@deftypefn {} {@var{n} =} ndims (@var{A}) +Return the number of dimensions of @var{A}. For any array, the result will always be greater than or equal to 2. -Trailing singleton dimensions are not counted, i.e., tailing dimensions @var{d} -greater than 2, for which @code{size (@var{a}, @var{d}) = 1}. +Trailing singleton dimensions are not counted, i.e., trailing dimensions @var{d} +greater than 2 for which @code{size (@var{A}, @var{d}) = 1}. @example @group @@ -2592,15 +2639,15 @@ DEFUN (numel, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} numel (@var{a}) -@deftypefnx {} {} numel (@var{a}, @var{idx1}, @var{idx2}, @dots{}) -Return the number of elements in the object @var{a}. +@deftypefn {} {@var{n} =} numel (@var{A}) +@deftypefnx {} {@var{n} =} numel (@var{A}, @var{idx1}, @var{idx2}, @dots{}) +Return the number of elements in the object @var{A}. Optionally, if indices @var{idx1}, @var{idx2}, @dots{} are supplied, return the number of elements that would result from the indexing @example -@var{a}(@var{idx1}, @var{idx2}, @dots{}) +@var{A}(@var{idx1}, @var{idx2}, @dots{}) @end example Note that the indices do not have to be scalar numbers. For example, @@ -2620,8 +2667,8 @@ @example @group -@var{a} = ones (5, 3); -numel (@var{a}, 2, ":") +@var{A} = ones (5, 3); +numel (@var{A}, 2, ":") @end group @end example @@ -2654,12 +2701,12 @@ DEFUN (size, args, nargout, doc: /* -*- texinfo -*- -@deftypefn {} {@var{sz} =} size (@var{a}) -@deftypefnx {} {@var{dim_sz} =} size (@var{a}, @var{dim}) -@deftypefnx {} {@var{dim_sz} =} size (@var{a}, @var{d1}, @var{d2}, @dots{}) +@deftypefn {} {@var{sz} =} size (@var{A}) +@deftypefnx {} {@var{dim_sz} =} size (@var{A}, @var{dim}) +@deftypefnx {} {@var{dim_sz} =} size (@var{A}, @var{d1}, @var{d2}, @dots{}) @deftypefnx {} {[@var{rows}, @var{cols}, @dots{}, @var{dim_N_sz}] =} size (@dots{}) Return a row vector with the size (number of elements) of each dimension for -the object @var{a}. +the object @var{A}. When given a second argument, @var{dim}, return the size of the corresponding dimension. If @var{dim} is a vector, return each of the corresponding @@ -2669,7 +2716,7 @@ with multiple output arguments, @code{size} returns the size of dimension N in the Nth argument. The number of rows, dimension 1, is returned in the first argument, the number of columns, dimension 2, is returned in the -second argument, etc. If there are more dimensions in @var{a} than there are +second argument, etc. If there are more dimensions in @var{A} than there are output arguments, @code{size} returns the total number of elements in the remaining dimensions in the final output argument. @@ -2863,7 +2910,8 @@ DEFUN (size_equal, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} size_equal (@var{a}, @var{b}, @dots{}) +@deftypefn {} {@var{TF} =} size_equal (@var{A}, @var{B}) +@deftypefnx {} {@var{TF} =} size_equal (@var{A}, @var{B}, @dots{}) Return true if the dimensions of all arguments agree. Trailing singleton dimensions are ignored. When called with a single argument, @@ -2891,8 +2939,8 @@ DEFUN (nnz, args, , doc: /* -*- texinfo -*- -@deftypefn {} {@var{n} =} nnz (@var{a}) -Return the number of nonzero elements in @var{a}. +@deftypefn {} {@var{n} =} nnz (@var{A}) +Return the number of nonzero elements in @var{A}. @seealso{nzmax, nonzeros, find} @end deftypefn */) { @@ -2940,9 +2988,10 @@ DEFUN (rows, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} rows (@var{a}) -Return the number of rows of @var{a}. This is equivalent to -@code{size (@var{a}, 1)}. +@deftypefn {} {@var{nr} =} rows (@var{A}) +Return the number of rows of @var{A}. + +This is equivalent to @code{size (@var{A}, 1)}. @seealso{columns, size, length, numel, isscalar, isvector, ismatrix} @end deftypefn */) { @@ -2984,9 +3033,10 @@ DEFUN (columns, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} columns (@var{a}) -Return the number of columns of @var{a}. This is equivalent to -@code{size (@var{a}, 2)}. +@deftypefn {} {@var{nc} =} columns (@var{A}) +Return the number of columns of @var{A}. + +This is equivalent to @code{size (@var{A}, 2)}. @seealso{rows, size, length, numel, isscalar, isvector, ismatrix} @end deftypefn */) { @@ -3001,11 +3051,11 @@ DEFUN (sum, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} sum (@var{x}) -@deftypefnx {} {} sum (@var{x}, @var{dim}) -@deftypefnx {} {} sum (@dots{}, "native") -@deftypefnx {} {} sum (@dots{}, "double") -@deftypefnx {} {} sum (@dots{}, "extra") +@deftypefn {} {@var{y} =} sum (@var{x}) +@deftypefnx {} {@var{y} =} sum (@var{x}, @var{dim}) +@deftypefnx {} {@var{y} =} sum (@dots{}, "native") +@deftypefnx {} {@var{y} =} sum (@dots{}, "double") +@deftypefnx {} {@var{y} =} sum (@dots{}, "extra") Sum of elements along dimension @var{dim}. If @var{dim} is omitted, it defaults to the first non-singleton dimension. @@ -3173,7 +3223,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]) @@ -3231,8 +3282,8 @@ DEFUN (sumsq, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} sumsq (@var{x}) -@deftypefnx {} {} sumsq (@var{x}, @var{dim}) +@deftypefn {} {@var{y} =} sumsq (@var{x}) +@deftypefnx {} {@var{y} =} sumsq (@var{x}, @var{dim}) Sum of squares of elements along dimension @var{dim}. If @var{dim} is omitted, it defaults to the first non-singleton dimension. @@ -3271,8 +3322,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 +3352,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 +3410,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 +3440,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. @@ -3407,8 +3458,8 @@ DEFUN (complex, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} complex (@var{x}) -@deftypefnx {} {} complex (@var{re}, @var{im}) +@deftypefn {} {@var{z} =} complex (@var{x}) +@deftypefnx {} {@var{z} =} complex (@var{re}, @var{im}) Return a complex value from real arguments. With 1 real argument @var{x}, return the complex result @@ -3428,6 +3479,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 +3622,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 +3639,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 +3654,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 +3680,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 +3696,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 +3713,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 +3769,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,8 +3785,8 @@ DEFUN (isempty, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} isempty (@var{a}) -Return true if @var{a} is an empty matrix (any one of its dimensions is +@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} @end deftypefn */) @@ -3749,7 +3804,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 +3837,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 +3876,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 +3917,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 +3966,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 +4015,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 +4064,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 @@ -4093,7 +4148,12 @@ dims.resize (nargin); for (int i = 0; i < nargin; i++) - dims(i) = (args(i).isempty () ? 0 : args(i).idx_type_value (true)); + { + if (args(i).numel () > 1) + error ("%s: dimensions must be scalars.", fcn); + + dims(i) = (args(i).isempty () ? 0 : args(i).idx_type_value (true)); + } } break; } @@ -4245,7 +4305,12 @@ dims.resize (nargin); for (int i = 0; i < nargin; i++) - dims(i) = (args(i).isempty () ? 0 : args(i).idx_type_value (true)); + { + if (args(i).numel () > 1) + error ("%s: dimensions must be scalars.", fcn); + + dims(i) = (args(i).isempty () ? 0 : args(i).idx_type_value (true)); + } } break; } @@ -4327,7 +4392,12 @@ dims.resize (nargin); for (int i = 0; i < nargin; i++) - dims(i) = (args(i).isempty () ? 0 : args(i).idx_type_value (true)); + { + if (args(i).numel () > 1) + error ("%s: dimensions must be scalars.", fcn); + + dims(i) = (args(i).isempty () ? 0 : args(i).idx_type_value (true)); + } } break; } @@ -4391,7 +4461,12 @@ dims.resize (nargin); for (int i = 0; i < nargin; i++) - dims(i) = (args(i).isempty () ? 0 : args(i).idx_type_value (true)); + { + if (args(i).numel () > 1) + error ("%s: dimensions must be scalars.", fcn); + + dims(i) = (args(i).isempty () ? 0 : args(i).idx_type_value (true)); + } } break; } @@ -4469,7 +4544,12 @@ dims.resize (nargin); for (int i = 0; i < nargin; i++) - dims(i) = (args(i).isempty () ? 0 : args(i).idx_type_value (true)); + { + if (args(i).numel () > 1) + error ("%s: dimensions must be scalars.", fcn); + + dims(i) = (args(i).isempty () ? 0 : args(i).idx_type_value (true)); + } } break; } @@ -4563,6 +4643,10 @@ %!error ones (1, 1.1) %!error ones ([1, 1.1]) %!error ones (3, 3, 3, "like", speye (1)) +%!error ones (1:3, 1) +%!error ones (1, 1:3) +%!error ones (1, 2, 1:3) +%!error ones (1:3, 1, "like", single (1)) */ /* @@ -4571,14 +4655,14 @@ ## n to be a 1x0 vector (returns 0x0) but not a 0x1 vector. Octave supports ## any vector and therefore must support 0x1, 1x0, and 0x0x1 (but not 0x1x1). %!test <*47298> -%! funcs = {@zeros, @ones, @inf, @nan, @NA, @i, @pi, @e}; -%! for idx = 1:numel (funcs) -%! func = funcs{idx}; -%! assert (func (zeros (1, 0)), zeros (0, 0)); -%! assert (func (zeros (0, 1)), zeros (0, 0)); -%! assert (func (zeros (0, 1, 1)), zeros (0, 0)); -%! fail ([func2str(func) " ([])"]); -%! fail ([func2str(func) " (zeros (0, 0, 1))"]); +%! fcns = {@zeros, @ones, @inf, @nan, @NA, @i, @pi, @e}; +%! for idx = 1:numel (fcns) +%! fcn = fcns{idx}; +%! assert (fcn (zeros (1, 0)), zeros (0, 0)); +%! assert (fcn (zeros (0, 1)), zeros (0, 0)); +%! assert (fcn (zeros (0, 1, 1)), zeros (0, 0)); +%! fail ([func2str(fcn) " ([])"]); +%! fail ([func2str(fcn) " (zeros (0, 0, 1))"]); %! endfor */ @@ -4644,6 +4728,10 @@ %!error zeros (1, 1.1, 2) %!error zeros ([1, 1.1, 2]) %!error zeros (3, 3, 3, "like", speye (1)) +%!error zeros (1:3, 1) +%!error zeros (1, 1:3) +%!error zeros (1, 2, 1:3) +%!error zeros (1:3, 1, "like", single (1)) */ DEFUN (Inf, args, , @@ -4651,11 +4739,11 @@ @c List other form of function in documentation index @findex inf -@deftypefn {} {} Inf -@deftypefnx {} {} Inf (@var{n}) -@deftypefnx {} {} Inf (@var{n}, @var{m}) -@deftypefnx {} {} Inf (@var{n}, @var{m}, @var{k}, @dots{}) -@deftypefnx {} {} Inf (@dots{}, @var{class}) +@deftypefn {} {@var{A} =} Inf +@deftypefnx {} {@var{A} =} Inf (@var{n}) +@deftypefnx {} {@var{A} =} Inf (@var{n}, @var{m}) +@deftypefnx {} {@var{A} =} Inf (@var{n}, @var{m}, @var{k}, @dots{}) +@deftypefnx {} {@var{A} =} Inf (@dots{}, @var{class}) Return a scalar, matrix or N-dimensional array whose elements are all equal to the IEEE representation for positive infinity. @@ -4696,7 +4784,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]) @@ -4704,7 +4793,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)) @@ -4715,6 +4805,10 @@ %!error Inf (3, 4, 5, "int8") %!error Inf (3, 3, "like", true) %!error Inf (2, "like", uint8 (1)) +%!error Inf (1:3, 1) +%!error Inf (1, 1:3) +%!error Inf (1, 2, 1:3) +%!error Inf (1:3, 1, "like", single (1)) */ DEFUN (NaN, args, , @@ -4775,14 +4869,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])) @@ -4794,15 +4890,19 @@ %!error NaN (3, 4, 5, "int8") %!error NaN (3, 3, "like", true) %!error NaN (2, "like", uint8 (1)) +%!error NaN (1:3, 1) +%!error NaN (1, 1:3) +%!error NaN (1, 2, 1:3) +%!error NaN (1:3, 1, "like", single (1)) */ DEFUN (e, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} e -@deftypefnx {} {} e (@var{n}) -@deftypefnx {} {} e (@var{n}, @var{m}) -@deftypefnx {} {} e (@var{n}, @var{m}, @var{k}, @dots{}) -@deftypefnx {} {} e (@dots{}, @var{class}) +@deftypefn {} {@var{A} =} e +@deftypefnx {} {@var{A} =} e (@var{n}) +@deftypefnx {} {@var{A} =} e (@var{n}, @var{m}) +@deftypefnx {} {@var{A} =} e (@var{n}, @var{m}, @var{k}, @dots{}) +@deftypefnx {} {@var{A} =} e (@dots{}, @var{class}) Return a scalar, matrix, or N-dimensional array whose elements are all equal to the base of natural logarithms. @@ -4816,15 +4916,15 @@ When called with no arguments, return a scalar with the value @math{e}. -When called with a single argument, return a square matrix with the -dimension specified. +When called with a single argument, return a square matrix with the dimension +specified. When called with more than one scalar argument the first two arguments are taken as the number of rows and columns and any further arguments specify additional matrix dimensions. -The optional argument @var{class} specifies the return type and may be -either @qcode{"double"} or @qcode{"single"}. +The optional argument @var{class} specifies the return type and may be either +@qcode{"double"} or @qcode{"single"}. @seealso{log, exp, pi, I} @end deftypefn */) { @@ -4864,11 +4964,11 @@ DEFUN (eps, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} eps -@deftypefnx {} {} eps (@var{x}) -@deftypefnx {} {} eps (@var{n}, @var{m}) -@deftypefnx {} {} eps (@var{n}, @var{m}, @var{k}, @dots{}) -@deftypefnx {} {} eps (@dots{}, @var{class}) +@deftypefn {} {@var{d} =} eps +@deftypefnx {} {@var{d} =} eps (@var{x}) +@deftypefnx {} {@var{d} =} eps (@var{n}, @var{m}) +@deftypefnx {} {@var{d} =} eps (@var{n}, @var{m}, @var{k}, @dots{}) +@deftypefnx {} {@var{d} =} eps (@dots{}, @var{class}) Return a scalar, matrix or N-dimensional array whose elements are all eps, the machine precision. @@ -4933,7 +5033,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))) @@ -4944,17 +5044,21 @@ %!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])) +%!error eps (1:3, 1) +%!error eps (1, 1:3) +%!error eps (1, 2, 1:3) +%!error eps (1:3, 1, "single") */ DEFUN (pi, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} pi -@deftypefnx {} {} pi (@var{n}) -@deftypefnx {} {} pi (@var{n}, @var{m}) -@deftypefnx {} {} pi (@var{n}, @var{m}, @var{k}, @dots{}) -@deftypefnx {} {} pi (@dots{}, @var{class}) +@deftypefn {} {@var{p} =} pi +@deftypefnx {} {@var{p} =} pi (@var{n}) +@deftypefnx {} {@var{p} =} pi (@var{n}, @var{m}) +@deftypefnx {} {@var{p} =} pi (@var{n}, @var{m}, @var{k}, @dots{}) +@deftypefnx {} {@var{p} =} pi (@dots{}, @var{class}) Return a scalar, matrix, or N-dimensional array whose elements are all equal to the ratio of the circumference of a circle to its @tex @@ -4964,8 +5068,6 @@ diameter. @end ifnottex -Internally, @code{pi} is computed as @samp{4.0 * atan (1.0)}. - When called with no arguments, return a scalar with the value of @tex $\pi$. @@ -4974,15 +5076,15 @@ pi. @end ifnottex -When called with a single argument, return a square matrix with the -dimension specified. +When called with a single argument, return a square matrix with the dimension +specified. When called with more than one scalar argument the first two arguments are taken as the number of rows and columns and any further arguments specify additional matrix dimensions. -The optional argument @var{class} specifies the return type and may be -either @qcode{"double"} or @qcode{"single"}. +The optional argument @var{class} specifies the return type and may be either +@qcode{"double"} or @qcode{"single"}. @seealso{e, I} @end deftypefn */) { @@ -4997,11 +5099,11 @@ DEFUN (realmax, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} realmax -@deftypefnx {} {} realmax (@var{n}) -@deftypefnx {} {} realmax (@var{n}, @var{m}) -@deftypefnx {} {} realmax (@var{n}, @var{m}, @var{k}, @dots{}) -@deftypefnx {} {} realmax (@dots{}, @var{class}) +@deftypefn {} {@var{Rmax} =} realmax +@deftypefnx {} {@var{Rmax} =} realmax (@var{n}) +@deftypefnx {} {@var{Rmax} =} realmax (@var{n}, @var{m}) +@deftypefnx {} {@var{Rmax} =} realmax (@var{n}, @var{m}, @var{k}, @dots{}) +@deftypefnx {} {@var{Rmax} =} realmax (@dots{}, @var{class}) Return a scalar, matrix, or N-dimensional array whose elements are all equal to the largest floating point number that is representable. @@ -5036,16 +5138,16 @@ DEFUN (realmin, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} realmin -@deftypefnx {} {} realmin (@var{n}) -@deftypefnx {} {} realmin (@var{n}, @var{m}) -@deftypefnx {} {} realmin (@var{n}, @var{m}, @var{k}, @dots{}) -@deftypefnx {} {} realmin (@dots{}, @var{class}) +@deftypefn {} {@var{Rmin} =} realmin +@deftypefnx {} {@var{Rmin} =} realmin (@var{n}) +@deftypefnx {} {@var{Rmin} =} realmin (@var{n}, @var{m}) +@deftypefnx {} {@var{Rmin} =} realmin (@var{n}, @var{m}, @var{k}, @dots{}) +@deftypefnx {} {@var{Rmin} =} realmin (@dots{}, @var{class}) Return a scalar, matrix, or N-dimensional array whose elements are all equal to the smallest normalized floating point number that is representable. -The actual value is system dependent. On machines that support -IEEE floating point arithmetic, @code{realmin} is approximately +The actual value is system dependent. On machines that support IEEE floating +point arithmetic, @code{realmin} is approximately @tex $2.2251\times10^{-308}$ for double precision and $1.1755\times10^{-38}$ @end tex @@ -5057,15 +5159,15 @@ When called with no arguments, return a scalar with the value @code{realmin (@qcode{"double"})}. -When called with a single argument, return a square matrix with the -dimension specified. +When called with a single argument, return a square matrix with the dimension +specified. When called with more than one scalar argument the first two arguments are taken as the number of rows and columns and any further arguments specify additional matrix dimensions. -The optional argument @var{class} specifies the return type and may be -either @qcode{"double"} or @qcode{"single"}. +The optional argument @var{class} specifies the return type and may be either +@qcode{"double"} or @qcode{"single"}. @seealso{realmax, intmin, eps} @end deftypefn */) { @@ -5080,11 +5182,11 @@ @findex j @findex J -@deftypefn {} {} I -@deftypefnx {} {} I (@var{n}) -@deftypefnx {} {} I (@var{n}, @var{m}) -@deftypefnx {} {} I (@var{n}, @var{m}, @var{k}, @dots{}) -@deftypefnx {} {} I (@dots{}, @var{class}) +@deftypefn {} {@var{A} =} I +@deftypefnx {} {@var{A} =} I (@var{n}) +@deftypefnx {} {@var{A} =} I (@var{n}, @var{m}) +@deftypefnx {} {@var{A} =} I (@var{n}, @var{m}, @var{k}, @dots{}) +@deftypefnx {} {@var{A} =} I (@dots{}, @var{class}) Return a scalar, matrix, or N-dimensional array whose elements are all equal to the pure imaginary unit, defined as @tex @@ -5188,6 +5290,9 @@ %!error false (2, 3, "double") %!error false (2, 1, "like", sparse (1)) +%!error false (1:3, 1) +%!error false (1, 1:3) +%!error false (1, 2, 1:3) */ DEFUN (true, args, , @@ -5220,6 +5325,9 @@ %!error true (2, 3, "double") %!error true (2, 1, "like", double (1)) +%!error true (1:3, 1) +%!error true (1, 1:3) +%!error true (1, 2, 1:3) */ template @@ -5335,10 +5443,10 @@ DEFUN (eye, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} eye (@var{n}) -@deftypefnx {} {} eye (@var{m}, @var{n}) -@deftypefnx {} {} eye ([@var{m} @var{n}]) -@deftypefnx {} {} eye (@dots{}, @var{class}) +@deftypefn {} {@var{I} =} eye (@var{n}) +@deftypefnx {} {@var{I} =} eye (@var{m}, @var{n}) +@deftypefnx {} {@var{I} =} eye ([@var{m} @var{n}]) +@deftypefnx {} {@var{I} =} eye (@dots{}, @var{class}) Return an identity matrix. If invoked with a single scalar argument @var{n}, return a square @@ -5485,8 +5593,8 @@ DEFUN (linspace, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} linspace (@var{start}, @var{end}) -@deftypefnx {} {} linspace (@var{start}, @var{end}, @var{n}) +@deftypefn {} {@var{y} =} linspace (@var{start}, @var{end}) +@deftypefnx {} {@var{y} =} linspace (@var{start}, @var{end}, @var{n}) Return a row vector with @var{n} linearly spaced elements between @var{start} and @var{end}. @@ -5662,19 +5770,19 @@ DEFUN (resize, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} resize (@var{x}, @var{m}) -@deftypefnx {} {} resize (@var{x}, @var{m}, @var{n}, @dots{}) -@deftypefnx {} {} resize (@var{x}, [@var{m} @var{n} @dots{}]) -Resize @var{x} cutting off elements as necessary. +@deftypefn {} {@var{B} =} resize (@var{A}, @var{m}) +@deftypefnx {} {@var{B} =} resize (@var{A}, @var{m}, @var{n}, @dots{}) +@deftypefnx {} {@var{B} =} resize (@var{A}, [@var{m} @var{n} @dots{}]) +Resize @var{A} cutting off elements as necessary. In the result, element with certain indices is equal to the corresponding -element of @var{x} if the indices are within the bounds of @var{x}; -otherwise, the element is set to zero. +element of @var{A} if the indices are within the bounds of @var{A}; otherwise, +the element is set to zero. In other words, the statement @example -y = resize (x, dv) +B = resize (A, dv) @end example @noindent @@ -5682,28 +5790,27 @@ @example @group -y = zeros (dv, class (x)); -sz = min (dv, size (x)); +B = zeros (dv, class (A)); +sz = min (dv, size (A)); for i = 1:length (sz) idx@{i@} = 1:sz(i); endfor -y(idx@{:@}) = x(idx@{:@}); +B(idx@{:@}) = A(idx@{:@}); @end group @end example @noindent but is performed more efficiently. -If only @var{m} is supplied, and it is a scalar, the dimension of the -result is @var{m}-by-@var{m}. -If @var{m}, @var{n}, @dots{} are all scalars, then the dimensions of -the result are @var{m}-by-@var{n}-by-@dots{}. -If given a vector as input, then the -dimensions of the result are given by the elements of that vector. - -An object can be resized to more dimensions than it has; -in such case the missing dimensions are assumed to be 1. -Resizing an object to fewer dimensions is not possible. +If only @var{m} is supplied, and it is a scalar, the dimension of the result is +@var{m}-by-@var{m}. If @var{m}, @var{n}, @dots{} are all scalars, then the +dimensions of the result are @var{m}-by-@var{n}-by-@dots{}. If given a vector +as input, then the dimensions of the result are given by the elements of that +vector. + +An object can be resized to more dimensions than it has; in such case the +missing dimensions are assumed to be 1. Resizing an object to fewer dimensions +is not possible. @seealso{reshape, postpad, prepad, cat} @end deftypefn */) { @@ -5752,10 +5859,10 @@ DEFUN (reshape, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} reshape (@var{A}, @var{m}, @var{n}, @dots{}) -@deftypefnx {} {} reshape (@var{A}, [@var{m} @var{n} @dots{}]) -@deftypefnx {} {} reshape (@var{A}, @dots{}, [], @dots{}) -@deftypefnx {} {} reshape (@var{A}, @var{size}) +@deftypefn {} {@var{B} =} reshape (@var{A}, @var{m}, @var{n}, @dots{}) +@deftypefnx {} {@var{B} =} reshape (@var{A}, [@var{m} @var{n} @dots{}]) +@deftypefnx {} {@var{B} =} reshape (@var{A}, @dots{}, [], @dots{}) +@deftypefnx {} {@var{B} =} reshape (@var{A}, @var{size}) Return a matrix with the specified dimensions (@var{m}, @var{n}, @dots{}) whose elements are taken from the matrix @var{A}. @@ -5950,8 +6057,8 @@ DEFUN (squeeze, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} squeeze (@var{x}) -Remove singleton dimensions from @var{x} and return the result. +@deftypefn {} {@var{B} =} squeeze (@var{A}) +Remove singleton dimensions from @var{A} and return the result. Note that for compatibility with @sc{matlab}, all objects have a minimum of two dimensions and row vectors are left unchanged. @@ -5968,7 +6075,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {@var{FM} =} full (@var{SM}) Return a full storage matrix from a sparse, diagonal, or permutation matrix, -or a range. +or from a range. @seealso{sparse, issparse} @end deftypefn */) { @@ -5982,9 +6089,9 @@ DEFUN (norm, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} norm (@var{A}) -@deftypefnx {} {} norm (@var{A}, @var{p}) -@deftypefnx {} {} norm (@var{A}, @var{p}, @var{opt}) +@deftypefn {} {@var{n} =} norm (@var{A}) +@deftypefnx {} {@var{n} =} norm (@var{A}, @var{p}) +@deftypefnx {} {@var{n} =} norm (@var{A}, @var{p}, @var{opt}) Compute the p-norm of the matrix @var{A}. If the second argument is not given, @w{@code{p = 2}} is used. @@ -6244,8 +6351,8 @@ DEFUN (uplus, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} uplus (@var{x}) -This function and @w{@tcode{+ @var{x}}} are equivalent. +@deftypefn {} {@var{B} =} uplus (@var{A}) +This function and @w{@tcode{+ @var{A}}} are equivalent. @seealso{uminus, plus} @end deftypefn */) { @@ -6254,8 +6361,8 @@ DEFUN (uminus, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} uminus (@var{x}) -This function and @w{@tcode{- @var{x}}} are equivalent. +@deftypefn {} {@var{B} =} uminus (@var{A}) +This function and @w{@tcode{- @var{A}}} are equivalent. @seealso{uplus, minus} @end deftypefn */) { @@ -6264,10 +6371,10 @@ DEFUN (transpose, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} transpose (@var{x}) -Return the transpose of @var{x}. - -This function and @tcode{@var{x}.'@:} are equivalent. +@deftypefn {} {@var{B} =} transpose (@var{A}) +Return the transpose of @var{A}. + +This function and @tcode{@var{A}.'@:} are equivalent. @seealso{ctranspose} @end deftypefn */) { @@ -6296,10 +6403,10 @@ DEFUN (ctranspose, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} ctranspose (@var{x}) -Return the complex conjugate transpose of @var{x}. - -This function and @tcode{@var{x}'} are equivalent. +@deftypefn {} {@var{B} =} ctranspose (@var{A}) +Return the complex conjugate transpose of @var{A}. + +This function and @tcode{@var{A}'} are equivalent. @seealso{transpose} @end deftypefn */) { @@ -6363,15 +6470,15 @@ DEFUN (plus, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} plus (@var{x}, @var{y}) -@deftypefnx {} {} plus (@var{x1}, @var{x2}, @dots{}) -This function and @w{@tcode{@var{x} + @var{y}}} are equivalent. +@deftypefn {} {@var{C} =} plus (@var{A}, @var{B}) +@deftypefnx {} {@var{C} =} plus (@var{A1}, @var{A2}, @dots{}) +This function and @w{@tcode{@var{A} + @var{B}}} are equivalent. If more arguments are given, the summation is applied cumulatively from left to right: @example -(@dots{}((@var{x1} + @var{x2}) + @var{x3}) + @dots{}) +(@dots{}((@var{A1} + @var{A2}) + @var{A3}) + @dots{}) @end example @seealso{minus, uplus} @@ -6394,8 +6501,8 @@ DEFUN (minus, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} minus (@var{x}, @var{y}) -This function and @w{@tcode{@var{x} - @var{y}}} are equivalent. +@deftypefn {} {@var{C} =} minus (@var{A}, @var{B}) +This function and @w{@tcode{@var{A} - @var{B}}} are equivalent. @seealso{plus, uminus} @end deftypefn */) { @@ -6404,16 +6511,16 @@ DEFUN (mtimes, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} mtimes (@var{x}, @var{y}) -@deftypefnx {} {} mtimes (@var{x1}, @var{x2}, @dots{}) +@deftypefn {} {@var{C} =} mtimes (@var{A}, @var{B}) +@deftypefnx {} {@var{C} =} mtimes (@var{A1}, @var{A2}, @dots{}) Return the matrix multiplication product of inputs. -This function and @w{@tcode{@var{x} * @var{y}}} are equivalent. +This function and @w{@tcode{@var{A} * @var{B}}} are equivalent. If more arguments are given, the multiplication is applied cumulatively from left to right: @example -(@dots{}((@var{x1} * @var{x2}) * @var{x3}) * @dots{}) +(@dots{}((@var{A1} * @var{A2}) * @var{A3}) * @dots{}) @end example @seealso{times, plus, minus, rdivide, mrdivide, mldivide, mpower} @@ -6425,10 +6532,10 @@ DEFUN (mrdivide, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} mrdivide (@var{x}, @var{y}) -Return the matrix right division of @var{x} and @var{y}. - -This function and @w{@tcode{@var{x} / @var{y}}} are equivalent. +@deftypefn {} {@var{C} =} mrdivide (@var{A}, @var{B}) +Return the matrix right division of @var{A} and @var{B}. + +This function and @w{@tcode{@var{A} / @var{B}}} are equivalent. If the system is not square, or if the coefficient matrix is singular, a minimum norm solution is computed. @@ -6440,10 +6547,10 @@ DEFUN (mpower, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} mpower (@var{x}, @var{y}) -Return the matrix power operation of @var{x} raised to the @var{y} power. - -This function and @w{@tcode{@var{x} ^ @var{y}}} are equivalent. +@deftypefn {} {@var{C} =} mpower (@var{A}, @var{B}) +Return the matrix power operation of @var{A} raised to the @var{B} power. + +This function and @w{@tcode{@var{A} ^ @var{B}}} are equivalent. @seealso{power, mtimes, plus, minus} @end deftypefn */) { @@ -6452,10 +6559,10 @@ DEFUN (mldivide, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} mldivide (@var{x}, @var{y}) -Return the matrix left division of @var{x} and @var{y}. - -This function and @w{@tcode{@var{x} @backslashchar{} @var{y}}} are equivalent. +@deftypefn {} {@var{C} =} mldivide (@var{A}, @var{B}) +Return the matrix left division of @var{A} and @var{B}. + +This function and @w{@tcode{@var{A} @backslashchar{} @var{B}}} are equivalent. If the system is not square, or if the coefficient matrix is singular, a minimum norm solution is computed. @@ -6467,8 +6574,8 @@ DEFUN (lt, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} lt (@var{x}, @var{y}) -This function is equivalent to @w{@code{@var{x} < @var{y}}}. +@deftypefn {} {@var{TF} =} lt (@var{A}, @var{B}) +This function is equivalent to @w{@code{@var{A} < @var{B}}}. @seealso{le, eq, ge, gt, ne} @end deftypefn */) { @@ -6477,8 +6584,8 @@ DEFUN (le, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} le (@var{x}, @var{y}) -This function is equivalent to @w{@code{@var{x} <= @var{y}}}. +@deftypefn {} {@var{TF} =} le (@var{A}, @var{B}) +This function is equivalent to @w{@code{@var{A} <= @var{B}}}. @seealso{eq, ge, gt, ne, lt} @end deftypefn */) { @@ -6487,10 +6594,10 @@ DEFUN (eq, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} eq (@var{x}, @var{y}) +@deftypefn {} {@var{TF} =} eq (@var{A}, @var{B}) Return true if the two inputs are equal. -This function is equivalent to @w{@code{@var{x} == @var{y}}}. +This function is equivalent to @w{@code{@var{A} == @var{B}}}. @seealso{ne, isequal, le, ge, gt, ne, lt} @end deftypefn */) { @@ -6499,8 +6606,8 @@ DEFUN (ge, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} ge (@var{x}, @var{y}) -This function is equivalent to @w{@code{@var{x} >= @var{y}}}. +@deftypefn {} {@var{TF} =} ge (@var{A}, @var{B}) +This function is equivalent to @w{@code{@var{A} >= @var{B}}}. @seealso{le, eq, gt, ne, lt} @end deftypefn */) { @@ -6509,8 +6616,8 @@ DEFUN (gt, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} gt (@var{x}, @var{y}) -This function is equivalent to @w{@code{@var{x} > @var{y}}}. +@deftypefn {} {@var{TF} =} gt (@var{A}, @var{B}) +This function is equivalent to @w{@code{@var{A} > @var{B}}}. @seealso{le, eq, ge, ne, lt} @end deftypefn */) { @@ -6519,10 +6626,10 @@ DEFUN (ne, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} ne (@var{x}, @var{y}) +@deftypefn {} {@var{TF} =} ne (@var{A}, @var{B}) Return true if the two inputs are not equal. -This function is equivalent to @w{@code{@var{x} != @var{y}}}. +This function is equivalent to @w{@code{@var{A} != @var{B}}}. @seealso{eq, isequal, le, ge, lt} @end deftypefn */) { @@ -6531,16 +6638,16 @@ DEFUN (times, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} times (@var{x}, @var{y}) -@deftypefnx {} {} times (@var{x1}, @var{x2}, @dots{}) +@deftypefn {} {@var{C} =} times (@var{A}, @var{B}) +@deftypefnx {} {@var{C} =} times (@var{A1}, @var{A2}, @dots{}) Return the element-by-element multiplication product of inputs. -This function and @w{@tcode{@var{x} .* @var{y}}} are equivalent. +This function and @w{@tcode{@var{A} .* @var{B}}} are equivalent. If more arguments are given, the multiplication is applied cumulatively from left to right: @example -(@dots{}((@var{x1} .* @var{x2}) .* @var{x3}) .* @dots{}) +(@dots{}((@var{A1} .* @var{A2}) .* @var{A3}) .* @dots{}) @end example @seealso{mtimes, rdivide} @@ -6552,10 +6659,10 @@ DEFUN (rdivide, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} rdivide (@var{x}, @var{y}) -Return the element-by-element right division of @var{x} and @var{y}. - -This function and @w{@tcode{@var{x} ./ @var{y}}} are equivalent. +@deftypefn {} {@var{C} =} rdivide (@var{A}, @var{B}) +Return the element-by-element right division of @var{A} and @var{B}. + +This function and @w{@tcode{@var{A} ./ @var{B}}} are equivalent. @seealso{ldivide, mrdivide, times, plus} @end deftypefn */) { @@ -6564,11 +6671,11 @@ DEFUN (power, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} power (@var{x}, @var{y}) -Return the element-by-element operation of @var{x} raised to the -@var{y} power. - -This function and @w{@tcode{@var{x} .^ @var{y}}} are equivalent. +@deftypefn {} {@var{C} =} power (@var{A}, @var{B}) +Return the element-by-element operation of @var{A} raised to the +@var{B} power. + +This function and @w{@tcode{@var{A} .^ @var{B}}} are equivalent. If several complex results are possible, returns the one with smallest non-negative argument (angle). Use @code{realpow}, @code{realsqrt}, @@ -6582,10 +6689,10 @@ DEFUN (ldivide, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} ldivide (@var{x}, @var{y}) -Return the element-by-element left division of @var{x} and @var{y}. - -This function and @w{@tcode{@var{x} .@backslashchar{} @var{y}}} are +@deftypefn {} {@var{C} =} ldivide (@var{A}, @var{B}) +Return the element-by-element left division of @var{A} and @var{B}. + +This function and @w{@tcode{@var{A} .@backslashchar{} @var{B}}} are equivalent. @seealso{rdivide, mldivide, times, plus} @end deftypefn */) @@ -6595,8 +6702,8 @@ DEFUN (and, args, , doc: /* -*- texinfo -*- -@deftypefn {} {@var{z} =} and (@var{x}, @var{y}) -@deftypefnx {} {@var{z} =} and (@var{x1}, @var{x2}, @dots{}) +@deftypefn {} {@var{TF} =} and (@var{x}, @var{y}) +@deftypefnx {} {@var{TF} =} and (@var{x1}, @var{x2}, @dots{}) Return the logical AND of @var{x} and @var{y}. This function is equivalent to the operator syntax @@ -6616,8 +6723,8 @@ DEFUN (or, args, , doc: /* -*- texinfo -*- -@deftypefn {} {@var{z} =} or (@var{x}, @var{y}) -@deftypefnx {} {@var{z} =} or (@var{x1}, @var{x2}, @dots{}) +@deftypefn {} {@var{TF} =} or (@var{x}, @var{y}) +@deftypefnx {} {@var{TF} =} or (@var{x1}, @var{x2}, @dots{}) Return the logical OR of @var{x} and @var{y}. This function is equivalent to the operator syntax @@ -7007,16 +7114,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 @@ -7026,16 +7143,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 @@ -7048,10 +7175,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 @@ -7060,14 +7191,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); @@ -7082,14 +7221,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); @@ -7105,14 +7252,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])); @@ -7145,13 +7300,12 @@ // specified by @var{mode}, which can either be 'ascend' or 'descend' // and return the index vector corresponding to the sort order. // -// This function does not yet support sparse matrices. - -// FIXME: Is this function used anymore? 12/14/2015 +// FIXME: This function does not yet support sparse matrices. + DEFUN (__sort_rows_idx__, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} __sort_rows_idx__ (@var{a}, @var{mode}) -Undocumented internal function. +@deftypefn {} {@var{idx} =} __sort_rows_idx__ (@var{A}, @var{mode}) +Called internally from @file{sortrows.m}. @end deftypefn */) { int nargin = args.length (); @@ -7212,17 +7366,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} @@ -7341,8 +7495,8 @@ DEFUN (nth_element, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} nth_element (@var{x}, @var{n}) -@deftypefnx {} {} nth_element (@var{x}, @var{n}, @var{dim}) +@deftypefn {} {@var{nel} =} nth_element (@var{x}, @var{n}) +@deftypefnx {} {@var{nel} =} nth_element (@var{x}, @var{n}, @var{dim}) Select the n-th smallest element of a vector, using the ordering defined by @code{sort}. @@ -7562,7 +7716,7 @@ } static octave_value_list -do_accumarray_minmax_fun (const octave_value_list& args, +do_accumarray_minmax_fcn (const octave_value_list& args, bool ismin) { int nargin = args.length (); @@ -7637,7 +7791,7 @@ } catch (const index_exception& ie) { - error ("do_accumarray_minmax_fun: invalid index %s", ie.what ()); + error ("do_accumarray_minmax_fcn: invalid index %s", ie.what ()); } return retval; @@ -7649,7 +7803,7 @@ Undocumented internal function. @end deftypefn */) { - return do_accumarray_minmax_fun (args, true); + return do_accumarray_minmax_fcn (args, true); } DEFUN (__accumarray_max__, args, , @@ -7658,7 +7812,7 @@ Undocumented internal function. @end deftypefn */) { - return do_accumarray_minmax_fun (args, false); + return do_accumarray_minmax_fcn (args, false); } template @@ -7816,8 +7970,8 @@ DEFUN (merge, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} merge (@var{mask}, @var{tval}, @var{fval}) -@deftypefnx {} {} ifelse (@var{mask}, @var{tval}, @var{fval}) +@deftypefn {} {@var{M} =} merge (@var{mask}, @var{tval}, @var{fval}) +@deftypefnx {} {@var{M} =} ifelse (@var{mask}, @var{tval}, @var{fval}) Merge elements of @var{true_val} and @var{false_val}, depending on the value of @var{mask}. @@ -7935,7 +8089,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--; } @@ -7948,7 +8102,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--; } @@ -8047,9 +8201,9 @@ DEFUN (diff, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} diff (@var{x}) -@deftypefnx {} {} diff (@var{x}, @var{k}) -@deftypefnx {} {} diff (@var{x}, @var{k}, @var{dim}) +@deftypefn {} {@var{y} =} diff (@var{x}) +@deftypefnx {} {@var{y} =} diff (@var{x}, @var{k}) +@deftypefnx {} {@var{y} =} diff (@var{x}, @var{k}, @var{dim}) If @var{x} is a vector of length @math{n}, @w{@code{diff (@var{x})}} is the vector of first differences @tex @@ -8128,7 +8282,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; @@ -8156,7 +8311,7 @@ DEFUN (repelems, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} repelems (@var{x}, @var{r}) +@deftypefn {} {@var{y} =} repelems (@var{x}, @var{r}) Construct a vector of repeated elements from @var{x}. @var{r} is a 2x@var{N} integer matrix specifying which elements to repeat diff -r 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/debug.cc --- a/libinterp/corefcn/debug.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/debug.cc Mon Aug 29 13:58:00 2022 +0200 @@ -78,13 +78,13 @@ DEFMETHOD (dbstop, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} dbstop @var{func} -@deftypefnx {} {} dbstop @var{func} @var{line} -@deftypefnx {} {} dbstop @var{func} @var{line1} @var{line2} @dots{} +@deftypefn {} {} dbstop @var{fcn} +@deftypefnx {} {} dbstop @var{fcn} @var{line} +@deftypefnx {} {} dbstop @var{fcn} @var{line1} @var{line2} @dots{} @deftypefnx {} {} dbstop @var{line1} @dots{} -@deftypefnx {} {} dbstop in @var{func} -@deftypefnx {} {} dbstop in @var{func} at @var{line} -@deftypefnx {} {} dbstop in @var{func} at @var{line} if "@var{condition}" +@deftypefnx {} {} dbstop in @var{fcn} +@deftypefnx {} {} dbstop in @var{fcn} at @var{line} +@deftypefnx {} {} dbstop in @var{fcn} at @var{line} if "@var{condition}" @deftypefnx {} {} dbstop in @var{class} at @var{method} @deftypefnx {} {} dbstop if @var{event} @deftypefnx {} {} dbstop if @var{event} @var{ID} @@ -93,16 +93,16 @@ Set breakpoints for the built-in debugger. -@var{func} is the name of a function on the current @code{path}. When -already in debug mode the @var{func} argument can be omitted and the current +@var{fcn} is the name of a function on the current @code{path}. When +already in debug mode the @var{fcn} argument can be omitted and the current function will be used. Breakpoints at subfunctions are set with the scope operator @samp{>}. For example, If @file{file.m} has a subfunction -@code{func2}, then a breakpoint in @code{func2} can be specified by -@code{file>func2}. +@code{fcn2}, then a breakpoint in @code{fcn2} can be specified by +@code{file>fcn2}. @var{line} is the line number at which to break. If @var{line} is not specified, it defaults to the first executable line in the file -@file{func.m}. Multiple lines can be specified in a single command; when +@file{fcn.m}. Multiple lines can be specified in a single command; when function syntax is used, the lines may also be passed as a single vector argument (@code{[@var{line1}, @var{line2}, @dots{}]}). @@ -111,24 +111,24 @@ @var{condition} will be evaluated, and execution will stop if @var{condition} is true. If @var{condition} cannot be evaluated, for example because it refers to an undefined variable, an error will be thrown. - Expressions with side effects (such as @code{y++ > 1}) will alter -variables, and should generally be avoided. Conditions containing quotes -(@samp{"}, @samp{'}) or comment characters (@samp{#}, @samp{%}) must be -enclosed in quotes. (This does not apply to conditions entered from the -editor's context menu.) For example: +Expressions with side effects (such as @code{y++ > 1}) will alter variables, +and should generally be avoided. Conditions containing quotes (@samp{"}, +@samp{'}) or comment characters (@samp{#}, @samp{%}) must be enclosed in +quotes. (This does not apply to conditions entered from the editor's context +menu.) For example: @example dbstop in axis at 246 if 'any (opt == "x")' @end example -The form specifying @var{event} does not cause a specific breakpoint at a -given function and line number. Instead it causes debug mode to be entered -when certain unexpected events are encountered. Possible values are +The form specifying @var{event} does not cause a specific breakpoint at a given +function and line number. Instead it causes debug mode to be entered when +certain unexpected events are encountered. Possible values are @table @code @item error -Stop when an error is reported. This is equivalent to specifying -both @code{debug_on_error (true)} and @code{debug_on_interrupt (true)}. +Stop when an error is reported. This is equivalent to specifying both +@code{debug_on_error (true)} and @code{debug_on_interrupt (true)}. @item caught error Stop when an error is caught by a try-catch block (not yet implemented). @@ -145,10 +145,9 @@ @end table The events @code{error}, @code{caught error}, and @code{warning} can all be -followed by a string specifying an error ID or warning ID@. If that is -done, only errors with the specified ID will cause execution to stop. To -stop on one of a set of IDs, multiple @code{dbstop} commands must be -issued. +followed by a string specifying an error ID or warning ID@. If that is done, +only errors with the specified ID will cause execution to stop. To stop on one +of a set of IDs, multiple @code{dbstop} commands must be issued. Breakpoints and events can be removed using the @code{dbclear} command with the same syntax. @@ -158,11 +157,11 @@ The optional output @var{rline} is the real line number where the breakpoint was set. This can differ from the specified line if the line is not -executable. For example, if a breakpoint attempted on a blank line then -Octave will set the real breakpoint at the next executable line. +executable. For example, if a breakpoint attempted on a blank line then Octave +will set the real breakpoint at the next executable line. -When a file is re-parsed, such as when it is modified outside the GUI, -all breakpoints within the file are cleared. +When a file is re-parsed, such as when it is modified outside the GUI, all +breakpoints within the file are cleared. @seealso{dbclear, dbstatus, dbstep, debug_on_error, debug_on_warning, debug_on_interrupt} @@ -256,26 +255,26 @@ DEFMETHOD (dbclear, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} dbclear @var{func} -@deftypefnx {} {} dbclear @var{func} @var{line} -@deftypefnx {} {} dbclear @var{func} @var{line1} @var{line2} @dots{} +@deftypefn {} {} dbclear @var{fcn} +@deftypefnx {} {} dbclear @var{fcn} @var{line} +@deftypefnx {} {} dbclear @var{fcn} @var{line1} @var{line2} @dots{} @deftypefnx {} {} dbclear @var{line} @dots{} @deftypefnx {} {} dbclear all -@deftypefnx {} {} dbclear in @var{func} -@deftypefnx {} {} dbclear in @var{func} at @var{line} +@deftypefnx {} {} dbclear in @var{fcn} +@deftypefnx {} {} dbclear in @var{fcn} at @var{line} @deftypefnx {} {} dbclear if @var{event} -@deftypefnx {} {} dbclear ("@var{func}") -@deftypefnx {} {} dbclear ("@var{func}", @var{line}) -@deftypefnx {} {} dbclear ("@var{func}", @var{line1}, @var{line2}, @dots{}) -@deftypefnx {} {} dbclear ("@var{func}", @var{line1}, @dots{}) +@deftypefnx {} {} dbclear ("@var{fcn}") +@deftypefnx {} {} dbclear ("@var{fcn}", @var{line}) +@deftypefnx {} {} dbclear ("@var{fcn}", @var{line1}, @var{line2}, @dots{}) +@deftypefnx {} {} dbclear ("@var{fcn}", @var{line1}, @dots{}) @deftypefnx {} {} dbclear (@var{line}, @dots{}) @deftypefnx {} {} dbclear ("all") -Delete a breakpoint at line number @var{line} in the function @var{func}. +Delete a breakpoint at line number @var{line} in the function @var{fcn}. Arguments are @table @var -@item func +@item fcn Function name as a string variable. When already in debug mode this argument can be omitted and the current function will be used. @@ -332,7 +331,7 @@ DEFMETHOD (dbstatus, interp, args, nargout, doc: /* -*- texinfo -*- @deftypefn {} {} dbstatus -@deftypefnx {} {} dbstatus @var{func} +@deftypefnx {} {} dbstatus @var{fcn} @deftypefnx {} {@var{bp_list} =} dbstatus @dots{} Report the location of active breakpoints. @@ -340,16 +339,16 @@ functions with breakpoints and the line numbers where those breakpoints are set. -If a function name @var{func} is specified then only report breakpoints +If a function name @var{fcn} is specified then only report breakpoints for the named function and its subfunctions. The optional return argument @var{bp_list} is a struct array with the -following fields. +following fields: @table @asis @item name -The name of the function with a breakpoint. A subfunction, say @code{func2} -within an m-file, say @file{file.m}, is specified as @code{file>func2}. +The name of the function with a breakpoint. A subfunction, say @code{fcn2} +within an m-file, say @file{file.m}, is specified as @code{file>fcn2}. @item file The name of the m-file where the function code is located. @@ -484,9 +483,9 @@ for (const auto& fnm_bp_p : bp_list) { std::string filename = fnm_bp_p.first; - const char *sub_fun = strchr (filename.c_str (), '>'); - if (sub_fun) - filename = filename.substr(0, sub_fun - filename.c_str ()); + const char *sub_fcn = strchr (filename.c_str (), '>'); + if (sub_fcn) + filename = filename.substr(0, sub_fcn - filename.c_str ()); octave_value path_name; path_name = octave::sys::canonicalize_file_name (help_sys.which (filename)); @@ -529,12 +528,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; @@ -603,10 +602,10 @@ @deftypefnx {} {} dbtype @var{lineno} @deftypefnx {} {} dbtype @var{startl:endl} @deftypefnx {} {} dbtype @var{startl:end} -@deftypefnx {} {} dbtype @var{func} -@deftypefnx {} {} dbtype @var{func} @var{lineno} -@deftypefnx {} {} dbtype @var{func} @var{startl:endl} -@deftypefnx {} {} dbtype @var{func} @var{startl:end} +@deftypefnx {} {} dbtype @var{fcn} +@deftypefnx {} {} dbtype @var{fcn} @var{lineno} +@deftypefnx {} {} dbtype @var{fcn} @var{startl:endl} +@deftypefnx {} {} dbtype @var{fcn} @var{startl:end} Display a script file with line numbers. When called with no arguments in debugging mode, display the script file @@ -640,7 +639,7 @@ break; - case 1: // (dbtype start:end) || (dbtype func) || (dbtype lineno) + case 1: // (dbtype start:end) || (dbtype fcn) || (dbtype lineno) { std::string arg = argv[1]; @@ -672,11 +671,11 @@ start, end); } } - else // (dbtype func) || (dbtype lineno) + else // (dbtype fcn) || (dbtype lineno) { int line = atoi (arg.c_str ()); - if (line == 0) // (dbtype func) + if (line == 0) // (dbtype fcn) { dbg_fcn = tw.get_user_code (arg); @@ -701,7 +700,7 @@ } break; - case 2: // (dbtype func start:end) || (dbtype func start) + case 2: // (dbtype fcn start:end) || (dbtype fcn start) { dbg_fcn = tw.get_user_code (argv[1]); @@ -940,7 +939,7 @@ void show_octave_dbstack (void) { - do_dbstack (octave::__get_interpreter__ ("show_octave_dbstack"), + do_dbstack (octave::__get_interpreter__ (), octave_value_list (), 0, std::cerr); } @@ -1171,7 +1170,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 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/defaults.cc --- a/libinterp/corefcn/defaults.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/defaults.cc Mon Aug 29 13:58:00 2022 +0200 @@ -450,8 +450,9 @@ DEFUN (OCTAVE_HOME, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} OCTAVE_HOME () +@deftypefn {} {@var{dir} =} OCTAVE_HOME () Return the name of the top-level Octave installation directory. + OCTAVE_HOME corresponds to the configuration variable @var{prefix}. @seealso{EXEC_PATH, IMAGE_PATH, OCTAVE_EXEC_HOME} @end deftypefn */) @@ -469,11 +470,12 @@ DEFUN (OCTAVE_EXEC_HOME, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} OCTAVE_EXEC_HOME () +@deftypefn {} {@var{dir} =} OCTAVE_EXEC_HOME () Return the name of the top-level Octave installation directory for -architecture-dependent files. If not specified separately, the value -is the same as OCTAVE_HOME@. OCTAVE_EXEC_HOME corresponds to the -configuration variable @var{exec_prefix}. +architecture-dependent files. + +If not specified separately, the value is the same as OCTAVE_HOME@. +OCTAVE_EXEC_HOME corresponds to the configuration variable @var{exec_prefix}. @seealso{EXEC_PATH, IMAGE_PATH, OCTAVE_HOME} @end deftypefn */) { @@ -490,7 +492,7 @@ DEFUNX ("OCTAVE_VERSION", FOCTAVE_VERSION, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} OCTAVE_VERSION () +@deftypefn {} {@var{verstr} =} OCTAVE_VERSION () Return the version number of Octave as a string. @seealso{ver, version} @end deftypefn */) diff -r 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/defun.cc --- a/libinterp/corefcn/defun.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/defun.cc Mon Aug 29 13:58:00 2022 +0200 @@ -54,7 +54,7 @@ void print_usage (void) { - tree_evaluator& tw = __get_evaluator__ ("print_usage"); + tree_evaluator& tw = __get_evaluator__ (); const octave_function *cur = tw.current_function (); @@ -97,7 +97,7 @@ octave_value fval (fcn); - symbol_table& symtab = __get_symbol_table__ ("install_dld_function"); + symbol_table& symtab = __get_symbol_table__ (); symtab.install_built_in_function (name, fval); } @@ -114,7 +114,7 @@ octave_value fval (fcn); - symbol_table& symtab = __get_symbol_table__ ("install_dld_function"); + symbol_table& symtab = __get_symbol_table__ (); symtab.install_built_in_function (name, fval); } @@ -130,7 +130,7 @@ octave_value fval (fcn); - symbol_table& symtab = __get_symbol_table__ ("install_mex_function"); + symbol_table& symtab = __get_symbol_table__ (); symtab.install_built_in_function (name, fval); } @@ -140,7 +140,7 @@ { dynamic_library retval; - tree_evaluator& tw = __get_evaluator__ ("get_current_shlib"); + tree_evaluator& tw = __get_evaluator__ (); octave_function *curr_fcn = tw.current_function (); diff -r 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/det.cc --- a/libinterp/corefcn/det.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/det.cc Mon Aug 29 13:58:00 2022 +0200 @@ -54,7 +54,7 @@ DEFUN (det, args, nargout, doc: /* -*- texinfo -*- -@deftypefn {} {} det (@var{A}) +@deftypefn {} {@var{d} =} det (@var{A}) @deftypefnx {} {[@var{d}, @var{rcond}] =} det (@var{A}) Compute the determinant of @var{A}. diff -r 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/dirfns.cc --- a/libinterp/corefcn/dirfns.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/dirfns.cc Mon Aug 29 13:58:00 2022 +0200 @@ -91,8 +91,8 @@ directory does not exist, an error message is printed and the working directory is not changed. -@code{chdir} is an alias for @code{cd} and can be used in all of the same -calling formats. +Programming Note: @code{chdir} is an alias for @code{cd} and can be used with +all of the same calling formats. Compatibility Note: When called with no arguments, @sc{matlab} prints the present working directory rather than changing to the user's home directory. @@ -131,8 +131,7 @@ DEFUN (pwd, , , doc: /* -*- texinfo -*- -@deftypefn {} {} pwd () -@deftypefnx {} {@var{dir} =} pwd () +@deftypefn {} {@var{dir} =} pwd () Return the current working directory. @seealso{cd, dir, ls, mkdir, rmdir} @end deftypefn */) @@ -182,7 +181,9 @@ DEFUN (__mkdir__, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} __mkdir__ (@var{parent}, @var{dir}) +@deftypefn {} {} __mkdir__ (@var{dir}) +@deftypefnx {} {} __mkdir__ (@var{parent}, @var{dir}) +@deftypefnx {} {[@var{status}, @var{msg}, @var{msgid}] =} __mkdir__ (@dots{}) Internal function called by mkdir.m. @seealso{mkdir, rmdir, pwd, cd, umask} @end deftypefn */) @@ -392,7 +393,7 @@ DEFUNX ("readlink", Freadlink, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} readlink @var{symlink} +@deftypefn {} {@var{result} =} readlink @var{symlink} @deftypefnx {} {[@var{result}, @var{err}, @var{msg}] =} readlink (@var{symlink}) Read the value of the symbolic link @var{symlink}. @@ -470,7 +471,7 @@ DEFUN (glob, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} glob (@var{pattern}) +@deftypefn {} {@var{cstr} =} glob (@var{pattern}) Given an array of pattern strings (as a char array or a cell array) in @var{pattern}, return a cell array of filenames that match any of them, or an empty cell array if no patterns match. @@ -577,7 +578,7 @@ DEFUN (__wglob__, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} __wglob__ (@var{pattern}) +@deftypefn {} {@var{cstr} =} __wglob__ (@var{pattern}) Windows-like glob for dir. Given an array of pattern strings (as a char array or a cell array) in @@ -690,7 +691,7 @@ DEFUN (__fnmatch__, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} fnmatch (@var{pattern}, @var{string}) +@deftypefn {} {@var{TF} =} fnmatch (@var{pattern}, @var{string}) Return true or false for each element of @var{string} that matches any of the elements of the string array @var{pattern}, using the rules of filename pattern matching. @@ -719,7 +720,7 @@ DEFUN (filesep, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} filesep () +@deftypefn {} {@var{sep} =} filesep () @deftypefnx {} {} filesep ("all") Return the system-dependent character used to separate directory names. @@ -768,7 +769,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 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/display.cc --- a/libinterp/corefcn/display.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/display.cc Mon Aug 29 13:58:00 2022 +0200 @@ -55,7 +55,7 @@ DEFMETHOD (have_window_system, interp, , , doc: /* -*- texinfo -*- -@deftypefn {} {} have_window_system () +@deftypefn {} {@var{tf} =} have_window_system () Return true if a window system is available (X11, Windows, or Apple OS X) and false otherwise. @seealso{isguirunning} diff -r 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/dot.cc --- a/libinterp/corefcn/dot.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/dot.cc Mon Aug 29 13:58:00 2022 +0200 @@ -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; @@ -73,7 +75,8 @@ DEFUN (dot, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} dot (@var{x}, @var{y}, @var{dim}) +@deftypefn {} {@var{z} =} dot (@var{x}, @var{y}) +@deftypefnx {} {@var{z} =} dot (@var{x}, @var{y}, @var{dim}) Compute the dot product of two vectors. If @var{x} and @var{y} are matrices, calculate the dot products along the @@ -349,7 +352,7 @@ DEFUN (blkmm, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} blkmm (@var{A}, @var{B}) +@deftypefn {} {@var{C} =} blkmm (@var{A}, @var{B}) Compute products of matrix blocks. The blocks are given as 2-dimensional subarrays of the arrays @var{A}, diff -r 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/environment.cc --- a/libinterp/corefcn/environment.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/environment.cc Mon Aug 29 13:58:00 2022 +0200 @@ -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 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/error.cc --- a/libinterp/corefcn/error.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/error.cc Mon Aug 29 13:58:00 2022 +0200 @@ -76,7 +76,7 @@ error_1 (octave::execution_exception& ee, const char *id, const char *fmt, va_list args) { - octave::error_system& es = octave::__get_error_system__ ("error_1"); + octave::error_system& es = octave::__get_error_system__ (); es.error_1 (ee, id, fmt, args); } @@ -85,7 +85,7 @@ static void error_1 (const char *id, const char *fmt, va_list args) { - octave::error_system& es = octave::__get_error_system__ ("error_1"); + octave::error_system& es = octave::__get_error_system__ (); es.error_1 (id, fmt, args); } @@ -111,7 +111,7 @@ static void vwarning (const char *id, const char *fmt, va_list args) { - octave::error_system& es = octave::__get_error_system__ ("warning"); + octave::error_system& es = octave::__get_error_system__ (); es.vwarning (id, fmt, args); } @@ -125,10 +125,10 @@ va_end (args); } -typedef void (*error_fun)(const char *, const char *, ...); +typedef void (*error_fcn)(const char *, const char *, ...); static std::string -handle_message (error_fun f, const char *id, const char *msg, +handle_message (error_fcn f, const char *id, const char *msg, const octave_value_list& args, bool have_fmt) { std::string retval; @@ -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); @@ -956,7 +955,7 @@ void vusage_with_id (const char *id, const char *fmt, va_list args) { - octave::error_system& es = octave::__get_error_system__ ("warning_enabled"); + octave::error_system& es = octave::__get_error_system__ (); es.vusage (id, fmt, args); } @@ -1109,7 +1108,7 @@ void vpanic (const char *fmt, va_list args) { - octave::error_system& es = octave::__get_error_system__ ("vpanic"); + octave::error_system& es = octave::__get_error_system__ (); es.vpanic (fmt, args); } @@ -1255,7 +1254,6 @@ @seealso{warning, lasterror} @end deftypefn */) { - int nargin = args.length (); if (nargin == 0) @@ -1816,7 +1814,7 @@ args(1) = id; args(0) = state; - interpreter& interp = __get_interpreter__ ("set_warning_state"); + interpreter& interp = __get_interpreter__ (); return Fwarning (interp, args, 1); } @@ -1824,7 +1822,7 @@ octave_value_list set_warning_state (const octave_value_list& args) { - interpreter& interp = __get_interpreter__ ("set_warning_state"); + interpreter& interp = __get_interpreter__ (); return Fwarning (interp, args, 1); } @@ -1832,7 +1830,7 @@ int warning_enabled (const std::string& id) { - error_system& es = __get_error_system__ ("warning_enabled"); + error_system& es = __get_error_system__ (); return es.warning_enabled (id); } @@ -1840,7 +1838,7 @@ void disable_warning (const std::string& id) { - error_system& es = __get_error_system__ ("disable_warning"); + error_system& es = __get_error_system__ (); es.disable_warning (id); } @@ -2079,7 +2077,7 @@ With one argument, set the last warning message to @var{msg}. -With two arguments, also set the last message identifier. +With two arguments, also set the last message identifier to @var{msgid}. @seealso{warning, lasterror, lasterr} @end deftypefn */) { @@ -2116,7 +2114,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 +2132,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 +2154,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. @@ -2174,14 +2172,9 @@ void interpreter_try (unwind_protect& frame) { - error_system& es = __get_error_system__ ("interpreter_try"); + error_system& es = __get_error_system__ (); es.interpreter_try (frame); } OCTAVE_NAMESPACE_END - -// Deprecated variables and functions. - -// This variable is obsolete and always has the value 0. -int error_state = 0; diff -r 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/error.h --- a/libinterp/corefcn/error.h Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/error.h Mon Aug 29 13:58:00 2022 +0200 @@ -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 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/errwarn.h --- a/libinterp/corefcn/errwarn.h Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/errwarn.h Mon Aug 29 13:58:00 2022 +0200 @@ -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 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/event-manager.cc --- a/libinterp/corefcn/event-manager.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/event-manager.cc Mon Aug 29 13:58:00 2022 +0200 @@ -48,7 +48,7 @@ static int readline_event_hook (void) { - event_manager& evmgr = __get_event_manager__ ("octave_readline_hook"); + event_manager& evmgr = __get_event_manager__ (); evmgr.process_events (); @@ -225,7 +225,7 @@ DEFMETHOD (__event_manager_enabled__, interp, , , doc: /* -*- texinfo -*- -@deftypefn {} {} __event_manager_enabled__ () +@deftypefn {} {@var{tf} =} __event_manager_enabled__ () Undocumented internal function. @end deftypefn */) { @@ -236,7 +236,7 @@ DEFMETHOD (__event_manager_have_dialogs__, interp, , , doc: /* -*- texinfo -*- -@deftypefn {} {} __event_manager_have_dialogs__ () +@deftypefn {} {@var{tf} =} __event_manager_have_dialogs__ () Undocumented internal function. @end deftypefn */) { @@ -247,7 +247,7 @@ DEFMETHOD (__event_manager_edit_file__, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} __event_manager_edit_file__ (@var{file}) +@deftypefn {} {@var{status} =} __event_manager_edit_file__ (@var{file}) Undocumented internal function. @end deftypefn */) { @@ -279,7 +279,7 @@ DEFMETHOD (__event_manager_question_dialog__, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} __event_manager_question_dialog__ (@var{msg}, @var{title}, @var{btn1}, @var{btn2}, @var{btn3}, @var{default}) +@deftypefn {} {@var{btn_val} =} __event_manager_question_dialog__ (@var{msg}, @var{title}, @var{btn1}, @var{btn2}, @var{btn3}, @var{default}) Undocumented internal function. @end deftypefn */) { @@ -306,7 +306,7 @@ DEFMETHOD (__event_manager_file_dialog__, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} __event_manager_file_dialog__ (@var{filterlist}, @var{title}, @var{filename}, @var{multiselect}, @var{pathname}) +@deftypefn {} {[@var{fname}, @var{fpath}, @var{fltidx}] =} __event_manager_file_dialog__ (@var{filterlist}, @var{title}, @var{filename}, @var{multiselect}, @var{pathname}) Undocumented internal function. @end deftypefn */) { @@ -375,7 +375,7 @@ DEFMETHOD (__event_manager_list_dialog__, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} __event_manager_list_dialog__ (@var{list}, @var{mode}, @var{size}, @var{initial}, @var{name}, @var{prompt}, @var{ok_string}, @var{cancel_string}) +@deftypefn {} {[@var{sel}, @var{ok}] =} __event_manager_list_dialog__ (@var{list}, @var{mode}, @var{size}, @var{initial}, @var{name}, @var{prompt}, @var{ok_string}, @var{cancel_string}) Undocumented internal function. @end deftypefn */) { @@ -431,7 +431,7 @@ DEFMETHOD (__event_manager_input_dialog__, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} __event_manager_input_dialog__ (@var{prompt}, @var{title}, @var{rowscols}, @var{defaults}) +@deftypefn {} {@var{cstr} =} __event_manager_input_dialog__ (@var{prompt}, @var{title}, @var{rowscols}, @var{defaults}) Undocumented internal function. @end deftypefn */) { @@ -483,7 +483,7 @@ DEFMETHOD (__event_manager_named_icon__, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} __event_manager_dialog_icons__ (@var{icon_name}) +@deftypefn {} {@var{icon} =} __event_manager_dialog_icons__ (@var{icon_name}) Undocumented internal function. @end deftypefn */) { @@ -501,9 +501,10 @@ return ovl (retval); } +// FIXME: Why does this function return any value at all? DEFMETHOD (__event_manager_show_preferences__, interp, , , doc: /* -*- texinfo -*- -@deftypefn {} {} __event_manager_show_preferences__ () +@deftypefn {} {@var{status} =} __event_manager_show_preferences__ () Undocumented internal function. @end deftypefn */) { @@ -514,7 +515,7 @@ DEFMETHOD (__event_manager_apply_preferences__, interp, , , doc: /* -*- texinfo -*- -@deftypefn {} {} __event_manager_apply_preferences__ () +@deftypefn {} {@var{status} =} __event_manager_apply_preferences__ () Undocumented internal function. @end deftypefn */) { @@ -525,7 +526,8 @@ DEFMETHOD (__event_manager_gui_preference__, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} __event_manager_gui_preference__ () +@deftypefn {} {@var{prefval} =} __event_manager_gui_preference__ (@var{key}) +@deftypefnx {} {@var{prefval} =} __event_manager_gui_preference__ (@var{key}, @var{value}) Undocumented internal function. @end deftypefn */) { @@ -645,7 +647,7 @@ DEFMETHOD (__event_manager_show_documentation__, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} __event_manager_show_documentation__ (@var{filename}) +@deftypefn {} {@var{status} =} __event_manager_show_documentation__ (@var{filename}) Undocumented internal function. @end deftypefn */) { @@ -661,7 +663,7 @@ DEFMETHOD (__event_manager_register_documentation__, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} __event_manager_register_documentation__ (@var{filename}) +@deftypefn {} {@var{status} =} __event_manager_register_documentation__ (@var{filename}) Undocumented internal function. @end deftypefn */) { @@ -677,7 +679,7 @@ DEFMETHOD (__event_manager_unregister_documentation__, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} __event_manager_unregister_documentation__ (@var{filename}) +@deftypefn {} {@var{status} =} __event_manager_unregister_documentation__ (@var{filename}) Undocumented internal function. @end deftypefn */) { @@ -758,7 +760,7 @@ DEFMETHOD (__event_manager_gui_status_update__, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} __event_manager_gui_status_update__ (@var{feature}, @var{status}) +@deftypefn {} {@var{status} =} __event_manager_gui_status_update__ (@var{feature}, @var{status}) Internal function for updating the status of some features in the GUI. @end deftypefn */) { @@ -792,7 +794,7 @@ DEFMETHOD (__event_manager_update_gui_lexer__, interp, , , doc: /* -*- texinfo -*- -@deftypefn {} {} __event_manager_update_gui_lexer__ () +@deftypefn {} {@var{status} =} __event_manager_update_gui_lexer__ () Undocumented internal function. @end deftypefn */) { diff -r 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/event-manager.h --- a/libinterp/corefcn/event-manager.h Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/event-manager.h Mon Aug 29 13:58:00 2022 +0200 @@ -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 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/fcn-info.cc --- a/libinterp/corefcn/fcn-info.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/fcn-info.cc Mon Aug 29 13:58:00 2022 +0200 @@ -54,8 +54,7 @@ { octave_value retval; - load_path& lp - = __get_load_path__ ("fcn_info::fcn_info_rep::load_private_function"); + load_path& lp = __get_load_path__ (); std::string file_name = lp.find_private_fcn (dir_name, name); @@ -98,8 +97,7 @@ std::string dir_name; - load_path& lp - = __get_load_path__ ("fcn_info::fcn_info_rep::load_class_constructor"); + load_path& lp = __get_load_path__ (); std::string file_name = lp.find_method (name, name, dir_name, package_name); @@ -159,8 +157,7 @@ retval = load_class_constructor (); else { - cdef_manager& cdm - = __get_cdef_manager__ ("fcn_info::fcn_info_rep::load_class_method"); + cdef_manager& cdm = __get_cdef_manager__ (); retval = cdm.find_method_symbol (name, dispatch_type); @@ -168,7 +165,7 @@ { std::string dir_name; - load_path& lp = __get_load_path__ ("fcn_info::fcn_info_rep::load_class_method"); + load_path& lp = __get_load_path__ (); std::string file_name = lp.find_method (dispatch_type, name, dir_name); @@ -196,8 +193,7 @@ { // Search parent classes - symbol_table& symtab - = __get_symbol_table__ ("fcn_info::fcn_info_rep::load_class_method"); + symbol_table& symtab = __get_symbol_table__ (); const std::list& plist = symtab.parent_classes (dispatch_type); @@ -303,7 +299,7 @@ // There's a non-builtin class in the argument list. dispatch_type = args(i).class_name (); - symbol_table& symtab = __get_symbol_table__ ("get_dispatch_type"); + symbol_table& symtab = __get_symbol_table__ (); for (int j = i+1; j < n; j++) { @@ -356,7 +352,7 @@ { symbol_scope search_scope = (scope - ? scope : __get_current_scope__("fcn_info::fcn_info_rep::find")); + ? scope : __get_current_scope__ ()); octave_value retval = xfind (search_scope, args); @@ -366,7 +362,7 @@ // the last prompt or chdir, so try updating the load path and // searching again. - load_path& lp = __get_load_path__ ("fcn_info::fcn_info_rep::find"); + load_path& lp = __get_load_path__ (); lp.update (); @@ -525,8 +521,7 @@ if (! dispatch_type.empty ()) { - load_path& lp - = __get_load_path__ ("out_of_date_check"); + load_path& lp = __get_load_path__ (); file = lp.find_method (dispatch_type, nm, dir_name, pack); @@ -536,8 +531,7 @@ std::string s_name; std::string s_pack; - symbol_table& symtab - = __get_symbol_table__ ("out_of_date_check"); + symbol_table& symtab = __get_symbol_table__ (); const std::list& plist = symtab.parent_classes (dispatch_type); @@ -566,16 +560,14 @@ // Maybe it's an autoload? if (file.empty ()) { - tree_evaluator& tw - = __get_evaluator__ ("out_of_data_check"); + tree_evaluator& tw = __get_evaluator__ (); file = tw.lookup_autoload (nm); } if (file.empty ()) { - load_path& lp - = __get_load_path__ ("out_of_date_check"); + load_path& lp = __get_load_path__ (); file = lp.find_fcn (nm, dir_name, pack); } } @@ -648,8 +640,7 @@ // breakpoints associated with it if (clear_breakpoints) { - bp_table& bptab - = __get_bp_table__ ("out_of_date_check"); + bp_table& bptab = __get_bp_table__ (); bptab.remove_all_breakpoints_from_function (canonical_nm, true); @@ -857,7 +848,7 @@ { symbol_scope search_scope = (scope - ? scope : __get_current_scope__("fcn_info::fcn_info_rep::find")); + ? scope : __get_current_scope__ ()); octave_value retval = x_builtin_find (search_scope); @@ -867,7 +858,7 @@ // the last prompt or chdir, so try updating the load path and // searching again. - load_path& lp = __get_load_path__ ("fcn_info::fcn_info_rep::builtin_find"); + load_path& lp = __get_load_path__ (); lp.update (); @@ -1017,8 +1008,7 @@ if (! autoload_function.is_defined ()) { - tree_evaluator& tw - = __get_evaluator__ ("fcn_info::fcn_info_rep::x_builtin_find"); + tree_evaluator& tw = __get_evaluator__ (); std::string file_name = tw.lookup_autoload (name); @@ -1051,8 +1041,7 @@ { std::string dir_name; - load_path& lp - = __get_load_path__ ("fcn_info::fcn_info_rep::find_user_function"); + load_path& lp = __get_load_path__ (); std::string file_name = lp.find_fcn (name, dir_name, package_name); @@ -1079,8 +1068,7 @@ if (package.is_undefined ()) { - cdef_manager& cdm - = __get_cdef_manager__ ("fcn_info::fcn_info_rep::find_package"); + cdef_manager& cdm = __get_cdef_manager__ (); package = cdm.find_package_symbol (full_name ()); } diff -r 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/fft.cc --- a/libinterp/corefcn/fft.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/fft.cc Mon Aug 29 13:58:00 2022 +0200 @@ -195,9 +195,9 @@ DEFUN (fft, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} fft (@var{x}) -@deftypefnx {} {} fft (@var{x}, @var{n}) -@deftypefnx {} {} fft (@var{x}, @var{n}, @var{dim}) +@deftypefn {} {@var{y} =} fft (@var{x}) +@deftypefnx {} {@var{y} =} fft (@var{x}, @var{n}) +@deftypefnx {} {@var{y} =} fft (@var{x}, @var{n}, @var{dim}) Compute the discrete Fourier transform of @var{x} using a Fast Fourier Transform (FFT) algorithm. @@ -224,23 +224,23 @@ DEFUN (ifft, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} ifft (@var{x}) -@deftypefnx {} {} ifft (@var{x}, @var{n}) -@deftypefnx {} {} ifft (@var{x}, @var{n}, @var{dim}) -Compute the inverse discrete Fourier transform of @var{x} +@deftypefn {} {@var{x} =} ifft (@var{y}) +@deftypefnx {} {@var{x} =} ifft (@var{y}, @var{n}) +@deftypefnx {} {@var{x} =} ifft (@var{y}, @var{n}, @var{dim}) +Compute the inverse discrete Fourier transform of @var{y} using a Fast Fourier Transform (FFT) algorithm. The inverse FFT is calculated along the first non-singleton dimension -of the array. Thus if @var{x} is a matrix, @code{fft (@var{x})} computes -the inverse FFT for each column of @var{x}. +of the array. Thus if @var{y} is a matrix, @code{ifft (@var{y})} computes +the inverse FFT for each column of @var{y}. If called with two arguments, @var{n} is expected to be an integer -specifying the number of elements of @var{x} to use, or an empty +specifying the number of elements of @var{y} to use, or an empty matrix to specify that its value should be ignored. If @var{n} is larger than the dimension along which the inverse FFT is calculated, then -@var{x} is resized and padded with zeros. Otherwise, if @var{n} is +@var{y} is resized and padded with zeros. Otherwise, if @var{n} is smaller than the dimension along which the inverse FFT is calculated, -then @var{x} is truncated. +then @var{y} is truncated. If called with three arguments, @var{dim} is an integer specifying the dimension of the matrix along which the inverse FFT is performed. diff -r 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/fft2.cc --- a/libinterp/corefcn/fft2.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/fft2.cc Mon Aug 29 13:58:00 2022 +0200 @@ -139,8 +139,8 @@ DEFUN (fft2, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} fft2 (@var{A}) -@deftypefnx {} {} fft2 (@var{A}, @var{m}, @var{n}) +@deftypefn {} {@var{B} =} fft2 (@var{A}) +@deftypefnx {} {@var{B} =} fft2 (@var{A}, @var{m}, @var{n}) Compute the two-dimensional discrete Fourier transform of @var{A} using a Fast Fourier Transform (FFT) algorithm. @@ -159,17 +159,17 @@ DEFUN (ifft2, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} ifft2 (@var{A}) -@deftypefnx {} {} ifft2 (@var{A}, @var{m}, @var{n}) -Compute the inverse two-dimensional discrete Fourier transform of @var{A} +@deftypefn {} {@var{A} =} ifft2 (@var{B}) +@deftypefnx {} {@var{A} =} ifft2 (@var{B}, @var{m}, @var{n}) +Compute the inverse two-dimensional discrete Fourier transform of @var{B} using a Fast Fourier Transform (FFT) algorithm. The optional arguments @var{m} and @var{n} may be used specify the number of -rows and columns of @var{A} to use. If either of these is larger than the -size of @var{A}, @var{A} is resized and padded with zeros. +rows and columns of @var{B} to use. If either of these is larger than the +size of @var{B}, @var{B} is resized and padded with zeros. -If @var{A} is a multi-dimensional matrix, each two-dimensional sub-matrix -of @var{A} is treated separately. +If @var{B} is a multi-dimensional matrix, each two-dimensional sub-matrix +of @var{B} is treated separately. @seealso{fft2, ifft, ifftn, fftw} @end deftypefn */) { diff -r 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/fftn.cc --- a/libinterp/corefcn/fftn.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/fftn.cc Mon Aug 29 13:58:00 2022 +0200 @@ -126,8 +126,8 @@ DEFUN (fftn, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} fftn (@var{A}) -@deftypefnx {} {} fftn (@var{A}, @var{size}) +@deftypefn {} {@var{B} =} fftn (@var{A}) +@deftypefnx {} {@var{B} =} fftn (@var{A}, @var{size}) Compute the N-dimensional discrete Fourier transform of @var{A} using a Fast Fourier Transform (FFT) algorithm. @@ -145,16 +145,16 @@ DEFUN (ifftn, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} ifftn (@var{A}) -@deftypefnx {} {} ifftn (@var{A}, @var{size}) -Compute the inverse N-dimensional discrete Fourier transform of @var{A} +@deftypefn {} {@var{A} =} ifftn (@var{B}) +@deftypefnx {} {@var{A} =} ifftn (@var{B}, @var{size}) +Compute the inverse N-dimensional discrete Fourier transform of @var{B} using a Fast Fourier Transform (FFT) algorithm. The optional vector argument @var{size} may be used specify the dimensions of the array to be used. If an element of @var{size} is smaller than the -corresponding dimension of @var{A}, then the dimension of @var{A} is +corresponding dimension of @var{B}, then the dimension of @var{B} is truncated prior to performing the inverse FFT@. Otherwise, if an element of -@var{size} is larger than the corresponding dimension then @var{A} is +@var{size} is larger than the corresponding dimension then @var{B} is resized and padded with zeros. @seealso{fftn, ifft, ifft2, fftw} @end deftypefn */) diff -r 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/file-io.cc --- a/libinterp/corefcn/file-io.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/file-io.cc Mon Aug 29 13:58:00 2022 +0200 @@ -60,14 +60,12 @@ #include "mkostemp-wrapper.h" #include "oct-env.h" #include "oct-locbuf.h" -#include "tmpfile-wrapper.h" #include "unistd-wrappers.h" #include "builtin-defun-decls.h" #include "defun.h" #include "error.h" #include "errwarn.h" -#include "file-io.h" #include "interpreter-private.h" #include "interpreter.h" #include "load-path.h" @@ -177,8 +175,7 @@ DEFMETHOD (fclose, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} fclose (@var{fid}) -@deftypefnx {} {} fclose ("all") +@deftypefn {} {@var{status} =} fclose (@var{fid}) @deftypefnx {} {@var{status} =} fclose ("all") Close the file specified by the file descriptor @var{fid}. @@ -221,7 +218,7 @@ DEFMETHOD (fflush, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} fflush (@var{fid}) +@deftypefn {} {@var{status} =} fflush (@var{fid}) Flush output to file descriptor @var{fid}. @code{fflush} returns 0 on success and an OS dependent error value @@ -704,8 +701,11 @@ Move the file pointer to the beginning of the file specified by file descriptor @var{fid}. -@code{frewind} returns 0 for success, and -1 if an error is encountered. It -is equivalent to @code{fseek (@var{fid}, 0, SEEK_SET)}. +If an output @var{status} is requested then @code{frewind} returns 0 for +success, and -1 if an error is encountered. + +Programming Note: @code{frewind} is equivalent to +@code{fseek (@var{fid}, 0, SEEK_SET)}. @seealso{fseek, ftell, fopen} @end deftypefn */) { @@ -728,9 +728,8 @@ DEFMETHOD (fseek, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} fseek (@var{fid}, @var{offset}) -@deftypefnx {} {} fseek (@var{fid}, @var{offset}, @var{origin}) -@deftypefnx {} {@var{status} =} fseek (@dots{}) +@deftypefn {} {@var{status} =} fseek (@var{fid}, @var{offset}) +@deftypefnx {} {@var{status} =} fseek (@var{fid}, @var{offset}, @var{origin}) Set the file pointer to the location @var{offset} within the file @var{fid}. The pointer is positioned @var{offset} characters from the @var{origin}, which @@ -833,7 +832,8 @@ If @var{fid} is omitted, the output is written to @code{stdout} making the function exactly equivalent to @code{printf}. -The optional output returns the number of bytes written to the file. +The optional output @var{numbytes} returns the number of bytes written to the +file. Implementation Note: For compatibility with @sc{matlab}, escape sequences in the template string (e.g., @qcode{"@backslashchar{}n"} => newline) are @@ -848,16 +848,19 @@ DEFMETHOD (printf, interp, args, nargout, doc: /* -*- texinfo -*- -@deftypefn {} {} printf (@var{template}, @dots{}) +@deftypefn {} {} printf (@var{template}, @dots{}) +@deftypefnx {} {@var{numbytes} =} printf (@dots{}) Print optional arguments under the control of the template string -@var{template} to the stream @code{stdout} and return the number of -characters printed. +@var{template} to the stream @code{stdout} and return the number of characters +printed. @ifclear OCTAVE_MANUAL -See the Formatted Output section of the GNU Octave manual for a -complete description of the syntax of the template string. +See the Formatted Output section of the GNU Octave manual for a complete +description of the syntax of the template string. @end ifclear +The optional output @var{numbytes} returns the number of bytes printed. + Implementation Note: For compatibility with @sc{matlab}, escape sequences in the template string (e.g., @qcode{"@backslashchar{}n"} => newline) are expanded even when the template string is defined with single quotes. @@ -883,20 +886,20 @@ stream os = streams.lookup (args(0), who); - return ovl (os.puts (args(1), who)); + return ovl (- (os.puts (args(1), who) < 0)); } DEFMETHOD (fputs, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} fputs (@var{fid}, @var{string}) -@deftypefnx {} {@var{status} =} fputs (@var{fid}, @var{string}) +@deftypefn {} {@var{status} =} fputs (@var{fid}, @var{string}) Write the string @var{string} to the file with file descriptor @var{fid}. The string is written to the file with no additional formatting. Use @code{fdisp} instead to automatically append a newline character appropriate for the local machine. -Return a non-negative number on success or EOF on error. +The optional output @var{status} is 0 for success, or -1 if an error was +encountered. @seealso{fdisp, fprintf, fwrite, fopen} @end deftypefn */) { @@ -905,16 +908,44 @@ return puts_internal (interp, who, args); } +/* +## Check if text is correctly converted to output encoding +%!test <*61839> +%! str = "aäöu"; # string with non-ASCII characters +%! fname = tempname (); +%! fid = fopen (fname, "wt", "n", "ISO-8859-1"); +%! unwind_protect +%! fprintf (fid, '%s\n', str); +%! fdisp (fid, str); +%! fputs (fid, str); +%! fclose (fid); +%! ## re-open file for reading in binary mode +%! fid = fopen (fname, "rb"); +%! fb = fread (fid); +%! fclose (fid); +%! ## check file content +%! encoded = [97 228 246 117]; # original string in ISO-8859-1 encoding +%! if (ispc ()) +%! eol = double ("\r\n"); +%! else +%! eol = double ("\n"); +%! endif +%! assert (fb.', [encoded eol encoded eol encoded]) +%! unwind_protect_cleanup +%! unlink (fname); +%! end_unwind_protect +*/ + DEFMETHOD (puts, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} puts (@var{string}) -@deftypefnx {} {@var{status} =} puts (@var{string}) +@deftypefn {} {@var{status} =} puts (@var{string}) Write a string to the standard output with no formatting. The string is written verbatim to the standard output. Use @code{disp} to automatically append a newline character appropriate for the local machine. -Return a non-negative number on success and EOF on error. +The optional output @var{status} is 0 for success, or -1 if an error was +encountered. @seealso{fputs, disp} @end deftypefn */) { @@ -927,7 +958,7 @@ DEFUN (sprintf, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} sprintf (@var{template}, @dots{}) +@deftypefn {} {@var{str} =} sprintf (@var{template}, @dots{}) This is like @code{printf}, except that the output is returned as a string. @@ -2278,6 +2309,7 @@ %! fid = fopen (f, "w+", "n", "iso-8859-1"); %! unwind_protect %! fprintf (fid, "abc,äöü\n"); +%! fflush (fid); %! fseek (fid, 0, "bof"); %! obs = textscan (fid, "%s", "delimiter", ","); %! fclose (fid); @@ -2329,6 +2361,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 @@ -2648,23 +2682,23 @@ DEFMETHOD (fwrite, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} fwrite (@var{fid}, @var{data}) -@deftypefnx {} {} fwrite (@var{fid}, @var{data}, @var{precision}) -@deftypefnx {} {} fwrite (@var{fid}, @var{data}, @var{precision}, @var{skip}) -@deftypefnx {} {} fwrite (@var{fid}, @var{data}, @var{precision}, @var{skip}, @var{arch}) -@deftypefnx {} {@var{count} =} fwrite (@dots{}) +@deftypefn {} {@var{count} =} fwrite (@var{fid}, @var{data}) +@deftypefnx {} {@var{count} =} fwrite (@var{fid}, @var{data}, @var{precision}) +@deftypefnx {} {@var{count} =} fwrite (@var{fid}, @var{data}, @var{precision}, @var{skip}) +@deftypefnx {} {@var{count} =} fwrite (@var{fid}, @var{data}, @var{precision}, @var{skip}, @var{arch}) Write data in binary form to the file specified by the file descriptor -@var{fid}, returning the number of values @var{count} successfully written -to the file. - -The argument @var{data} is a matrix of values that are to be written to -the file. The values are extracted in column-major order. +@var{fid}. + +The argument @var{data} is a matrix of values that are to be written to the +file. The values are extracted in column-major order. The remaining arguments @var{precision}, @var{skip}, and @var{arch} are optional, and are interpreted as described for @code{fread}. -The behavior of @code{fwrite} is undefined if the values in @var{data} -are too large to fit in the specified precision. +The output @var{count} is the number of data items successfully written. + +Programming Note: The behavior of @code{fwrite} is undefined if the values in +@var{data} are too large to fit in the specified precision. @seealso{fread, fputs, fprintf, fopen} @end deftypefn */) { @@ -2838,10 +2872,13 @@ DEFMETHODX ("pclose", Fpclose, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} pclose (@var{fid}) -Close a file identifier that was opened by @code{popen}. - -The function @code{fclose} may also be used for the same purpose. +@deftypefn {} {@var{status} =} pclose (@var{fid}) +Close a file identifier @var{fid} that was opened by @code{popen}. + +If successful, @code{fclose} returns 0, otherwise, it returns -1. + +Programming Note: The function @code{fclose} may also be used for the same +purpose. @seealso{fclose, popen} @end deftypefn */) { @@ -2853,6 +2890,51 @@ return ovl (streams.remove (args(0), "pclose")); } +DEFUN (tempdir, args, , + doc: /* -*- texinfo -*- +@deftypefn {} {@var{dir} =} tempdir () +Return the name of the host system's directory for temporary files. + +The directory name is taken first from the environment variable @env{TMPDIR}. +If that does not exist, the environment variable @env{TMP} (and on Windows +platforms also with higher priority the environment variable @env{TEMP}) is +checked. If none of those are set, the system default returned by +@code{P_tmpdir} is used. +@seealso{P_tmpdir, tempname, mkstemp, tmpfile} +@end deftypefn */) +{ + int nargin = args.length (); + + if (nargin > 0) + print_usage (); + + std::string tmpdir = sys::env::get_temp_directory (); + + if (! sys::file_ops::is_dir_sep (tmpdir.back ())) + tmpdir += sys::file_ops::dir_sep_str (); + + return ovl (tmpdir); +} + +/* +%!assert (ischar (tempdir ())) + +%!test +%! old_wstate = warning ("off"); +%! old_tmpdir = getenv ("TMPDIR"); +%! unwind_protect +%! setenv ("TMPDIR", "__MY_TMP_DIR__"); +%! assert (tempdir (), ["__MY_TMP_DIR__" filesep()]); +%! unwind_protect_cleanup +%! if (! isempty (old_tmpdir)) +%! setenv ("TMPDIR", old_tmpdir); +%! else +%! unsetenv ("TMPDIR"); +%! endif +%! warning (old_wstate); +%! end_unwind_protect +*/ + DEFUN (tempname, args, , doc: /* -*- texinfo -*- @deftypefn {} {@var{fname} =} tempname () @@ -2882,8 +2964,6 @@ if (nargin > 0) dir = args(0).xstring_value ("tempname: DIR must be a string"); - else - dir = sys::env::getenv ("TMPDIR"); std::string pfx ("oct-"); @@ -2966,15 +3046,15 @@ octave_value_list retval; - FILE *fid = octave_tmpfile_wrapper (); + std::string tmpfile (sys::tempnam (sys::env::get_temp_directory (), "oct-")); + + FILE *fid = sys::fopen_tmp (tmpfile, "w+b"); if (fid) { - std::string nm; - std::ios::openmode md = fopen_mode_to_ios_mode ("w+b"); - stream s = stdiostream::create (nm, fid, md); + stream s = stdiostream::create (tmpfile, fid, md); if (! s) { @@ -3101,7 +3181,7 @@ DEFUNX ("umask", Fumask, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} umask (@var{mask}) +@deftypefn {} {@var{oldmask} =} umask (@var{mask}) Set the permission mask for file creation. The parameter @var{mask} is an integer, interpreted as an octal number. @@ -3146,7 +3226,7 @@ DEFUNX ("P_tmpdir", FP_tmpdir, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} P_tmpdir () +@deftypefn {} {@var{sys_tmpdir} =} P_tmpdir () Return the name of the host system's @strong{default} directory for temporary files. @@ -3168,7 +3248,7 @@ DEFUNX ("SEEK_SET", FSEEK_SET, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} SEEK_SET () +@deftypefn {} {@var{fseek_origin} =} SEEK_SET () Return the numerical value to pass to @code{fseek} to position the file pointer relative to the beginning of the file. @seealso{SEEK_CUR, SEEK_END, fseek} @@ -3179,7 +3259,7 @@ DEFUNX ("SEEK_CUR", FSEEK_CUR, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} SEEK_CUR () +@deftypefn {} {@var{fseek_origin} =} SEEK_CUR () Return the numerical value to pass to @code{fseek} to position the file pointer relative to the current position. @seealso{SEEK_SET, SEEK_END, fseek} @@ -3190,7 +3270,7 @@ DEFUNX ("SEEK_END", FSEEK_END, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} SEEK_END () +@deftypefn {} {@var{fseek_origin} =} SEEK_END () Return the numerical value to pass to @code{fseek} to position the file pointer relative to the end of the file. @seealso{SEEK_SET, SEEK_CUR, fseek} @@ -3211,7 +3291,7 @@ DEFMETHODX ("stdin", Fstdin, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} stdin () +@deftypefn {} {@var{fid} =} stdin () Return the numeric value corresponding to the standard input stream. When Octave is used interactively, stdin is filtered through the command @@ -3226,7 +3306,7 @@ DEFMETHODX ("stdout", Fstdout, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} stdout () +@deftypefn {} {@var{fid} =} stdout () Return the numeric value corresponding to the standard output stream. Data written to the standard output may be filtered through the pager. @@ -3240,7 +3320,7 @@ DEFMETHODX ("stderr", Fstderr, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} stderr () +@deftypefn {} {@var{fid} =} stderr () Return the numeric value corresponding to the standard error stream. Even if paging is turned on, the standard error is not sent to the pager. @@ -3253,24 +3333,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 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/file-io.h --- a/libinterp/corefcn/file-io.h Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/file-io.h Mon Aug 29 13:58:00 2022 +0200 @@ -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 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/filter.cc --- a/libinterp/corefcn/filter.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/filter.cc Mon Aug 29 13:58:00 2022 +0200 @@ -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 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/find.cc --- a/libinterp/corefcn/find.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/find.cc Mon Aug 29 13:58:00 2022 +0200 @@ -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 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/gcd.cc --- a/libinterp/corefcn/gcd.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/gcd.cc Mon Aug 29 13:58:00 2022 +0200 @@ -511,7 +511,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 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/getgrent.cc --- a/libinterp/corefcn/getgrent.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/getgrent.cc Mon Aug 29 13:58:00 2022 +0200 @@ -136,7 +136,7 @@ DEFUN (setgrent, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} setgrent () +@deftypefn {} {[@var{status}, @var{msg}] =} setgrent () Return the internal pointer to the beginning of the group database. @seealso{getgrent, endgrent} @end deftypefn */) @@ -154,7 +154,7 @@ DEFUN (endgrent, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} endgrent () +@deftypefn {} {[@var{status}, @var{msg}] =} endgrent () Close the group database. @seealso{getgrent, setgrent} @end deftypefn */) diff -r 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/getpwent.cc --- a/libinterp/corefcn/getpwent.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/getpwent.cc Mon Aug 29 13:58:00 2022 +0200 @@ -142,7 +142,7 @@ DEFUN (setpwent, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} setpwent () +@deftypefn {} {[@var{status}, @var{msg}] =} setpwent () Return the internal pointer to the beginning of the password database. @seealso{getpwent, endpwent} @end deftypefn */) @@ -160,7 +160,7 @@ DEFUN (endpwent, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} endpwent () +@deftypefn {} {[@var{status}, @var{msg}] =} endpwent () Close the password database. @seealso{getpwent, setpwent} @end deftypefn */) diff -r 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/getrusage.cc --- a/libinterp/corefcn/getrusage.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/getrusage.cc Mon Aug 29 13:58:00 2022 +0200 @@ -38,7 +38,7 @@ DEFUN (getrusage, , , doc: /* -*- texinfo -*- -@deftypefn {} {} getrusage () +@deftypefn {} {@var{procstats} =} getrusage () Return a structure containing a number of statistics about the current Octave process. diff -r 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/gl-render.cc --- a/libinterp/corefcn/gl-render.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/gl-render.cc Mon Aug 29 13:58:00 2022 +0200 @@ -1551,8 +1551,7 @@ { #if defined (HAVE_OPENGL) - gh_manager& gh_mgr - = __get_gh_manager__ ("opengl_renderer::draw_axes_x_grid"); + gh_manager& gh_mgr = __get_gh_manager__ (); int xstate = props.get_xstate (); @@ -1748,8 +1747,7 @@ { #if defined (HAVE_OPENGL) - gh_manager& gh_mgr - = __get_gh_manager__ ("opengl_renderer::draw_axes_y_grid"); + gh_manager& gh_mgr = __get_gh_manager__ (); int ystate = props.get_ystate (); @@ -1944,8 +1942,7 @@ void opengl_renderer::draw_axes_z_grid (const axes::properties& props) { - gh_manager& gh_mgr - = __get_gh_manager__ ("opengl_renderer::draw_axes_z_grid"); + gh_manager& gh_mgr = __get_gh_manager__ (); int zstate = props.get_zstate (); @@ -2167,8 +2164,7 @@ std::list& obj_list) { #if defined (HAVE_OPENGL) - gh_manager& gh_mgr - = __get_gh_manager__ ("opengl_renderer::draw_axes_all_lights"); + gh_manager& gh_mgr = __get_gh_manager__ (); Matrix children = props.get_all_children (); @@ -3771,8 +3767,7 @@ if (props.markerfacecolor_is ("auto")) { - gh_manager& gh_mgr - = __get_gh_manager__ ("opengl_renderer::draw_scatter"); + gh_manager& gh_mgr = __get_gh_manager__ (); graphics_object go = gh_mgr.get_object (props.get___myhandle__ ()); graphics_object ax = go.get_ancestor ("axes"); const axes::properties& ax_props @@ -4163,7 +4158,7 @@ { int len = hlist.numel (); - gh_manager& gh_mgr = __get_gh_manager__ ("opengl_renderer::draw"); + gh_manager& gh_mgr = __get_gh_manager__ (); for (int i = len-1; i >= 0; i--) { @@ -4664,7 +4659,7 @@ double opengl_renderer::points_to_pixels (const double val) const { - gh_manager& gh_mgr = __get_gh_manager__ ("opengl_renderer::points_to_pixels"); + gh_manager& gh_mgr = __get_gh_manager__ (); // FIXME: Does making this static cause problems if figure is moved to a // 2nd monitor with a different value for "screenpixelsperinch"? diff -r 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/gl-render.h --- a/libinterp/corefcn/gl-render.h Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/gl-render.h Mon Aug 29 13:58:00 2022 +0200 @@ -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 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/gl2ps-print.cc --- a/libinterp/corefcn/gl2ps-print.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/gl2ps-print.cc Mon Aug 29 13:58:00 2022 +0200 @@ -42,7 +42,7 @@ #include "file-ops.h" #include "lo-mappers.h" #include "oct-locbuf.h" -#include "tmpfile-wrapper.h" +#include "oct-env.h" #include "unistd-wrappers.h" #include "unistr-wrappers.h" #include "unwind-prot.h" @@ -91,7 +91,7 @@ { bool retval = false; - gh_manager& gh_mgr = __get_gh_manager__ ("gl2ps_renderer::has_alpha"); + gh_manager& gh_mgr = __get_gh_manager__ (); graphics_object go = gh_mgr.get_object (h); @@ -295,7 +295,7 @@ { bool retval = true; - gh_manager& gh_mgr = __get_gh_manager__ ("gl2ps_renderer::has_2D_axes"); + gh_manager& gh_mgr = __get_gh_manager__ (); graphics_object go = gh_mgr.get_object (h); @@ -327,7 +327,7 @@ { std::string retval; - gh_manager& gh_mgr = __get_gh_manager__ ("gl2ps_renderer::get_title"); + gh_manager& gh_mgr = __get_gh_manager__ (); graphics_object go = gh_mgr.get_object (h); @@ -396,7 +396,9 @@ gl2ps_sort = GL2PS_NO_SORT; // Use a temporary file in case an overflow happens - FILE *tmpf = octave_tmpfile_wrapper (); + std::string tmpfile (sys::tempnam (sys::env::get_temp_directory (), + "oct-")); + FILE *tmpf = sys::fopen_tmp (tmpfile, "w+b"); if (! tmpf) error ("gl2ps_renderer::draw: couldn't open temporary file for printing"); @@ -1329,16 +1331,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 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/graphics-toolkit.cc --- a/libinterp/corefcn/graphics-toolkit.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/graphics-toolkit.cc Mon Aug 29 13:58:00 2022 +0200 @@ -36,7 +36,7 @@ void base_graphics_toolkit::update (const graphics_handle& h, int id) { - gh_manager& gh_mgr = __get_gh_manager__ ("base_graphics_toolkit::update"); + gh_manager& gh_mgr = __get_gh_manager__ (); graphics_object go = gh_mgr.get_object (h); @@ -46,8 +46,7 @@ bool base_graphics_toolkit::initialize (const graphics_handle& h) { - gh_manager& gh_mgr - = __get_gh_manager__ ("base_graphics_toolkit::initialize"); + gh_manager& gh_mgr = __get_gh_manager__ (); graphics_object go = gh_mgr.get_object (h); @@ -57,8 +56,7 @@ void base_graphics_toolkit::finalize (const graphics_handle& h) { - gh_manager& gh_mgr - = __get_gh_manager__ ("base_graphics_toolkit::finalize"); + gh_manager& gh_mgr = __get_gh_manager__ (); graphics_object go = gh_mgr.get_object (h); diff -r 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/graphics-toolkit.h --- a/libinterp/corefcn/graphics-toolkit.h Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/graphics-toolkit.h Mon Aug 29 13:58:00 2022 +0200 @@ -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 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/graphics.cc --- a/libinterp/corefcn/graphics.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/graphics.cc Mon Aug 29 13:58:00 2022 +0200 @@ -224,8 +224,7 @@ static double default_screendepth (void) { - octave::display_info& dpy_info - = octave::__get_display_info__ ("default_screendepth"); + octave::display_info& dpy_info = octave::__get_display_info__ (); return dpy_info.depth (); } @@ -235,8 +234,7 @@ { Matrix retval (1, 4); - octave::display_info& dpy_info - = octave::__get_display_info__ ("default_screensize"); + octave::display_info& dpy_info = octave::__get_display_info__ (); retval(0) = 1.0; retval(1) = 1.0; @@ -249,8 +247,7 @@ static double default_screenpixelsperinch (void) { - octave::display_info& dpy_info - = octave::__get_display_info__ ("default_screenpixelsperinch"); + octave::display_info& dpy_info = octave::__get_display_info__ (); return (dpy_info.x_dpi () + dpy_info.y_dpi ()) / 2; } @@ -538,8 +535,7 @@ static std::string default_graphics_toolkit (void) { - octave::gtk_manager& gtk_mgr - = octave::__get_gtk_manager__ ("default_graphics_toolkit"); + octave::gtk_manager& gtk_mgr = octave::__get_gtk_manager__ (); return gtk_mgr.default_toolkit (); } @@ -626,7 +622,7 @@ bool call_createfcn = true, bool notify_toolkit = true) { - gh_manager& gh_mgr = octave::__get_gh_manager__ ("make_graphics_handle"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); return gh_mgr.make_graphics_handle (go_name, parent, integer_figure_handle, call_createfcn, notify_toolkit); @@ -838,7 +834,7 @@ const caseless_str& from_units, const caseless_str& to_units) { - gh_manager& gh_mgr = octave::__get_gh_manager__ ("convert_text_position"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (props.get___myhandle__ ()); @@ -928,7 +924,7 @@ static Matrix screen_size_pixels (void) { - gh_manager& gh_mgr = octave::__get_gh_manager__ ("scren_size_pixels"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object obj = gh_mgr.get_object (0); @@ -943,7 +939,7 @@ { double retval = 1.0; - gh_manager& gh_mgr = octave::__get_gh_manager__ ("device_pixel_ratio"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object fig = gh_mgr.get_object (h).get_ancestor ("figure"); @@ -1008,7 +1004,7 @@ Matrix cmap (1, 3, 0.0); Matrix clim (1, 2, 0.0); - gh_manager& gh_mgr = octave::__get_gh_manager__ ("convert_cdata"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (props.get___myhandle__ ()); graphics_object ax = go.get_ancestor ("axes"); @@ -1264,8 +1260,7 @@ // Notify graphics toolkit. if (m_id >= 0 && do_notify_toolkit) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("base_property::set"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (m_parent); if (go) @@ -1287,8 +1282,7 @@ { const octave_value_list& l = m_listeners[mode]; - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("base_property::run_listeners"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); for (int i = 0; i < l.length (); i++) gh_mgr.execute_listener (m_parent, l(i)); @@ -1789,7 +1783,7 @@ double dv = v.xdouble_value (R"(set: invalid graphics handle for property "%s")", get_name ().c_str ()); - gh_manager& gh_mgr = octave::__get_gh_manager__ ("handle_property::do_set"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_handle gh = gh_mgr.lookup (dv); @@ -1851,8 +1845,7 @@ Matrix retval (m_children_list.size (), 1); octave_idx_type k = 0; - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("children_property::do_get_children"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (0); @@ -1888,8 +1881,7 @@ void children_property::do_delete_children (bool clear, bool from_root) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("children_property::do_delete_children"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); if (from_root) { @@ -1996,8 +1988,7 @@ if (m_callback.is_defined () && ! m_callback.isempty ()) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("callback_property::execute"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); gh_mgr.execute_callback (get_parent (), m_callback, data); } @@ -2135,7 +2126,7 @@ static void finalize_r (const graphics_handle& h) { - gh_manager& gh_mgr = octave::__get_gh_manager__ ("finalize_r"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (h); @@ -2153,7 +2144,7 @@ static void initialize_r (const graphics_handle& h) { - gh_manager& gh_mgr = octave::__get_gh_manager__ ("initialize_r"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (h); @@ -2247,8 +2238,7 @@ { if (! is_handle_visible ()) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("figure::properties::update_handlevisibility"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); octave_value cf = gh_mgr.get_object (0).get ("currentfigure"); @@ -2274,7 +2264,7 @@ static void update_text_pos (graphics_handle h) { - gh_manager& gh_mgr = octave::__get_gh_manager__ ("update_text_pos"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (h); @@ -2879,7 +2869,7 @@ static bool isfigure (double val) { - gh_manager& gh_mgr = octave::__get_gh_manager__ ("isfigure"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (val); @@ -2982,7 +2972,7 @@ xset (const graphics_handle& h, const caseless_str& pname, const octave_value& val) { - gh_manager& gh_mgr = octave::__get_gh_manager__ ("xset"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (h); @@ -2994,7 +2984,7 @@ { if (args.length () > 0) { - gh_manager& gh_mgr = octave::__get_gh_manager__ ("xset"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (h); @@ -3005,7 +2995,7 @@ static octave_value xget (const graphics_handle& h, const caseless_str& pname) { - gh_manager& gh_mgr = octave::__get_gh_manager__ ("xget"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (h); @@ -3020,7 +3010,7 @@ double hv = ov.xdouble_value ("%s: %s must be a graphics handle", who.c_str (), pname.c_str ()); - gh_manager& gh_mgr = octave::__get_gh_manager__ ("reparent"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_handle h = gh_mgr.lookup (hv); @@ -3069,8 +3059,7 @@ { if (h.ok ()) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("delete_graphics_object"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (h); @@ -3090,7 +3079,7 @@ static void delete_graphics_object (double val, bool from_root = false) { - gh_manager& gh_mgr = octave::__get_gh_manager__ ("delete_graphics_object"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); delete_graphics_object (gh_mgr.lookup (val), from_root || isfigure (val)); } @@ -3113,7 +3102,7 @@ { octave_value closerequestfcn = xget (h, "closerequestfcn"); - gh_manager& gh_mgr = octave::__get_gh_manager__ ("close_figure"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); gh_mgr.execute_callback (h, closerequestfcn); } @@ -3177,7 +3166,7 @@ static void adopt (const graphics_handle& parent_h, const graphics_handle& h) { - gh_manager& gh_mgr = octave::__get_gh_manager__ ("adopt"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object parent_go = gh_mgr.get_object (parent_h); @@ -3193,7 +3182,7 @@ static bool ishghandle (double val) { - gh_manager& gh_mgr = octave::__get_gh_manager__ ("ishghandle"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_handle h = gh_mgr.lookup (val); @@ -3225,7 +3214,7 @@ static void xcreatefcn (const graphics_handle& h) { - gh_manager& gh_mgr = octave::__get_gh_manager__ ("xcreatefcn"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (h); @@ -3235,7 +3224,7 @@ static void xinitialize (const graphics_handle& h) { - gh_manager& gh_mgr = octave::__get_gh_manager__ ("xinitialize"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (h); @@ -3267,8 +3256,7 @@ xreset_default_properties (graphics_handle h, property_list::pval_map_type factory_pval) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("xreset_default_properties"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (h); @@ -3431,8 +3419,7 @@ if (hp == m___myhandle__) error ("set: can not set object parent to be object itself"); - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("base_properties::set_parent"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_handle new_parent = gh_mgr.lookup (hp); if (! new_parent.ok ()) @@ -3481,8 +3468,7 @@ // Attempt to mark parent object as modified if it exists - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("base_properties::mark_modified"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object parent_go = gh_mgr.get_object (get_parent ()); @@ -3493,8 +3479,7 @@ void base_properties::override_defaults (base_graphics_object& obj) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("base_properties::override_defaults"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object parent_go = gh_mgr.get_object (get_parent ()); @@ -3505,8 +3490,7 @@ void base_properties::update_axis_limits (const std::string& axis_type) const { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("base_properties::update_axis_limits"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (m___myhandle__); @@ -3518,8 +3502,7 @@ base_properties::update_axis_limits (const std::string& axis_type, const graphics_handle& h) const { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("base_properties::update_axis_limits"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (m___myhandle__); @@ -3533,8 +3516,7 @@ if (m_contextmenu.get ().isempty ()) return; - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("base_properties::update_contextmenu"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (m_contextmenu.get ()); @@ -3556,8 +3538,7 @@ octave::graphics_toolkit base_properties::get_toolkit (void) const { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("base_properties::get_toolkit"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (get_parent ()); @@ -3572,8 +3553,7 @@ { Matrix kids = get_children (); - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("base_properties::update_boundingbox"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); for (int i = 0; i < kids.numel (); i++) { @@ -3587,8 +3567,7 @@ void base_properties::update_autopos (const std::string& elem_type) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("base_properties::update_autopos"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object parent_go = gh_mgr.get_object (get_parent ()); @@ -3604,8 +3583,7 @@ // This object should not be the figure "currentobject" - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("base_properties::update_handlevisibility"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go (gh_mgr.get_object (get___myhandle__ ())); @@ -3690,8 +3668,7 @@ bool traverse, std::list& children_list) const { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("base_properties::get_children_of_type"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); Matrix ch = get_children (); @@ -3724,8 +3701,7 @@ if (! valid_object ()) error ("base_graphics_object::update_axis_limits: invalid graphics object"); - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("base_graphics_object::update_axis_limits"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object parent_go = gh_mgr.get_object (get_parent ()); @@ -3740,8 +3716,7 @@ if (! valid_object ()) error ("base_graphics_object::update_axis_limits: invalid graphics object"); - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("base_graphics_object::update_axis_limits"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object parent_go = gh_mgr.get_object (get_parent ()); @@ -3775,8 +3750,7 @@ } catch (const octave::execution_exception&) { - octave::interpreter& interp - = octave::__get_interpreter__ ("remove_all_listeners"); + octave::interpreter& interp = octave::__get_interpreter__ (); interp.recover_from_exception (); } @@ -3801,8 +3775,7 @@ } } - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("base_graphics_object::build_user_defaults_map"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object parent_go = gh_mgr.get_object (get_parent ()); @@ -3815,8 +3788,7 @@ { if (valid_object ()) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("base_graphics_object::reset_default_properties"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); property_list::pval_map_type factory_pval = gh_mgr.get_object (0).get_factory_defaults_list ().find (type ())->second; @@ -3835,8 +3807,7 @@ std::string retval; octave_map m = get ().map_value (); - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("base_graphics_object::values_as_string"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (get_handle ()); @@ -3870,8 +3841,7 @@ if (! valid_object ()) error ("base_graphics_object::value_as_string: invalid graphics object"); - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("base_graphics_object::value_as_string"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (get_handle ()); @@ -3902,8 +3872,7 @@ octave_scalar_map m = get ().scalar_map_value (); - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("base_graphics_object::values_as_struct"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (get_handle ()); @@ -3956,8 +3925,7 @@ return *this; else { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("graphics_object::get_ancestor"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); return gh_mgr.get_object (get_parent ()).get_ancestor (obj_type); } @@ -3996,8 +3964,7 @@ if (val.ok ()) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("root_figure::properties::set_currentfigure"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); gh_mgr.push_figure (val); } @@ -4013,8 +3980,7 @@ { bool int_fig_handle = m_integerhandle.is_on (); - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("figure::properties::set_integerhandle"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object this_go = gh_mgr.get_object (m___myhandle__); @@ -4136,7 +4102,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 @@ -4145,8 +4112,7 @@ void root_figure::properties::remove_child (const graphics_handle& h, bool) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("root_figure::properties::remove_child"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); gh_mgr.pop_figure (h); @@ -4192,8 +4158,7 @@ Matrix kids = get_children (); - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("root_figure::properties::remove_child"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); for (octave_idx_type i = 0; i < kids.numel (); i++) { @@ -4235,8 +4200,7 @@ std::string nm = val.string_value (); - octave::gtk_manager& gtk_mgr - = octave::__get_gtk_manager__ ("figure::properties::set___graphics_toolkit__"); + octave::gtk_manager& gtk_mgr = octave::__get_gtk_manager__ (); octave::graphics_toolkit b = gtk_mgr.find_toolkit (nm); @@ -4257,8 +4221,7 @@ if (! get_currentaxes ().ok ()) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("figure::properties::adopt"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (h); @@ -4388,8 +4351,7 @@ { if (old_bb(2) != new_bb(2) || old_bb(3) != new_bb(3)) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("figure::properties::set_position"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); if (! get_resizefcn ().isempty ()) gh_mgr.post_callback (m___myhandle__, "resizefcn"); @@ -5082,7 +5044,7 @@ { graphics_handle parent_h = get_parent (); - gh_manager& gh_mgr = octave::__get_gh_manager__ ("figure::get_default"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object parent_go = gh_mgr.get_object (parent_h); @@ -5188,7 +5150,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"); @@ -5274,8 +5237,7 @@ { Matrix pos = init_pos; - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("axes::properties::calc_tightbox"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (get_parent ()); @@ -5413,8 +5375,7 @@ graphics_handle val; - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("axes::properties::set_text_child"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (gh_mgr.lookup (v)); @@ -5500,11 +5461,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; @@ -5642,8 +5603,7 @@ m_visible = "on"; - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("axes::properties::set_defaults"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (m_xlabel.handle_value ()); go.reset_default_properties (); @@ -5709,8 +5669,7 @@ { if (m___colormap__.get ().isempty ()) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("axes::properties::get_colormap"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go (gh_mgr.get_object (get___myhandle__ ())); graphics_object go_f (go.get_ancestor ("figure")); @@ -5727,8 +5686,7 @@ { graphics_handle h = hp.handle_value (); - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("axes::properties::delete_text_child"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); if (h.ok ()) { @@ -5756,8 +5714,7 @@ void axes::properties::remove_child (const graphics_handle& h, bool from_root) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("axes::properties::remove_child"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (h); @@ -5793,7 +5750,7 @@ void axes::properties::adopt (const graphics_handle& h) { - gh_manager& gh_mgr = octave::__get_gh_manager__ ("axes::properties::adopt"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go (gh_mgr.get_object (h)); @@ -6463,8 +6420,7 @@ if (updating_xlabel_position) return; - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("axes::properties::update_xlabel_position"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (get_xlabel ()); @@ -6484,7 +6440,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"); } @@ -6567,8 +6524,7 @@ if (updating_ylabel_position) return; - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("axes::properties::update_ylabel_position"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (get_ylabel ()); @@ -6588,7 +6544,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"); } @@ -6671,8 +6628,7 @@ if (updating_zlabel_position) return; - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("axes::properties::update_zlabel_position"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (get_zlabel ()); @@ -6798,8 +6754,7 @@ if (updating_title_position) return; - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("axes::properties::update_title_position"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (get_title ()); @@ -7010,8 +6965,7 @@ axes::properties::update_label_color (handle_property label, color_property col) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("axes::properties::update_label_color"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); gh_mgr.get_object (label.handle_value ()).set ("color", col.get ()); } @@ -7019,8 +6973,7 @@ void axes::properties::update_font (std::string prop) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("axes::properties::update_font"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); if (! prop.empty ()) { @@ -7064,8 +7017,7 @@ if (parent_size.isempty ()) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("axes::properties::get_boundingbox"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (get_parent ()); @@ -7120,8 +7072,7 @@ else if (i == 3) htext = get_zlabel (); - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("axes::properties::get_extent"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); text::properties& text_props = reinterpret_cast @@ -7339,8 +7290,7 @@ void axes::properties::update_units (const caseless_str& old_units) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("axes::properties::update_units"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object parent_go = gh_mgr.get_object (get_parent ()); @@ -7452,8 +7402,7 @@ { graphics_handle parent_h = get_parent (); - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("axes::properties::get_default"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object parent_go = gh_mgr.get_object (parent_h); @@ -7780,7 +7729,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; @@ -7832,17 +7782,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 @@ -7860,12 +7831,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; + } } } @@ -8080,13 +8060,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; @@ -8130,17 +8113,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); @@ -8148,6 +8142,7 @@ tmp_lims(1) = -tmp; } } + lims = tmp_lims; } else @@ -8360,8 +8355,7 @@ if (m_txt_renderer.ok ()) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("axes::properties::get_ticklabel_extents"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); octave::autolock guard (gh_mgr.graphics_lock ()); @@ -8395,7 +8389,7 @@ { octave_idx_type n = kids.numel (); - gh_manager& gh_mgr = octave::__get_gh_manager__ ("get_children_limits"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); switch (limit_type) { @@ -8516,9 +8510,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, @@ -8537,9 +8533,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, @@ -8561,9 +8559,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 { @@ -8716,9 +8716,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 { @@ -8739,9 +8741,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 { @@ -8771,9 +8775,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 { @@ -9268,8 +9274,7 @@ { if (! is_handle_visible ()) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("axes::properties::update_handlevisibility"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go (gh_mgr.get_object (get___myhandle__ ())); @@ -9296,8 +9301,7 @@ void figure::properties::init_toolkit (void) { - octave::gtk_manager& gtk_mgr - = octave::__get_gtk_manager__ ("figure::properties::init_toolkit"); + octave::gtk_manager& gtk_mgr = octave::__get_gtk_manager__ (); m_toolkit = gtk_mgr.get_toolkit (); } @@ -9500,8 +9504,7 @@ if (new_units == "normalized" || old_units == "normalized") { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("text::properties::update_fontunits"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go (gh_mgr.get_object (get___myhandle__ ())); @@ -9520,8 +9523,7 @@ { double dpr = device_pixel_ratio (get___myhandle__ ()); - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("text::properties::update_font"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); octave::autolock guard (gh_mgr.graphics_lock ()); @@ -9566,8 +9568,7 @@ string_vector sv = string_prop.string_vector_value (); - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("text::properties::update_text_extent"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); octave::autolock guard (gh_mgr.graphics_lock ()); @@ -9633,8 +9634,7 @@ double fontsz = get_fontsize (); double parent_height = box_pix_height; - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("text::properties::get___fontsize_points__"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go (gh_mgr.get_object (get___myhandle__ ())); @@ -9672,8 +9672,7 @@ void light::properties::update_visible (void) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("light::properties::update_visible"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (get___myhandle__ ()); @@ -9690,8 +9689,7 @@ bool patch::properties::get_do_lighting (void) const { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("patch::properties::get_do_lighting"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (get___myhandle__ ()); @@ -10322,8 +10320,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; } @@ -10348,8 +10346,7 @@ if (series_idx.isempty ()) return; - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("scatter::properties::update_color"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (get___myhandle__ ()); @@ -10411,8 +10408,7 @@ bool surface::properties::get_do_lighting (void) const { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("surface::properties::get_do_lighting"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (get___myhandle__ ()); @@ -10704,8 +10700,7 @@ void hggroup::properties::remove_child (const graphics_handle& h, bool from_root) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("hggroup::properties::remove_child"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (h); @@ -10722,8 +10717,7 @@ void hggroup::properties::adopt (const graphics_handle& h) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("hggroup::properties::adopt"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (h); @@ -10740,8 +10734,7 @@ void hggroup::properties::update_limits (void) const { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("hggroup::properties::update_limits"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (m___myhandle__); @@ -10758,8 +10751,7 @@ void hggroup::properties::update_limits (const graphics_handle& h) const { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("hggroup::properties::update_limits"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (m___myhandle__); @@ -10979,8 +10971,7 @@ // Clear the uicontextmenu property of dependent objects if (m_beingdeleted.is ("on")) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("uicontextmenu::properties::update_beingdeleted"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); std::list lst = get_dependent_obj_list (); @@ -11029,8 +11020,7 @@ { Matrix m = m_extent.get ().matrix_value (); - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("uicontrol::properties::get_extent"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object parent_go = gh_mgr.get_object (get_parent ()); @@ -11045,8 +11035,7 @@ { // FIXME: support multiline text - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("uicontrol::properties::update_text_extent"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (get___myhandle__ ()); @@ -11058,8 +11047,7 @@ { Matrix pos = get_position ().matrix_value (); - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("uicontrol::properties::update_units"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object parent_go = gh_mgr.get_object (get_parent ()); @@ -11075,8 +11063,7 @@ void uicontrol::properties::set_style (const octave_value& st) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("uicontrol::properties::set_style"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go_parent = gh_mgr.get_object (get_parent ()); if (go_parent.valid_object () && go_parent.isa ("uibuttongroup")) @@ -11129,8 +11116,7 @@ if (parent_size.isempty ()) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("uicontrol::properties::get_boundingbox"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (get_parent ()); @@ -11196,8 +11182,7 @@ if (parent_size.isempty ()) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("uibuttongroup::properties::get_boundingbox"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (get_parent ()); @@ -11272,8 +11257,7 @@ { if (old_bb(2) != new_bb(2) || old_bb(3) != new_bb(3)) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("uibuttongroup::properties::set_position"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); if (! get_resizefcn ().isempty ()) gh_mgr.post_callback (m___myhandle__, "resizefcn"); @@ -11309,8 +11293,7 @@ { Matrix pos = get_position ().matrix_value (); - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("uibuttongroup::properties::update_units"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object parent_go = gh_mgr.get_object (get_parent ()); @@ -11375,8 +11358,7 @@ graphics_handle val (v); if (val.ok ()) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("uibuttongroup::properties::set_selectedobject"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go (gh_mgr.get_object (val)); @@ -11419,8 +11401,7 @@ graphics_handle current_selected = get_selectedobject (); bool has_selected = current_selected.ok (); - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("uibuttongroup::properties::adopt"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (h); @@ -11444,8 +11425,7 @@ if (parent_size.isempty ()) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("uipanel::properties::get_boundingbox"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (get_parent ()); @@ -11520,8 +11500,7 @@ { if (old_bb(2) != new_bb(2) || old_bb(3) != new_bb(3)) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("uipanel::properties::set_position"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); if (! get_resizefcn ().isempty ()) gh_mgr.post_callback (m___myhandle__, "resizefcn"); @@ -11558,8 +11537,7 @@ { Matrix pos = get_position ().matrix_value (); - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("uipanel::properties::update_units"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object parent_go = gh_mgr.get_object (get_parent ()); @@ -11617,8 +11595,7 @@ if (parent_size.isempty ()) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("uitable::properties::get_boundingbox"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (get_parent ()); @@ -11744,8 +11721,7 @@ { Matrix pos = get_position ().matrix_value (); - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("uitable::properties::update_units"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object parent_go = gh_mgr.get_object (get_parent ()); @@ -11834,8 +11810,7 @@ // FIXME: Is it really acceptable to just let the toolkit update the extent? Matrix m = m_extent.get ().matrix_value (); - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("uitable::properties::get_extent"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object parent_go = gh_mgr.get_object (get_parent ()); @@ -11861,8 +11836,7 @@ { graphics_handle parent_h = get_parent (); - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("uitoolbar::get_default"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object parent_go = gh_mgr.get_object (parent_h); @@ -11889,8 +11863,7 @@ { graphics_handle parent_h = get_parent (); - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("base_graphics_object::get_default"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object parent_go = gh_mgr.get_object (parent_h); @@ -11900,8 +11873,7 @@ octave_value base_graphics_object::get_factory_default (const caseless_str& name) const { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("base_graphics_object::get_factory_default"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object parent_go = gh_mgr.get_object (0); @@ -11918,7 +11890,7 @@ { m_handle_map[0] = graphics_object (new root_figure ()); - octave::gtk_manager& gtk_mgr = octave::__get_gtk_manager__ ("gh_manager"); + octave::gtk_manager& gtk_mgr = octave::__get_gtk_manager__ (); // Make sure the default graphics toolkit is registered. gtk_mgr.default_toolkit (); @@ -12038,8 +12010,7 @@ void execute (void) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("callback_event::execute"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); if (m_callback.is_defined ()) gh_mgr.execute_callback (m_handle, m_callback, m_callback_data); @@ -12073,8 +12044,7 @@ { if (! m_mcode.empty ()) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("mcode_event::execute"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (m_handle); @@ -12141,7 +12111,7 @@ void execute (void) { - gh_manager& gh_mgr = octave::__get_gh_manager__ ("set_event::execute"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); octave::autolock guard (gh_mgr.graphics_lock ()); @@ -12249,7 +12219,7 @@ static void xset_gcbo (const graphics_handle& h) { - gh_manager& gh_mgr = octave::__get_gh_manager__ ("xset_gcbo"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (0); @@ -12388,7 +12358,7 @@ static int process_graphics_events (void) { - gh_manager& gh_mgr = octave::__get_gh_manager__ ("process_graphics_events"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); return gh_mgr.process_events (); } @@ -12644,7 +12614,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 @@ -12685,7 +12655,7 @@ static bool is_handle_visible (const graphics_handle& h) { - gh_manager& gh_mgr = octave::__get_gh_manager__ ("is_handle_visible"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); return h.ok () && gh_mgr.is_handle_visible (h); } @@ -12693,7 +12663,7 @@ static bool is_handle_visible (double val) { - gh_manager& gh_mgr = octave::__get_gh_manager__ ("is_handle_visible"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); return is_handle_visible (gh_mgr.lookup (val)); } @@ -12722,7 +12692,7 @@ DEFUN (__is_handle_visible__, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} __is_handle_visible__ (@var{h}) +@deftypefn {} {@var{tf} =} __is_handle_visible__ (@var{h}) Undocumented internal function. @end deftypefn */) { @@ -13046,7 +13016,7 @@ { std::string retval; - gh_manager& gh_mgr = octave::__get_gh_manager__ ("get_graphics_object_type"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (val); @@ -13187,7 +13157,7 @@ DEFMETHOD (__get__, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} __get__ (@var{h}) +@deftypefn {} {@var{props} =} __get__ (@var{h}) Undocumented internal function. @end deftypefn */) { @@ -13264,7 +13234,7 @@ if (octave::math::isnan (val)) val = args(0).xdouble_value ("__go_%s__: invalid parent", go_name.c_str ()); - gh_manager& gh_mgr = octave::__get_gh_manager__ ("make_graphics_object"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_handle parent = gh_mgr.lookup (val); @@ -13309,7 +13279,7 @@ DEFMETHOD (__go_figure__, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} __go_figure__ (@var{fignum}) +@deftypefn {} {@var{hfig} =} __go_figure__ (@var{fignum}) Undocumented internal function. @end deftypefn */) { @@ -13427,7 +13397,7 @@ { Matrix kids = go.get_properties ().get_children (); - gh_manager& gh_mgr = octave::__get_gh_manager__ ("calc_dimensions"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); for (octave_idx_type i = 0; i < kids.numel (); i++) { @@ -13451,7 +13421,7 @@ DEFMETHOD (__calc_dimensions__, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} __calc_dimensions__ (@var{axes}) +@deftypefn {} {@var{ndims} =} __calc_dimensions__ (@var{axes}) Internal function. Determine the number of dimensions in a graphics object, either 2 or 3. @@ -13471,7 +13441,7 @@ DEFMETHOD (__go_axes__, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} __go_axes__ (@var{parent}) +@deftypefn {} {@var{hax} =} __go_axes__ (@var{parent}) Undocumented internal function. @end deftypefn */) { @@ -13480,7 +13450,7 @@ DEFMETHOD (__go_line__, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} __go_line__ (@var{parent}) +@deftypefn {} {@var{hl} =} __go_line__ (@var{parent}) Undocumented internal function. @end deftypefn */) { @@ -13489,7 +13459,7 @@ DEFMETHOD (__go_text__, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} __go_text__ (@var{parent}) +@deftypefn {} {@var{ht} =} __go_text__ (@var{parent}) Undocumented internal function. @end deftypefn */) { @@ -13498,7 +13468,7 @@ DEFMETHOD (__go_image__, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} __go_image__ (@var{parent}) +@deftypefn {} {@var{hi} =} __go_image__ (@var{parent}) Undocumented internal function. @end deftypefn */) { @@ -13507,7 +13477,7 @@ DEFMETHOD (__go_surface__, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} __go_surface__ (@var{parent}) +@deftypefn {} {@var{hs} =} __go_surface__ (@var{parent}) Undocumented internal function. @end deftypefn */) { @@ -13516,7 +13486,7 @@ DEFMETHOD (__go_patch__, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} __go_patch__ (@var{parent}) +@deftypefn {} {@var{hp} =} __go_patch__ (@var{parent}) Undocumented internal function. @end deftypefn */) { @@ -13525,7 +13495,7 @@ DEFMETHOD (__go_scatter__, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} __go_scatter__ (@var{parent}) +@deftypefn {} {@var{hs} =} __go_scatter__ (@var{parent}) Undocumented internal function. @end deftypefn */) { @@ -13534,7 +13504,7 @@ DEFMETHOD (__go_light__, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} __go_light__ (@var{parent}) +@deftypefn {} {@var{hl} =} __go_light__ (@var{parent}) Undocumented internal function. @end deftypefn */) { @@ -13543,7 +13513,7 @@ DEFMETHOD (__go_hggroup__, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} __go_hggroup__ (@var{parent}) +@deftypefn {} {@var{hgg} =} __go_hggroup__ (@var{parent}) Undocumented internal function. @end deftypefn */) { @@ -13552,7 +13522,7 @@ DEFMETHOD (__go_uimenu__, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} __go_uimenu__ (@var{parent}) +@deftypefn {} {@var{hui} =} __go_uimenu__ (@var{parent}) Undocumented internal function. @end deftypefn */) { @@ -13561,7 +13531,7 @@ DEFMETHOD (__go_uicontrol__, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} __go_uicontrol__ (@var{parent}) +@deftypefn {} {@var{hui} =} __go_uicontrol__ (@var{parent}) Undocumented internal function. @end deftypefn */) { @@ -13570,7 +13540,7 @@ DEFMETHOD (__go_uibuttongroup__, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} __go_uibuttongroup__ (@var{parent}) +@deftypefn {} {@var{hui} =} __go_uibuttongroup__ (@var{parent}) Undocumented internal function. @end deftypefn */) { @@ -13579,7 +13549,7 @@ DEFMETHOD (__go_uipanel__, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} __go_uipanel__ (@var{parent}) +@deftypefn {} {@var{hui} =} __go_uipanel__ (@var{parent}) Undocumented internal function. @end deftypefn */) { @@ -13588,7 +13558,7 @@ DEFMETHOD (__go_uicontextmenu__, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} __go_uicontextmenu__ (@var{parent}) +@deftypefn {} {@var{hui} =} __go_uicontextmenu__ (@var{parent}) Undocumented internal function. @end deftypefn */) { @@ -13597,7 +13567,7 @@ DEFMETHOD (__go_uitable__, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} __go_uitable__ (@var{parent}) +@deftypefn {} {@var{hui} =} __go_uitable__ (@var{parent}) Undocumented internal function. @end deftypefn */) { @@ -13606,7 +13576,7 @@ DEFMETHOD (__go_uitoolbar__, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} __go_uitoolbar__ (@var{parent}) +@deftypefn {} {@var{hui} =} __go_uitoolbar__ (@var{parent}) Undocumented internal function. @end deftypefn */) { @@ -13615,7 +13585,7 @@ DEFMETHOD (__go_uipushtool__, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} __go_uipushtool__ (@var{parent}) +@deftypefn {} {@var{hui} =} __go_uipushtool__ (@var{parent}) Undocumented internal function. @end deftypefn */) { @@ -13624,7 +13594,7 @@ DEFMETHOD (__go_uitoggletool__, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} __go_uitoggletool__ (@var{parent}) +@deftypefn {} {@var{hui} =} __go_uitoggletool__ (@var{parent}) Undocumented internal function. @end deftypefn */) { @@ -13665,7 +13635,7 @@ DEFMETHOD (__go_handles__, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} __go_handles__ (@var{show_hidden}) +@deftypefn {} {@var{hg_list} =} __go_handles__ (@var{show_hidden}) Undocumented internal function. @end deftypefn */) { @@ -13683,7 +13653,7 @@ DEFMETHOD (__go_figure_handles__, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} __go_figure_handles__ (@var{show_hidden}) +@deftypefn {} {@var{hfig_list} =} __go_figure_handles__ (@var{show_hidden}) Undocumented internal function. @end deftypefn */) { @@ -13800,7 +13770,7 @@ DEFMETHOD (available_graphics_toolkits, interp, , , doc: /* -*- texinfo -*- -@deftypefn {} {} available_graphics_toolkits () +@deftypefn {} {@var{toolkits} =} available_graphics_toolkits () Return a cell array of registered graphics toolkits. @seealso{graphics_toolkit, register_graphics_toolkit} @end deftypefn */) @@ -13816,8 +13786,11 @@ DEFMETHOD (register_graphics_toolkit, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} register_graphics_toolkit (@var{toolkit}) +@deftypefn {} {} register_graphics_toolkit ("@var{toolkit}") List @var{toolkit} as an available graphics toolkit. + +Programming Note: No input validation is done on the input string; it is simply +added to the list of possible graphics toolkits. @seealso{available_graphics_toolkits} @end deftypefn */) { @@ -13839,7 +13812,7 @@ DEFMETHOD (loaded_graphics_toolkits, interp, , , doc: /* -*- texinfo -*- -@deftypefn {} {} loaded_graphics_toolkits () +@deftypefn {} {@var{toolkits} =} loaded_graphics_toolkits () Return a cell array of the currently loaded graphics toolkits. @seealso{available_graphics_toolkits} @end deftypefn */) @@ -14253,32 +14226,32 @@ octave_value get_property_from_handle (double handle, const std::string& property, - const std::string& func) -{ - gh_manager& gh_mgr = octave::__get_gh_manager__ ("get_property_from_handle"); + const std::string& fcn) +{ + gh_manager& gh_mgr = octave::__get_gh_manager__ (); octave::autolock guard (gh_mgr.graphics_lock ()); graphics_object go = gh_mgr.get_object (handle); if (! go) - error ("%s: invalid handle (= %g)", func.c_str (), handle); + error ("%s: invalid handle (= %g)", fcn.c_str (), handle); return go.get (caseless_str (property)); } bool set_property_in_handle (double handle, const std::string& property, - const octave_value& arg, const std::string& func) -{ - gh_manager& gh_mgr = octave::__get_gh_manager__ ("set_property_in_handle"); + const octave_value& arg, const std::string& fcn) +{ + gh_manager& gh_mgr = octave::__get_gh_manager__ (); octave::autolock guard (gh_mgr.graphics_lock ()); graphics_object go = gh_mgr.get_object (handle); if (! go) - error ("%s: invalid handle (= %g)", func.c_str (), handle); + error ("%s: invalid handle (= %g)", fcn.c_str (), handle); go.set (caseless_str (property), arg); @@ -14321,8 +14294,7 @@ caseless_str pname = c(3).string_value (); - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("do_cleanup_waitfor_listener"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); octave::autolock guard (gh_mgr.graphics_lock ()); @@ -14364,7 +14336,7 @@ caseless_str pname = args(4).string_value (); - gh_manager& gh_mgr = octave::__get_gh_manager__ ("waitfor_listener"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); octave::autolock guard (gh_mgr.graphics_lock ()); diff -r 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/graphics.in.h --- a/libinterp/corefcn/graphics.in.h Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/graphics.in.h Mon Aug 29 13:58:00 2022 +0200 @@ -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)) { } @@ -3144,6 +3149,17 @@ OCTINTERP_API void adopt (const graphics_handle& h); + // Alias "innerposition" to "position". + octave_value get_innerposition (void) const + { + return get_position (); + } + + void set_innerposition (const octave_value& val) + { + set_position (val); + } + OCTINTERP_API void set_position (const octave_value& val, bool do_notify_toolkit = true); @@ -3184,9 +3200,10 @@ string_property currentcharacter r , "" handle_property currentobject r , graphics_handle () array_property currentpoint r , Matrix (2, 1, 0) - bool_property dockcontrols , "off" + bool_property dockcontrols , "on" string_property filename , "" bool_property graphicssmoothing , "on" + array_property innerposition sg , default_figure_position () bool_property integerhandle S , "on" bool_property inverthardcopy , "on" callback_property keypressfcn , Matrix () @@ -3204,7 +3221,7 @@ array_property papersize U , default_figure_papersize () radio_property papertype SU , "{usletter}|uslegal|a0|a1|a2|a3|a4|a5|b0|b1|b2|b3|b4|b5|arch-a|arch-b|arch-c|arch-d|arch-e|a|b|c|d|e|tabloid|" radio_property paperunits Su , "{inches}|centimeters|normalized|points" - radio_property pointer , "crosshair|{arrow}|ibeam|watch|topl|topr|botl|botr|left|top|right|bottom|circle|cross|fleur|custom|hand" + radio_property pointer , "{arrow}|crosshair|ibeam|watch|topl|topr|botl|botr|left|top|right|bottom|circle|cross|fleur|custom|hand" array_property pointershapecdata , Matrix (16, 16, 1) array_property pointershapehotspot , Matrix (1, 2, 1) array_property position s , default_figure_position () @@ -3225,6 +3242,7 @@ callback_property windowkeypressfcn , Matrix () callback_property windowkeyreleasefcn , Matrix () callback_property windowscrollwheelfcn , Matrix () + radio_property windowstate , "{normal}|minimized|maximized|fullscreen" radio_property windowstyle , "{normal}|modal|docked" // Overridden base property @@ -3383,7 +3401,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 +3573,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 +3626,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 +3792,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 +3841,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 +3861,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 +3879,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 +4059,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 +4076,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 +4093,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 +4142,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 +4199,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 +4249,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 +4261,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 +4278,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 +4306,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 +4330,11 @@ update_axes_layout (); } + void update_zlimitmethod () + { + update_zlim (); + } + void trigger_normals_calc (void); }; @@ -5753,11 +5806,16 @@ BEGIN_PROPERTIES (uimenu) string_property accelerator , "" - callback_property callback , Matrix () + // Deprecated in R2017b (replaced by "MenuSelectedFcn") + callback_property callback hgs , Matrix () bool_property checked , "off" bool_property enable , "on" color_property foregroundcolor , color_values (0, 0, 0) - string_property label gs , "" + // Deprecated in R2017b (replaced by "Text") + string_property label hgs , "" + callback_property menuselectedfcn , Matrix () + // Deprecated in R2017b, but replacement of re-ordering "children" + // property of parent does not work yet in Octave. double_property position , 0 bool_property separator , "off" string_property text , "" @@ -5767,7 +5825,7 @@ any_property __object__ h , Matrix () END_PROPERTIES - // Redirect calls from "Label" to "Text". + // Make "Label" an alias for "Text". std::string get_label (void) const { return get_text (); @@ -5778,6 +5836,17 @@ set_text (val); } + // Make "Callback" an alias for "MenuSelectedFcn". + octave_value get_callback (void) const + { + return get_menuselectedfcn (); + } + + void set_callback (const octave_value& val) + { + set_menuselectedfcn (val); + } + protected: void init (void) { @@ -6526,10 +6595,10 @@ OCTINTERP_API octave_value get_property_from_handle (double handle, const std::string& property, - const std::string& func); + const std::string& fcn); OCTINTERP_API bool set_property_in_handle (double handle, const std::string& property, - const octave_value& arg, const std::string& func); + const octave_value& arg, const std::string& fcn); // --------------------------------------------------------------------- diff -r 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/gzfstream.h --- a/libinterp/corefcn/gzfstream.h Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/gzfstream.h Mon Aug 29 13:58:00 2022 +0200 @@ -469,7 +469,7 @@ private: // Underlying manipulator function gzofstream& - (*func)(gzofstream&, T1, T2); + (*fcn)(gzofstream&, T1, T2); // Arguments for manipulator function T1 val1; @@ -490,14 +490,14 @@ gzomanip2::gzomanip2 (gzofstream &(*f)(gzofstream&, T1, T2), T1 v1, T2 v2) - : func(f), val1(v1), val2(v2) + : fcn(f), val1(v1), val2(v2) { } // Insertor applies underlying manipulator function to stream template inline gzofstream& operator<<(gzofstream& s, const gzomanip2& m) -{ return (*m.func)(s, m.val1, m.val2); } +{ return (*m.fcn)(s, m.val1, m.val2); } // Insert this onto stream to simplify setting of compression level inline gzomanip2 diff -r 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/hash.cc --- a/libinterp/corefcn/hash.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/hash.cc Mon Aug 29 13:58:00 2022 +0200 @@ -53,9 +53,9 @@ DEFUN (hash, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} hash (@var{hfun}, @var{str}) +@deftypefn {} {@var{hashval} =} hash ("@var{hashfcn}", @var{str}) Calculate the hash value of the string @var{str} using the hash function -@var{hfun}. +@var{hashfcn}. The available hash functions are given in the table below. @@ -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 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/help.cc --- a/libinterp/corefcn/help.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/help.cc Mon Aug 29 13:58:00 2022 +0200 @@ -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') { @@ -726,7 +727,7 @@ string_vector make_name_list (void) { - help_system& help_sys = __get_help_system__ ("make_name_list"); + help_system& help_sys = __get_help_system__ (); return help_sys.make_name_list (); } @@ -785,8 +786,8 @@ DEFUN (__operators__, , , doc: /* -*- texinfo -*- -@deftypefn {} {} __operators__ () -Undocumented internal function. +@deftypefn {} {@var{cstr} =} __operators__ () +Return a cell array of strings of all possible Octave operators. @end deftypefn */) { return ovl (Cell (operator_names)); @@ -803,7 +804,7 @@ DEFMETHOD (__builtins__, interp, , , doc: /* -*- texinfo -*- @deftypefn {} {} __builtins__ () -Undocumented internal function. +Return a cell array of all builtin (compiled) functions available to Octave. @end deftypefn */) { symbol_table& symtab = interp.get_symbol_table (); @@ -815,7 +816,7 @@ DEFMETHOD (localfunctions, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} localfunctions () +@deftypefn {} {@var{subfcn_list} =} localfunctions () Return a list of all local functions, i.e., subfunctions, within the current file. @@ -871,7 +872,7 @@ DEFMETHOD (__which__, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} __which__ (@var{name}, @dots{}) +@deftypefn {} {@var{var_struct} =} __which__ (@var{name}, @dots{}) Undocumented internal function. @end deftypefn */) { @@ -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 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/hex2num.cc --- a/libinterp/corefcn/hex2num.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/hex2num.cc Mon Aug 29 13:58:00 2022 +0200 @@ -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 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/input.cc --- a/libinterp/corefcn/input.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/input.cc Mon Aug 29 13:58:00 2022 +0200 @@ -44,6 +44,7 @@ #include "file-ops.h" #include "iconv-wrappers.h" #include "localcharset-wrapper.h" +#include "oct-env.h" #include "oct-string.h" #include "quit.h" #include "str-vec.h" @@ -89,11 +90,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 @@ -183,8 +179,7 @@ if (pos != std::string::npos) base_name = base_name.substr (0, pos); - interpreter& interp - = __get_interpreter__ ("generate_struct_completions"); + interpreter& interp = __get_interpreter__ (); if (interp.is_variable (base_name)) { @@ -377,8 +372,7 @@ } else { - input_system& input_sys - = __get_input_system__ ("generate_completion"); + input_system& input_sys = __get_input_system__ (); command_editor::set_completion_append_character (input_sys.completion_append_char ()); @@ -396,8 +390,7 @@ { octave_quit (); - input_system& input_sys - = __get_input_system__ ("internal_input_event_hook_fcn"); + input_system& input_sys = __get_input_system__ (); input_sys.run_input_event_hooks (); @@ -581,8 +574,10 @@ std::string input_system::dir_encoding (const std::string& dir) { std::string enc = m_mfile_encoding; + // use canonicalized path as key + const std::string key = sys::canonicalize_file_name (dir); - auto enc_it = m_dir_encoding.find (load_path_dir (dir)); + auto enc_it = m_dir_encoding.find (key); if (enc_it != m_dir_encoding.end ()) enc = enc_it->second; @@ -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)) { } @@ -1252,13 +1248,24 @@ DEFUN (completion_matches, args, nargout, doc: /* -*- texinfo -*- -@deftypefn {} {} completion_matches (@var{hint}) -Generate possible completions given @var{hint}. +@deftypefn {} {@var{completion_list} =} completion_matches ("@var{hint}") +Generate possible word completions for Octave given the character sequence +@var{hint}. + +This function is provided for the benefit of programs like Emacs which might be +controlling Octave and handling user input. For example: -This function is provided for the benefit of programs like Emacs which -might be controlling Octave and handling user input. The current -command number is not incremented when this function is called. This is -a feature, not a bug. +@example +@group +completion_matches ("sine") +@result{} +sinetone +sinewave +@end group +@end example + +Programming Note: The current command number in Octave is not incremented when +this function is called. This is a feature, not a bug. @end deftypefn */) { if (args.length () != 1) @@ -1336,7 +1343,8 @@ DEFUN (readline_read_init_file, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} readline_read_init_file (@var{file}) +@deftypefn {} {} readline_read_init_file () +@deftypefnx {} {} readline_read_init_file (@var{file}) Read the readline library initialization file @var{file}. If @var{file} is omitted, read the default initialization file @@ -1453,7 +1461,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 +1505,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 +1529,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. @@ -1559,7 +1567,7 @@ DEFMETHOD (__gud_mode__, interp, args, nargout, doc: /* -*- texinfo -*- -@deftypefn {} {} __gud_mode__ () +@deftypefn {} {@var{state} =} __gud_mode__ () Undocumented internal function. @end deftypefn */) { @@ -1570,8 +1578,12 @@ DEFMETHOD (__mfile_encoding__, interp, args, nargout, doc: /* -*- texinfo -*- -@deftypefn {} {@var{current_encoding} =} __mfile_encoding__ (@var{new_encoding}) -Set and query the codepage that is used for reading .m files. +@deftypefn {} {@var{current_encoding} =} __mfile_encoding__ () +@deftypefnx {} {} __mfile_encoding__ (@var{new_encoding}) +@deftypefnx {} {@var{old_encoding} =} __mfile_encoding__ (@var{new_encoding}) +Query or set the codepage that is used for reading m-files. + +The input and output are strings naming a particular codepage, e.g., "utf-8". @end deftypefn */) { input_system& input_sys = interp.get_input_system (); @@ -1582,22 +1594,22 @@ DEFMETHOD (dir_encoding, interp, args, nargout, doc: /* -*- texinfo -*- @deftypefn {} {@var{current_encoding} =} dir_encoding (@var{dir}) -@deftypefnx {} {@var{prev_encoding} =} dir_encoding (@var{dir}, @var{encoding}) -@deftypefnx {} {} dir_encoding (@dots{}) -Set and query the @var{encoding} that is used for reading m-files in @var{dir}. +@deftypefnx {} {} dir_encoding (@var{dir}, @var{new_encoding}) +@deftypefnx {} {} dir_encoding (@var{dir}, "delete") +@deftypefnx {} {@var{old_encoding} =} dir_encoding (@var{dir}, @var{new_encoding}) +Query or set the @var{encoding} that is used for reading m-files in @var{dir}. -That encoding overrides the (globally set) m-file encoding. +The per-directory encoding overrides the (globally set) m-file encoding. -The string @var{DIR} must match the form how the directory would appear in the -load path. +The string @var{DIR} must match how the directory would appear in the load +path. -The @var{encoding} must be a valid encoding identifier or @qcode{"delete"}. In -the latter case, the (globally set) m-file encoding will be used for the given -@var{dir}. +The @var{new_encoding} input must be a valid encoding identifier or +@qcode{"delete"}. In the latter case, any per-directory encoding is removed +and the (globally set) m-file encoding will be used for the given @var{dir}. -The currently or previously used encoding is returned in @var{current_encoding} -or @var{prev_encoding}, respectively. The output argument must be explicitly -requested. +The currently or previously used encoding is returned only if an output +argument is requested. The directory encoding is automatically read from the file @file{.oct-config} when a new path is added to the load path (for example with @code{addpath}). @@ -1650,7 +1662,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 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/input.h --- a/libinterp/corefcn/input.h Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/input.h Mon Aug 29 13:58:00 2022 +0200 @@ -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 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/interpreter-private.cc --- a/libinterp/corefcn/interpreter-private.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/interpreter-private.cc Mon Aug 29 13:58:00 2022 +0200 @@ -27,6 +27,7 @@ # include "config.h" #endif +#include #include #include @@ -50,151 +51,151 @@ namespace octave { - interpreter& __get_interpreter__ (const std::string& who) + interpreter& __get_interpreter__ (void) { interpreter *interp = interpreter::the_interpreter (); if (! interp) { + std::cerr << "fatal error: octave interpreter context missing" << std::endl; abort (); - error ("%s: interpreter context missing", who.c_str ()); } return *interp; } - dynamic_loader& __get_dynamic_loader__ (const std::string& who) + dynamic_loader& __get_dynamic_loader__ (void) { - interpreter& interp = __get_interpreter__ (who); + interpreter& interp = __get_interpreter__ (); return interp.get_dynamic_loader (); } - error_system& __get_error_system__ (const std::string& who) + error_system& __get_error_system__ (void) { - interpreter& interp = __get_interpreter__ (who); + interpreter& interp = __get_interpreter__ (); return interp.get_error_system (); } - gh_manager& __get_gh_manager__ (const std::string& who) + gh_manager& __get_gh_manager__ (void) { - interpreter& interp = __get_interpreter__ (who); + interpreter& interp = __get_interpreter__ (); return interp.get_gh_manager (); } - help_system& __get_help_system__ (const std::string& who) + help_system& __get_help_system__ (void) { - interpreter& interp = __get_interpreter__ (who); + interpreter& interp = __get_interpreter__ (); return interp.get_help_system (); } - input_system& __get_input_system__ (const std::string& who) + input_system& __get_input_system__ (void) { - interpreter& interp = __get_interpreter__ (who); + interpreter& interp = __get_interpreter__ (); return interp.get_input_system (); } - output_system& __get_output_system__ (const std::string& who) + output_system& __get_output_system__ (void) { - interpreter& interp = __get_interpreter__ (who); + interpreter& interp = __get_interpreter__ (); return interp.get_output_system (); } - load_path& __get_load_path__ (const std::string& who) + load_path& __get_load_path__ (void) { - interpreter& interp = __get_interpreter__ (who); + interpreter& interp = __get_interpreter__ (); return interp.get_load_path (); } - load_save_system& __get_load_save_system__ (const std::string& who) + load_save_system& __get_load_save_system__ (void) { - interpreter& interp = __get_interpreter__ (who); + interpreter& interp = __get_interpreter__ (); return interp.get_load_save_system (); } - event_manager& __get_event_manager__ (const std::string& who) + event_manager& __get_event_manager__ (void) { - interpreter& interp = __get_interpreter__ (who); + interpreter& interp = __get_interpreter__ (); return interp.get_event_manager (); } - type_info& __get_type_info__ (const std::string& who) + type_info& __get_type_info__ (void) { - interpreter& interp = __get_interpreter__ (who); + interpreter& interp = __get_interpreter__ (); return interp.get_type_info (); } - symbol_table& __get_symbol_table__ (const std::string& who) + symbol_table& __get_symbol_table__ (void) { - interpreter& interp = __get_interpreter__ (who); + interpreter& interp = __get_interpreter__ (); return interp.get_symbol_table (); } - symbol_scope __get_current_scope__ (const std::string& who) + symbol_scope __get_current_scope__ (void) { - interpreter& interp = __get_interpreter__ (who); + interpreter& interp = __get_interpreter__ (); return interp.get_current_scope (); } - symbol_scope __require_current_scope__ (const std::string& who) + symbol_scope __require_current_scope__ (void) { - symbol_scope scope = __get_current_scope__ (who); + symbol_scope scope = __get_current_scope__ (); if (! scope) - error ("%s: symbol table scope missing", who.c_str ()); + error ("__require_current_scope__: symbol table scope missing"); return scope; } - tree_evaluator& __get_evaluator__ (const std::string& who) + tree_evaluator& __get_evaluator__ (void) { - interpreter& interp = __get_interpreter__ (who); + interpreter& interp = __get_interpreter__ (); return interp.get_evaluator (); } - bp_table& __get_bp_table__ (const std::string& who) + bp_table& __get_bp_table__ (void) { - tree_evaluator& tw = __get_evaluator__ (who); + tree_evaluator& tw = __get_evaluator__ (); return tw.get_bp_table (); } - child_list& __get_child_list__ (const std::string& who) + child_list& __get_child_list__ (void) { - interpreter& interp = __get_interpreter__ (who); + interpreter& interp = __get_interpreter__ (); return interp.get_child_list (); } - cdef_manager& __get_cdef_manager__ (const std::string& who) + cdef_manager& __get_cdef_manager__ (void) { - interpreter& interp = __get_interpreter__ (who); + interpreter& interp = __get_interpreter__ (); return interp.get_cdef_manager (); } - display_info& __get_display_info__ (const std::string& who) + display_info& __get_display_info__ (void) { - interpreter& interp = __get_interpreter__ (who); + interpreter& interp = __get_interpreter__ (); return interp.get_display_info (); } - gtk_manager& __get_gtk_manager__ (const std::string& who) + gtk_manager& __get_gtk_manager__ (void) { - interpreter& interp = __get_interpreter__ (who); + interpreter& interp = __get_interpreter__ (); return interp.get_gtk_manager (); } diff -r 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/interpreter-private.h --- a/libinterp/corefcn/interpreter-private.h Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/interpreter-private.h Mon Aug 29 13:58:00 2022 +0200 @@ -53,45 +53,45 @@ class tree_evaluator; class type_info; - extern OCTINTERP_API interpreter& __get_interpreter__ (const std::string& who); + extern OCTINTERP_API interpreter& __get_interpreter__ (void); - extern OCTINTERP_API dynamic_loader& __get_dynamic_loader__ (const std::string& who); + extern OCTINTERP_API dynamic_loader& __get_dynamic_loader__ (void); - extern OCTINTERP_API error_system& __get_error_system__ (const std::string& who); + extern OCTINTERP_API error_system& __get_error_system__ (void); - extern OCTINTERP_API gh_manager& __get_gh_manager__ (const std::string& who); + extern OCTINTERP_API gh_manager& __get_gh_manager__ (void); - extern OCTINTERP_API help_system& __get_help_system__ (const std::string& who); + extern OCTINTERP_API help_system& __get_help_system__ (void); - extern OCTINTERP_API input_system& __get_input_system__ (const std::string& who); + extern OCTINTERP_API input_system& __get_input_system__ (void); - extern OCTINTERP_API load_path& __get_load_path__ (const std::string& who); + extern OCTINTERP_API load_path& __get_load_path__ (void); - extern OCTINTERP_API load_save_system& __get_load_save_system__ (const std::string& who); + extern OCTINTERP_API load_save_system& __get_load_save_system__ (void); - extern OCTINTERP_API event_manager& __get_event_manager__ (const std::string& who); + extern OCTINTERP_API event_manager& __get_event_manager__ (void); - extern OCTINTERP_API output_system& __get_output_system__ (const std::string& who); + extern OCTINTERP_API output_system& __get_output_system__ (void); - extern OCTINTERP_API type_info& __get_type_info__ (const std::string& who); + extern OCTINTERP_API type_info& __get_type_info__ (void); - extern OCTINTERP_API symbol_table& __get_symbol_table__ (const std::string& who); + extern OCTINTERP_API symbol_table& __get_symbol_table__ (void); - extern OCTINTERP_API symbol_scope __get_current_scope__ (const std::string& who); + extern OCTINTERP_API symbol_scope __get_current_scope__ (void); - extern OCTINTERP_API symbol_scope __require_current_scope__ (const std::string& who); + extern OCTINTERP_API symbol_scope __require_current_scope__ (void); - extern OCTINTERP_API tree_evaluator& __get_evaluator__ (const std::string& who); + extern OCTINTERP_API tree_evaluator& __get_evaluator__ (void); - extern OCTINTERP_API bp_table& __get_bp_table__ (const std::string& who); + extern OCTINTERP_API bp_table& __get_bp_table__ (void); - extern OCTINTERP_API child_list& __get_child_list__ (const std::string& who); + extern OCTINTERP_API child_list& __get_child_list__ (void); - extern OCTINTERP_API cdef_manager& __get_cdef_manager__ (const std::string& who); + extern OCTINTERP_API cdef_manager& __get_cdef_manager__ (void); - extern OCTINTERP_API display_info& __get_display_info__ (const std::string& who); + extern OCTINTERP_API display_info& __get_display_info__ (void); - extern OCTINTERP_API gtk_manager& __get_gtk_manager__ (const std::string& who); + extern OCTINTERP_API gtk_manager& __get_gtk_manager__ (void); // Functions that could be methods in the interpreter class but maybe // shouldn't be exposed as part of the public interface. diff -r 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/interpreter.cc --- a/libinterp/corefcn/interpreter.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/interpreter.cc Mon Aug 29 13:58:00 2022 +0200 @@ -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" @@ -237,7 +236,9 @@ DEFMETHOD (atexit, interp, args, nargout, doc: /* -*- texinfo -*- @deftypefn {} {} atexit (@var{fcn}) -@deftypefnx {} {} atexit (@var{fcn}, @var{flag}) +@deftypefnx {} {} atexit (@var{fcn}, true) +@deftypefnx {} {} atexit (@var{fcn}, false) +@deftypefnx {} {@var{status} =} atexit (@var{fcn}, false) Register a function to be called when Octave exits. For example, @@ -268,8 +269,12 @@ will remove the function from the list and Octave will not call @code{last_words} when it exits. -Note that @code{atexit} only removes the first occurrence of a function -from the list, so if a function was placed in the list multiple times with +The optional output @var{status} is only available when unregistering a +function. The value is true if the unregistering was succesful and false +otherwise. + +Progamming Note: @code{atexit} only removes the first occurrence of a function +from the list; if a function was placed in the list multiple times with @code{atexit}, it must also be removed from the list multiple times. @seealso{quit} @end deftypefn */) @@ -302,8 +307,8 @@ DEFMETHOD (__traditional__, interp, , , doc: /* -*- texinfo -*- -@deftypefn {} {} __traditional__ () -Undocumented internal function. +@deftypefn {} {@var{tf} =} __traditional__ () +Return true if Octave was invoked with the @env{--traditional} option. @end deftypefn */) { return ovl (interp.traditional ()); @@ -344,7 +349,7 @@ bool verbose = false, bool require_file = true) { - interpreter& interp = __get_interpreter__ ("safe_source_file"); + interpreter& interp = __get_interpreter__ (); try { @@ -2028,24 +2033,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 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/interpreter.h --- a/libinterp/corefcn/interpreter.h Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/interpreter.h Mon Aug 29 13:58:00 2022 +0200 @@ -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 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/inv.cc --- a/libinterp/corefcn/inv.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/inv.cc Mon Aug 29 13:58:00 2022 +0200 @@ -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 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/kron.cc --- a/libinterp/corefcn/kron.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/kron.cc Mon Aug 29 13:58:00 2022 +0200 @@ -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 (); @@ -245,14 +245,14 @@ DEFUN (kron, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} kron (@var{A}, @var{B}) -@deftypefnx {} {} kron (@var{A1}, @var{A2}, @dots{}) +@deftypefn {} {@var{C} =} kron (@var{A}, @var{B}) +@deftypefnx {} {@var{C} =} kron (@var{A1}, @var{A2}, @dots{}) Form the Kronecker product of two or more matrices. This is defined block by block as @example -x = [ a(i,j)*b ] +c = [ a(i,j)*b ] @end example For example: diff -r 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/latex-text-renderer.cc --- a/libinterp/corefcn/latex-text-renderer.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/latex-text-renderer.cc Mon Aug 29 13:58:00 2022 +0200 @@ -128,7 +128,7 @@ text_renderer::string str ("", fnt, 0.0, 0.0); str.set_color (m_color); - gh_manager& gh_mgr = octave::__get_gh_manager__ ("text_to_strlist"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); gh_manager::latex_data ldata = gh_mgr.get_latex_data (key (txt, halign)); @@ -323,8 +323,7 @@ "latex_renderer:: failed to read png data. %s", ee.message ().c_str ()); - interpreter& interp - = __get_interpreter__ ("latex_renderer::read_image"); + interpreter& interp = __get_interpreter__ (); interp.recover_from_exception (); @@ -372,7 +371,7 @@ latex_renderer::render (const std::string& txt, int halign) { // Render if it was not already done - gh_manager& gh_mgr = octave::__get_gh_manager__ ("latex_renderer::render"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); gh_manager::latex_data ldata = gh_mgr.get_latex_data (key (txt, halign)); diff -r 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/load-path.cc --- a/libinterp/corefcn/load-path.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/load-path.cc Mon Aug 29 13:58:00 2022 +0200 @@ -158,7 +158,7 @@ // Look in private directory corresponding to current function (if // any). - symbol_scope scope = __get_current_scope__ ("find_private_file"); + symbol_scope scope = __get_current_scope__ (); octave_user_code *curr_code = scope ? scope.user_code () : nullptr; @@ -210,12 +210,12 @@ static void rehash_internal (void) { - load_path& lp = __get_load_path__ ("rehash_internal"); + load_path& lp = __get_load_path__ (); lp.update (); // Signal the GUI allowing updating the load path dialog - event_manager& evmgr = __get_event_manager__ ("rehash_internal"); + event_manager& evmgr = __get_event_manager__ (); evmgr.update_path_dialog (); // FIXME: maybe we should rename this variable since it is being @@ -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 @@ -1203,20 +1204,22 @@ void load_path::read_dir_config (const std::string& dir) const { + // use canonicalized path as key + const std::string key = sys::canonicalize_file_name (dir); + // read file with directory configuration - std::string conf_file = dir + sys::file_ops::dir_sep_str () - + ".oct-config"; + const std::string + conf_file = key + sys::file_ops::dir_sep_str () + ".oct-config"; FILE* cfile = sys::fopen (conf_file, "rb"); if (! cfile) { // reset directory encoding - input_system& input_sys - = __get_input_system__ ("load_path::read_dir_config"); + input_system& input_sys = __get_input_system__ (); std::string enc_val = "delete"; - input_sys.set_dir_encoding (dir, enc_val); + input_sys.set_dir_encoding (key, enc_val); return; } @@ -1256,16 +1259,14 @@ continue; // set encoding for this directory in input system - input_system& input_sys - = __get_input_system__ ("load_path::read_dir_config"); - input_sys.set_dir_encoding (dir, enc_val); + input_system& input_sys = __get_input_system__ (); + input_sys.set_dir_encoding (key, enc_val); return; } } // reset directory encoding - input_system& input_sys - = __get_input_system__ ("load_path::read_dir_config"); + input_system& input_sys = __get_input_system__ (); std::string enc_val = "delete"; input_sys.set_dir_encoding (dir, enc_val); @@ -1447,8 +1448,7 @@ // Skip updating if we don't know where we are, but don't // treat it as an error. - interpreter& interp - = __get_interpreter__ ("load_path::dir_info::update"); + interpreter& interp = __get_interpreter__ (); interp.recover_from_exception (); } @@ -1516,8 +1516,7 @@ // Skip updating if we don't know where we are but don't treat // it as an error. - interpreter& interp - = __get_interpreter__ ("load_path::dir_info::initialize"); + interpreter& interp = __get_interpreter__ (); interp.recover_from_exception (); } @@ -1799,7 +1798,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")) @@ -1965,12 +1965,12 @@ { if (file_info_list.empty ()) { - symbol_table& symtab - = __get_symbol_table__ ("load_path::package_info::add_to_fcn_map"); + symbol_table& symtab = __get_symbol_table__ (); 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 +1992,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 +2093,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 +2448,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)); } } } @@ -2456,8 +2459,8 @@ DEFUN (genpath, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} genpath (@var{dir}) -@deftypefnx {} {} genpath (@var{dir}, @var{skip}, @dots{}) +@deftypefn {} {@var{pathstr} =} genpath (@var{dir}) +@deftypefnx {} {@var{pathstr} =} genpath (@var{dir}, @var{skipdir1}, @dots{}) Return a path constructed from @var{dir} and all its subdirectories. The path does not include package directories (beginning with @samp{+}), @@ -2510,8 +2513,9 @@ DEFMETHOD (command_line_path, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} command_line_path () -Return the command line path variable. +@deftypefn {} {@var{pathstr} =} command_line_path () +Return the path argument given to Octave at the command line when the +interpreter was started (@env{--path @var{arg}}). @seealso{path, addpath, rmpath, genpath, pathdef, savepath, pathsep} @end deftypefn */) @@ -2526,9 +2530,10 @@ DEFMETHOD (restoredefaultpath, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} restoredefaultpath () +@deftypefn {} {@var{pathstr} =} restoredefaultpath () Restore Octave's path to its initial state at startup. +The re-initialized path is returned as an output. @seealso{path, addpath, rmpath, genpath, pathdef, savepath, pathsep} @end deftypefn */) { @@ -2549,7 +2554,7 @@ DEFMETHOD (__pathorig__, interp, , , doc: /* -*- texinfo -*- -@deftypefn {} {@var{val} =} __pathorig__ () +@deftypefn {} {@var{str} =} __pathorig__ () Undocumented internal function. @end deftypefn */) { @@ -2618,6 +2623,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {} addpath (@var{dir1}, @dots{}) @deftypefnx {} {} addpath (@var{dir1}, @dots{}, @var{option}) +@deftypefnx {} {@var{oldpath} =} addpath (@dots{}) Add named directories to the function search path. If @var{option} is @qcode{"-begin"} or 0 (the default), prepend the directory @@ -2755,7 +2761,8 @@ DEFMETHOD (rmpath, interp, args, nargout, doc: /* -*- texinfo -*- -@deftypefn {} {} rmpath (@var{dir1}, @dots{}) +@deftypefn {} {} rmpath (@var{dir1}, @dots{}) +@deftypefnx {} {@var{oldpath} =} rmpath (@var{dir1}, @dots{}) Remove @var{dir1}, @dots{} from the current function search path. In addition to accepting individual directory arguments, lists of @@ -2815,7 +2822,7 @@ DEFMETHOD (__dump_load_path__, interp, , , doc: /* -*- texinfo -*- @deftypefn {} {} __dump_load_path__ () -Undocumented internal function. +Pretty print Octave path directories and the files within each directory. @end deftypefn */) { load_path& lp = interp.get_load_path (); diff -r 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/load-save.cc --- a/libinterp/corefcn/load-save.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/load-save.cc Mon Aug 29 13:58:00 2022 +0200 @@ -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. @@ -2065,8 +2066,7 @@ void dump_octave_core (void) { - octave::load_save_system& load_save_sys - = octave::__get_load_save_system__ ("dump_octave_core"); + octave::load_save_system& load_save_sys = octave::__get_load_save_system__ (); load_save_sys.dump_octave_core (); } diff -r 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/ls-hdf5.cc --- a/libinterp/corefcn/ls-hdf5.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/ls-hdf5.cc Mon Aug 29 13:58:00 2022 +0200 @@ -307,17 +307,17 @@ // HDF5 doesn't print out all sorts of error messages if we // call H5Aopen for a non-existing attribute - H5E_auto_t err_func; - void *err_func_data; + H5E_auto_t err_fcn; + void *err_fcn_data; // turn off error reporting temporarily, but save the error // reporting function: #if defined (HAVE_HDF5_18) - H5Eget_auto (octave_H5E_DEFAULT, &err_func, &err_func_data); + H5Eget_auto (octave_H5E_DEFAULT, &err_fcn, &err_fcn_data); H5Eset_auto (octave_H5E_DEFAULT, nullptr, nullptr); #else - H5Eget_auto (&err_func, &err_func_data); + H5Eget_auto (&err_fcn, &err_fcn_data); H5Eset_auto (nullptr, nullptr); #endif @@ -332,9 +332,9 @@ // restore error reporting: #if defined (HAVE_HDF5_18) - H5Eset_auto (octave_H5E_DEFAULT, err_func, err_func_data); + H5Eset_auto (octave_H5E_DEFAULT, err_fcn, err_fcn_data); #else - H5Eset_auto (err_func, err_func_data); + H5Eset_auto (err_fcn, err_fcn_data); #endif return retval; @@ -355,17 +355,17 @@ // HDF5 doesn't print out all sorts of error messages if we // call H5Aopen for a non-existing attribute - H5E_auto_t err_func; - void *err_func_data; + H5E_auto_t err_fcn; + void *err_fcn_data; // turn off error reporting temporarily, but save the error // reporting function: #if defined (HAVE_HDF5_18) - H5Eget_auto (octave_H5E_DEFAULT, &err_func, &err_func_data); + H5Eget_auto (octave_H5E_DEFAULT, &err_fcn, &err_fcn_data); H5Eset_auto (octave_H5E_DEFAULT, nullptr, nullptr); #else - H5Eget_auto (&err_func, &err_func_data); + H5Eget_auto (&err_fcn, &err_fcn_data); H5Eset_auto (nullptr, nullptr); #endif @@ -384,9 +384,9 @@ // restore error reporting: #if defined (HAVE_HDF5_18) - H5Eset_auto (octave_H5E_DEFAULT, err_func, err_func_data); + H5Eset_auto (octave_H5E_DEFAULT, err_fcn, err_fcn_data); #else - H5Eset_auto (err_func, err_func_data); + H5Eset_auto (err_fcn, err_fcn_data); #endif return retval; @@ -622,8 +622,7 @@ args(0) = std::string (iftext_tmp); - octave::interpreter& interp - = octave::__get_interpreter__ ("load_inline_fcn"); + octave::interpreter& interp = octave::__get_interpreter__ (); octave_value_list tmp = interp.feval ("inline", args, 1); @@ -672,8 +671,7 @@ std::string vname = name; - octave::type_info& type_info - = octave::__get_type_info__ ("hdf5_read_next_data_internal"); + octave::type_info& type_info = octave::__get_type_info__ (); // Allow identifiers as all digits so we can load lists saved by // earlier versions of Octave. @@ -1272,7 +1270,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 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/ls-hdf5.h --- a/libinterp/corefcn/ls-hdf5.h Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/ls-hdf5.h Mon Aug 29 13:58:00 2022 +0200 @@ -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 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/ls-mat-ascii.cc --- a/libinterp/corefcn/ls-mat-ascii.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/ls-mat-ascii.cc Mon Aug 29 13:58:00 2022 +0200 @@ -356,8 +356,7 @@ } catch (const octave::execution_exception&) { - octave::interpreter& interp - = octave::__get_interpreter__ ("save_mat_ascii_data"); + octave::interpreter& interp = octave::__get_interpreter__ (); interp.recover_from_exception (); diff -r 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/ls-mat5.cc --- a/libinterp/corefcn/ls-mat5.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/ls-mat5.cc Mon Aug 29 13:58:00 2022 +0200 @@ -512,8 +512,7 @@ if (read_mat5_tag (is, swap, type, element_length, is_small_data_element)) return retval; // EOF - octave::interpreter& interp - = octave::__get_interpreter__ ("read_mat5_binary_element"); + octave::interpreter& interp = octave::__get_interpreter__ (); if (type == miCOMPRESSED) { @@ -913,7 +912,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 +940,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 +1042,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 +2705,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) @@ -2720,8 +2723,7 @@ octave_map m; - octave::load_path& lp - = octave::__get_load_path__ ("save_mat5_binary_element"); + octave::load_path& lp = octave::__get_load_path__ (); if (tc.isobject () && lp.find_method (tc.class_name (), "saveobj") != "") diff -r 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/ls-oct-binary.cc --- a/libinterp/corefcn/ls-oct-binary.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/ls-oct-binary.cc Mon Aug 29 13:58:00 2022 +0200 @@ -113,8 +113,7 @@ { args(0) = std::string (ctmp2); - octave::interpreter& interp - = octave::__get_interpreter__ ("load_inline_fcn"); + octave::interpreter& interp = octave::__get_interpreter__ (); octave_value_list tmp_inl = interp.feval ("inline", args, 1); @@ -247,8 +246,7 @@ if (! is.read (reinterpret_cast (&tmp), 1)) error ("load: trouble reading binary file '%s'", filename.c_str ()); - octave::type_info& type_info - = octave::__get_type_info__ ("read_binary_data"); + octave::type_info& type_info = octave::__get_type_info__ (); // All cases except 255 kept for backwards compatibility switch (tmp) diff -r 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/ls-oct-text.cc --- a/libinterp/corefcn/ls-oct-text.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/ls-oct-text.cc Mon Aug 29 13:58:00 2022 +0200 @@ -270,8 +270,7 @@ { args(0) = std::string (buf); - octave::interpreter& interp - = octave::__get_interpreter__ ("load_inline_fcn"); + octave::interpreter& interp = octave::__get_interpreter__ (); octave_value_list tmp = interp.feval ("inline", args, 1); @@ -336,8 +335,7 @@ } else { - octave::type_info& type_info - = octave::__get_type_info__ ("read_text_data"); + octave::type_info& type_info = octave::__get_type_info__ (); tc = type_info.lookup_type (typ); } @@ -463,7 +461,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 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/lsode.cc --- a/libinterp/corefcn/lsode.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/lsode.cc Mon Aug 29 13:58:00 2022 +0200 @@ -379,12 +379,12 @@ double tzero = out_times (0); - ODEFunc func (lsode_user_function); + ODEFunc fcn (lsode_user_function); if (lsode_jac.is_defined ()) - func.set_jacobian_function (lsode_user_jacobian); + fcn.set_jacobian_function (lsode_user_jacobian); - LSODE ode (state, tzero, func); + LSODE ode (state, tzero, fcn); ode.set_options (lsode_opts); diff -r 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/lu.cc --- a/libinterp/corefcn/lu.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/lu.cc Mon Aug 29 13:58:00 2022 +0200 @@ -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 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/mappers.cc --- a/libinterp/corefcn/mappers.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/mappers.cc Mon Aug 29 13:58:00 2022 +0200 @@ -41,8 +41,8 @@ DEFUN (abs, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} abs (@var{z}) -Compute the magnitude of @var{z}. +@deftypefn {} {@var{z} =} abs (@var{x}) +Compute the magnitude of @var{x}. The magnitude is defined as @tex @@ -88,7 +88,7 @@ DEFUN (acos, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} acos (@var{x}) +@deftypefn {} {@var{y} =} acos (@var{x}) Compute the inverse cosine in radians for each element of @var{x}. @seealso{cos, acosd} @end deftypefn */) @@ -148,7 +148,7 @@ DEFUN (acosh, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} acosh (@var{x}) +@deftypefn {} {@var{y} =} acosh (@var{x}) Compute the inverse hyperbolic cosine for each element of @var{x}. @seealso{cosh} @end deftypefn */) @@ -220,7 +220,7 @@ DEFUN (angle, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} angle (@var{z}) +@deftypefn {} {@var{theta} =} angle (@var{z}) @xref{XREFarg,,@code{arg}}. @seealso{arg} @end deftypefn */) @@ -233,8 +233,8 @@ DEFUN (arg, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} arg (@var{z}) -@deftypefnx {} {} angle (@var{z}) +@deftypefn {} {@var{theta} =} arg (@var{z}) +@deftypefnx {} {@var{theta} =} angle (@var{z}) Compute the argument, i.e., angle of @var{z}. This is defined as, @@ -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) @@ -288,7 +289,7 @@ DEFUN (asin, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} asin (@var{x}) +@deftypefn {} {@var{y} =} asin (@var{x}) Compute the inverse sine in radians for each element of @var{x}. @seealso{sin, asind} @end deftypefn */) @@ -353,7 +354,7 @@ DEFUN (asinh, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} asinh (@var{x}) +@deftypefn {} {@var{y} =} asinh (@var{x}) Compute the inverse hyperbolic sine for each element of @var{x}. @seealso{sinh} @end deftypefn */) @@ -395,7 +396,7 @@ DEFUN (atan, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} atan (@var{x}) +@deftypefn {} {@var{y} =} atan (@var{x}) Compute the inverse tangent in radians for each element of @var{x}. @seealso{tan, atand} @end deftypefn */) @@ -434,7 +435,7 @@ DEFUN (atanh, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} atanh (@var{x}) +@deftypefn {} {@var{y} =} atanh (@var{x}) Compute the inverse hyperbolic tangent for each element of @var{x}. @seealso{tanh} @end deftypefn */) @@ -469,7 +470,7 @@ DEFUN (cbrt, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} cbrt (@var{x}) +@deftypefn {} {@var{y} =} cbrt (@var{x}) Compute the real-valued cube root of each element of @var{x}. Unlike @code{@var{x}^(1/3)}, the result will be negative if @var{x} is @@ -501,7 +502,7 @@ DEFUN (ceil, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} ceil (@var{x}) +@deftypefn {} {@var{y} =} ceil (@var{x}) Return the smallest integer not less than @var{x}. This is equivalent to rounding towards positive infinity. @@ -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) @@ -543,7 +545,7 @@ DEFUN (conj, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} conj (@var{z}) +@deftypefn {} {@var{zc} =} conj (@var{z}) Return the complex conjugate of @var{z}. The complex conjugate is defined as @@ -581,7 +583,7 @@ DEFUN (cos, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} cos (@var{x}) +@deftypefn {} {@var{y} =} cos (@var{x}) Compute the cosine for each element of @var{x} in radians. @seealso{acos, cosd, cosh} @end deftypefn */) @@ -615,7 +617,7 @@ DEFUN (cosh, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} cosh (@var{x}) +@deftypefn {} {@var{y} =} cosh (@var{x}) Compute the hyperbolic cosine for each element of @var{x}. @seealso{acosh, sinh, tanh} @end deftypefn */) @@ -643,7 +645,7 @@ DEFUN (erf, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} erf (@var{z}) +@deftypefn {} {@var{v} =} erf (@var{z}) Compute the error function. The error function is defined as @@ -712,7 +714,7 @@ DEFUN (erfinv, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} erfinv (@var{x}) +@deftypefn {} {@var{y} =} erfinv (@var{x}) Compute the inverse error function. The inverse error function is defined such that @@ -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) @@ -749,7 +756,7 @@ DEFUN (erfcinv, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} erfcinv (@var{x}) +@deftypefn {} {@var{y} =} erfcinv (@var{x}) Compute the inverse complementary error function. The inverse complementary error function is defined such that @@ -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) @@ -786,7 +798,7 @@ DEFUN (erfc, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} erfc (@var{z}) +@deftypefn {} {@var{v} =} erfc (@var{z}) Compute the complementary error function. The complementary error function is defined as @@ -816,7 +828,7 @@ DEFUN (erfcx, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} erfcx (@var{z}) +@deftypefn {} {@var{v} =} erfcx (@var{z}) Compute the scaled complementary error function. The scaled complementary error function is defined as @@ -858,7 +870,7 @@ DEFUN (erfi, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} erfi (@var{z}) +@deftypefn {} {@var{v} =} erfi (@var{z}) Compute the imaginary error function. The imaginary error function is defined as @@ -895,7 +907,7 @@ DEFUN (dawson, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} dawson (@var{z}) +@deftypefn {} {@var{v} =} dawson (@var{z}) Compute the Dawson (scaled imaginary error) function. The Dawson function is defined as @@ -934,7 +946,7 @@ DEFUN (exp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} exp (@var{x}) +@deftypefn {} {@var{y} =} exp (@var{x}) Compute @tex $e^{x}$ @@ -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])) @@ -969,7 +983,7 @@ DEFUN (expm1, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} expm1 (@var{x}) +@deftypefn {} {@var{y} =} expm1 (@var{x}) Compute @tex $ e^{x} - 1 $ @@ -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. @@ -1036,7 +1050,7 @@ DEFUN (fix, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} fix (@var{x}) +@deftypefn {} {@var{y} =} fix (@var{x}) Truncate fractional portion of @var{x} and return the integer portion. This is equivalent to rounding towards zero. If @var{x} is complex, return @@ -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) @@ -1069,7 +1084,7 @@ DEFUN (floor, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} floor (@var{x}) +@deftypefn {} {@var{y} =} floor (@var{x}) Return the largest integer not greater than @var{x}. This is equivalent to rounding towards negative infinity. If @var{x} is @@ -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) @@ -1102,7 +1118,7 @@ DEFUN (gamma, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} gamma (@var{z}) +@deftypefn {} {@var{v} =} gamma (@var{z}) Compute the Gamma function. The Gamma function is defined as @@ -1171,7 +1187,7 @@ DEFUN (imag, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} imag (@var{z}) +@deftypefn {} {@var{y} =} imag (@var{z}) Return the imaginary part of @var{z} as a real number. @seealso{real, conj} @end deftypefn */) @@ -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} @@ -1646,9 +1668,12 @@ DEFUN (lgamma, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} gammaln (@var{x}) -@deftypefnx {} {} lgamma (@var{x}) +@deftypefn {} {@var{y} =} gammaln (@var{x}) +@deftypefnx {} {@var{y} =} lgamma (@var{x}) Return the natural logarithm of the gamma function of @var{x}. + +Programming Note: @code{lgamma} is an alias for @code{gammaln} and either name +can be used in Octave. @seealso{gamma, gammainc} @end deftypefn */) { @@ -1689,7 +1714,7 @@ DEFUN (log, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} log (@var{x}) +@deftypefn {} {@var{y} =} log (@var{x}) Compute the natural logarithm, @tex $\ln{(x)},$ @@ -1714,7 +1739,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) @@ -1722,7 +1748,7 @@ DEFUN (log10, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} log10 (@var{x}) +@deftypefn {} {@var{y} =} log10 (@var{x}) Compute the base-10 logarithm of each element of @var{x}. @seealso{log, log2, logspace, exp} @end deftypefn */) @@ -1735,7 +1761,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) @@ -1743,7 +1770,7 @@ DEFUN (log1p, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} log1p (@var{x}) +@deftypefn {} {@var{y} =} log1p (@var{x}) Compute @tex $\ln{(1 + x)}$ @@ -1778,7 +1805,7 @@ DEFUN (real, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} real (@var{z}) +@deftypefn {} {@var{x} =} real (@var{z}) Return the real part of @var{z}. @seealso{imag, conj} @end deftypefn */) @@ -1806,7 +1833,7 @@ DEFUN (round, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} round (@var{x}) +@deftypefn {} {@var{y} =} round (@var{x}) Return the integer nearest to @var{x}. If @var{x} is complex, return @@ -1851,7 +1878,7 @@ DEFUN (roundb, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} roundb (@var{x}) +@deftypefn {} {@var{y} =} roundb (@var{x}) Return the integer nearest to @var{x}. If there are two nearest integers, return the even one (banker's rounding). @@ -1891,7 +1918,7 @@ DEFUN (sign, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} sign (@var{x}) +@deftypefn {} {@var{y} =} sign (@var{x}) Compute the @dfn{signum} function. This is defined as @@ -1943,7 +1970,7 @@ DEFUNX ("signbit", Fsignbit, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} signbit (@var{x}) +@deftypefn {} {@var{y} =} signbit (@var{x}) Return logical true if the value of @var{x} has its sign bit set and false otherwise. @@ -1982,7 +2009,7 @@ DEFUN (sin, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} sin (@var{x}) +@deftypefn {} {@var{y} =} sin (@var{x}) Compute the sine for each element of @var{x} in radians. @seealso{asin, sind, sinh} @end deftypefn */) @@ -2014,7 +2041,7 @@ DEFUN (sinh, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} sinh (@var{x}) +@deftypefn {} {@var{y} =} sinh (@var{x}) Compute the hyperbolic sine for each element of @var{x}. @seealso{asinh, cosh, tanh} @end deftypefn */) @@ -2042,7 +2069,7 @@ DEFUN (sqrt, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} sqrt (@var{x}) +@deftypefn {} {@var{y} =} sqrt (@var{x}) Compute the square root of each element of @var{x}. If @var{x} is negative, a complex result is returned. @@ -2061,12 +2088,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) @@ -2074,7 +2105,7 @@ DEFUN (tan, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} tan (@var{z}) +@deftypefn {} {@var{y} =} tan (@var{z}) Compute the tangent for each element of @var{x} in radians. @seealso{atan, tand, tanh} @end deftypefn */) @@ -2106,7 +2137,7 @@ DEFUN (tanh, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} tanh (@var{x}) +@deftypefn {} {@var{y} =} tanh (@var{x}) Compute hyperbolic tangent for each element of @var{x}. @seealso{atanh, sinh, cosh} @end deftypefn */) @@ -2134,8 +2165,8 @@ DEFUNX ("tolower", Ftolower, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} tolower (@var{s}) -@deftypefnx {} {} lower (@var{s}) +@deftypefn {} {@var{y} =} tolower (@var{s}) +@deftypefnx {} {@var{y} =} lower (@var{s}) Return a copy of the string or cell string @var{s}, with each uppercase character replaced by the corresponding lowercase one; non-alphabetic characters are left unchanged. @@ -2148,6 +2179,10 @@ @result{} "mixed case 123" @end group @end example + +Programming Note: @code{lower} is an alias for @code{tolower} and either name +can be used in Octave. + @seealso{toupper} @end deftypefn */) { @@ -2162,10 +2197,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]}) @@ -2200,8 +2237,8 @@ DEFUNX ("toupper", Ftoupper, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} toupper (@var{s}) -@deftypefnx {} {} upper (@var{s}) +@deftypefn {} {@var{y} =} toupper (@var{s}) +@deftypefnx {} {@var{y} =} upper (@var{s}) Return a copy of the string or cell string @var{s}, with each lowercase character replaced by the corresponding uppercase one; non-alphabetic characters are left unchanged. @@ -2214,6 +2251,10 @@ @result{} "MIXED CASE 123" @end group @end example + +Programming Note: @code{upper} is an alias for @code{toupper} and either name +can be used in Octave. + @seealso{tolower} @end deftypefn */) { @@ -2228,10 +2269,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 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/matrix_type.cc --- a/libinterp/corefcn/matrix_type.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/matrix_type.cc Mon Aug 29 13:58:00 2022 +0200 @@ -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 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/max.cc --- a/libinterp/corefcn/max.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/max.cc Mon Aug 29 13:58:00 2022 +0200 @@ -248,7 +248,7 @@ octave_value_list retval (nargout > 1 ? 2 : 1); - const char *func = (ismin ? "min" : "max"); + const char *fcn = (ismin ? "min" : "max"); if (nargin == 3 || nargin == 1) { @@ -259,10 +259,10 @@ dim = args(2).int_value (true) - 1; if (dim < 0) - error ("%s: DIM must be a valid dimension", func); + error ("%s: DIM must be a valid dimension", fcn); if (! args(1).isempty ()) - warning ("%s: second argument is ignored", func); + warning ("%s: second argument is ignored", fcn); } switch (arg.builtin_type ()) @@ -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 ()) @@ -347,7 +348,7 @@ break; default: - err_wrong_type_arg (func, arg); + err_wrong_type_arg (fcn, arg); } } else @@ -424,7 +425,7 @@ // break; default: - error ("%s: cannot compute %s (%s, %s)", func, func, + error ("%s: cannot compute %s (%s, %s)", fcn, fcn, argx.type_name ().c_str (), argy.type_name ().c_str ()); } @@ -439,10 +440,10 @@ DEFUN (min, args, nargout, doc: /* -*- texinfo -*- -@deftypefn {} {} min (@var{x}) -@deftypefnx {} {} min (@var{x}, [], @var{dim}) -@deftypefnx {} {[@var{w}, @var{iw}] =} min (@var{x}) -@deftypefnx {} {} min (@var{x}, @var{y}) +@deftypefn {} {@var{m} =} min (@var{x}) +@deftypefnx {} {@var{m} =} min (@var{x}, [], @var{dim}) +@deftypefnx {} {[@var{m}, @var{im}] =} min (@var{x}) +@deftypefnx {} {@var{m} =} min (@var{x}, @var{y}) Find minimum values in the array @var{x}. For a vector argument, return the minimum value. For a matrix argument, @@ -661,10 +662,10 @@ DEFUN (max, args, nargout, doc: /* -*- texinfo -*- -@deftypefn {} {} max (@var{x}) -@deftypefnx {} {} max (@var{x}, [], @var{dim}) -@deftypefnx {} {[@var{w}, @var{iw}] =} max (@var{x}) -@deftypefnx {} {} max (@var{x}, @var{y}) +@deftypefn {} {@var{m} =} max (@var{x}) +@deftypefnx {} {@var{m} =} max (@var{x}, [], @var{dim}) +@deftypefnx {} {[@var{m}, @var{im}] =} max (@var{x}) +@deftypefnx {} {@var{m} =} max (@var{x}, @var{y}) Find maximum values in the array @var{x}. For a vector argument, return the maximum value. For a matrix argument, @@ -924,7 +925,7 @@ if (nargin < 1 || nargin > 2) print_usage (); - const char *func = (ismin ? "cummin" : "cummax"); + const char *fcn = (ismin ? "cummin" : "cummax"); octave_value arg = args(0); int dim = -1; @@ -933,7 +934,7 @@ dim = args(1).int_value (true) - 1; if (dim < 0) - error ("%s: DIM must be a valid dimension", func); + error ("%s: DIM must be a valid dimension", fcn); } octave_value_list retval; @@ -984,7 +985,7 @@ break; default: - err_wrong_type_arg (func, arg); + err_wrong_type_arg (fcn, arg); } return retval; @@ -992,9 +993,9 @@ DEFUN (cummin, args, nargout, doc: /* -*- texinfo -*- -@deftypefn {} {} cummin (@var{x}) -@deftypefnx {} {} cummin (@var{x}, @var{dim}) -@deftypefnx {} {[@var{w}, @var{iw}] =} cummin (@var{x}) +@deftypefn {} {@var{M} =} cummin (@var{x}) +@deftypefnx {} {@var{M} =} cummin (@var{x}, @var{dim}) +@deftypefnx {} {[@var{M}, @var{IM}] =} cummin (@var{x}) Return the cumulative minimum values along dimension @var{dim}. If @var{dim} is unspecified it defaults to column-wise operation. For @@ -1012,10 +1013,10 @@ @example @group -[w, iw] = cummin ([5 4 6 2 3 1]) +[M, IM] = cummin ([5 4 6 2 3 1]) @result{} -w = 5 4 4 2 2 1 -iw = 1 2 2 4 4 6 +M = 5 4 4 2 2 1 +IM = 1 2 2 4 4 6 @end group @end example @@ -1047,9 +1048,9 @@ DEFUN (cummax, args, nargout, doc: /* -*- texinfo -*- -@deftypefn {} {} cummax (@var{x}) -@deftypefnx {} {} cummax (@var{x}, @var{dim}) -@deftypefnx {} {[@var{w}, @var{iw}] =} cummax (@dots{}) +@deftypefn {} {@var{M} =} cummax (@var{x}) +@deftypefnx {} {@var{M} =} cummax (@var{x}, @var{dim}) +@deftypefnx {} {[@var{M}, @var{IM}] =} cummax (@dots{}) Return the cumulative maximum values along dimension @var{dim}. If @var{dim} is unspecified it defaults to column-wise operation. For @@ -1069,8 +1070,8 @@ @group [w, iw] = cummax ([1 3 2 6 4 5]) @result{} -w = 1 3 3 6 6 6 -iw = 1 2 2 4 4 4 +M = 1 3 3 6 6 6 +IM = 1 2 2 4 4 4 @end group @end example diff -r 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/mex-private.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libinterp/corefcn/mex-private.h Mon Aug 29 13:58:00 2022 +0200 @@ -0,0 +1,39 @@ +//////////////////////////////////////////////////////////////////////// +// +// 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_mex_private_h) +#define octave_mex_private_h 1 + +#include "octave-config.h" + +OCTAVE_NAMESPACE_BEGIN + +extern OCTINTERP_API octave_value_list +call_mex (octave_mex_function& mex_fcn, const octave_value_list& args, + int nargout_arg); + +OCTAVE_NAMESPACE_END + +#endif diff -r 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/mex.cc --- a/libinterp/corefcn/mex.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/mex.cc Mon Aug 29 13:58:00 2022 +0200 @@ -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; @@ -3445,8 +3448,7 @@ { if (! m_fname) { - octave::tree_evaluator& tw - = octave::__get_evaluator__ ("mex::function_name"); + octave::tree_evaluator& tw = octave::__get_evaluator__ (); octave_function *fcn = tw.current_function (); @@ -4774,6 +4776,8 @@ typedef F77_RET_T (*fmex_fptr) (F77_INT& nlhs, mxArray **plhs, F77_INT& nrhs, mxArray **prhs); +OCTAVE_NAMESPACE_BEGIN + octave_value_list call_mex (octave_mex_function& mex_fcn, const octave_value_list& args, int nargout_arg) @@ -4845,6 +4849,8 @@ return retval; } +OCTAVE_NAMESPACE_END + // C interface to mex functions: const char * @@ -4888,7 +4894,7 @@ { octave_value_list args = mx_to_ov_args (nargin, argin); - octave::interpreter& interp = octave::__get_interpreter__ ("mexCallMATLAB"); + octave::interpreter& interp = octave::__get_interpreter__ (); bool execution_error = false; @@ -4985,7 +4991,7 @@ { int retval = 0; - octave::interpreter& interp = octave::__get_interpreter__ ("mexEvalString"); + octave::interpreter& interp = octave::__get_interpreter__ (); int parse_status; bool execution_error = false; @@ -5014,7 +5020,7 @@ { mxArray *mx = nullptr; - octave::interpreter& interp = octave::__get_interpreter__ ("mexEvalString"); + octave::interpreter& interp = octave::__get_interpreter__ (); int parse_status; bool execution_error = false; @@ -5152,7 +5158,7 @@ octave_value val; - octave::interpreter& interp = octave::__get_interpreter__ ("mexGetVariable"); + octave::interpreter& interp = octave::__get_interpreter__ (); if (! strcmp (space, "global")) val = interp.global_varval (name); @@ -5217,7 +5223,7 @@ if (! name || name[0] == '\0') return 1; - octave::interpreter& interp = octave::__get_interpreter__ ("mexPutVariable"); + octave::interpreter& interp = octave::__get_interpreter__ (); if (! strcmp (space, "global")) { @@ -5347,7 +5353,7 @@ { const char *fname = mexFunctionName (); - octave::interpreter& interp = octave::__get_interpreter__ ("mexIsLocked"); + octave::interpreter& interp = octave::__get_interpreter__ (); retval = interp.mislocked (fname); } @@ -5369,7 +5375,7 @@ else mex_lock_count[fname]++; - octave::interpreter& interp = octave::__get_interpreter__ ("mexLock"); + octave::interpreter& interp = octave::__get_interpreter__ (); interp.mlock (); } @@ -5411,8 +5417,7 @@ if (count == 0) { - octave::interpreter& interp - = octave::__get_interpreter__ ("mexUnLock"); + octave::interpreter& interp = octave::__get_interpreter__ (); interp.munlock (fname); diff -r 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/module.mk --- a/libinterp/corefcn/module.mk Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/module.mk Mon Aug 29 13:58:00 2022 +0200 @@ -103,6 +103,7 @@ NOINSTALL_COREFCN_INC = \ %reldir%/interpreter-private.h \ + %reldir%/mex-private.h \ %reldir%/oct-hdf5.h \ %reldir%/oct-opengl.h @@ -231,6 +232,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 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/mxarray.h --- a/libinterp/corefcn/mxarray.h Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/mxarray.h Mon Aug 29 13:58:00 2022 +0200 @@ -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 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/nproc.cc --- a/libinterp/corefcn/nproc.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/nproc.cc Mon Aug 29 13:58:00 2022 +0200 @@ -36,8 +36,8 @@ DEFUN (nproc, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} nproc () -@deftypefnx {} {} nproc (@var{query}) +@deftypefn {} {@var{n} =} nproc () +@deftypefnx {} {@var{n} =} nproc (@var{query}) Return the current number of available (logical) processors. This returns the number of logical processors. For processors with diff -r 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/oct-errno.in.cc --- a/libinterp/corefcn/oct-errno.in.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/oct-errno.in.cc Mon Aug 29 13:58:00 2022 +0200 @@ -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 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/oct-hist.cc --- a/libinterp/corefcn/oct-hist.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/oct-hist.cc Mon Aug 29 13:58:00 2022 +0200 @@ -142,8 +142,7 @@ { if (command_history::add (tmp)) { - event_manager& evmgr - = __get_event_manager__ ("edit_history_add_hist"); + event_manager& evmgr = __get_event_manager__ (); evmgr.append_history (tmp); } @@ -614,7 +613,6 @@ @end deftypefn */) { // FIXME: should this be limited to the top-level context? - if (args.length () > 2) print_usage (); @@ -629,8 +627,8 @@ doc: /* -*- texinfo -*- @deftypefn {} {} history @deftypefnx {} {} history @var{opt1} @dots{} -@deftypefnx {} {@var{h} =} history () -@deftypefnx {} {@var{h} =} history (@var{opt1}, @dots{}) +@deftypefnx {} {@var{H} =} history () +@deftypefnx {} {@var{H} =} history (@var{opt1}, @dots{}) If invoked with no arguments, @code{history} displays a list of commands that you have executed. @@ -867,7 +865,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 +900,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 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/oct-map.cc --- a/libinterp/corefcn/oct-map.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/oct-map.cc Mon Aug 29 13:58:00 2022 +0200 @@ -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 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/oct-opengl.h --- a/libinterp/corefcn/oct-opengl.h Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/oct-opengl.h Mon Aug 29 13:58:00 2022 +0200 @@ -70,9 +70,9 @@ // class that does nothing. This makes the implementation of // other things that rely on this class slightly simpler. - virtual void glAlphaFunc (GLenum func, GLclampf ref) + virtual void glAlphaFunc (GLenum fcn, GLclampf ref) { - ::glAlphaFunc (func, ref); + ::glAlphaFunc (fcn, ref); } virtual void glBegin (GLenum mode) @@ -160,9 +160,9 @@ ::glDeleteTextures (n, textures); } - virtual void glDepthFunc (GLenum func) + virtual void glDepthFunc (GLenum fcn) { - ::glDepthFunc (func); + ::glDepthFunc (fcn); } virtual void glDisable (GLenum cap) diff -r 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/oct-stream.cc --- a/libinterp/corefcn/oct-stream.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/oct-stream.cc Mon Aug 29 13:58:00 2022 +0200 @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -42,7 +43,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 +50,7 @@ #include "octave-preserve-stream-state.h" #include "quit.h" #include "str-vec.h" +#include "strcase-wrappers.h" #include "error.h" #include "errwarn.h" @@ -99,7 +100,7 @@ } catch (const execution_exception&) { - interpreter& interp = __get_interpreter__ ("convert_to_valid_int"); + interpreter& interp = __get_interpreter__ (); interp.recover_from_exception (); @@ -351,9 +352,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, @@ -1248,7 +1249,7 @@ // Load new data into buffer, and set eob, last, idx. // Return EOF at end of file, 0 otherwise. - int refresh_buf (void); + int refresh_buf (bool initialize = false); // Get a character, relying on caller to call field_done if // a delimiter has been reached. @@ -1293,7 +1294,7 @@ bool eof (void) { - return (m_eob == m_buf && m_i_stream.eof ()) + return (m_eob == m_buf + m_overlap && m_i_stream.eof ()) || (m_flags & std::ios_base::eofbit); } @@ -1319,6 +1320,17 @@ bool no_progress (void) { return m_progress_marker == m_idx; } + // Number of characters remaining until end of stream if it is already + // buffered. int_max otherwise. + + std::ptrdiff_t remaining (void) + { + if (m_eob < m_buf + m_bufsize) + return m_eob - m_idx; + else + return std::numeric_limits::max (); + } + private: // Number of characters to read from the file at once. @@ -1340,6 +1352,9 @@ // Position after last character in buffer. char *m_eob; + // Overlap with old content when refreshing buffer. + std::ptrdiff_t m_overlap; + // True if there is delimiter in the buffer after idx. bool m_delimited; @@ -1374,7 +1389,7 @@ m_eob = m_buf + m_bufsize; m_idx = m_eob; // refresh_buf shouldn't try to copy old data m_progress_marker = m_idx; - refresh_buf (); // load the first batch of data + refresh_buf (true); // load the first batch of data } // Used to create a stream from a strstream from data read from a dstr. @@ -1390,7 +1405,7 @@ { m_i_stream.clear (); m_i_stream.seekg (m_buf_in_file); - m_i_stream.read (m_buf, m_idx - m_buf); + m_i_stream.read (m_buf, m_idx - m_buf - m_overlap); } delete [] m_buf; @@ -1448,7 +1463,7 @@ // processed. int - delimited_stream::refresh_buf (void) + delimited_stream::refresh_buf (bool initialize) { if (eof ()) return std::istream::traits_type::eof (); @@ -1459,36 +1474,54 @@ m_idx = m_eob; std::size_t old_remaining = m_eob - m_idx; + std::size_t old_overlap = 0; + + if (initialize || (m_idx - m_buf <= 0)) + m_overlap = 0; + else + { + old_overlap = m_overlap; + // Retain the last 25 bytes in the buffer. That should be more than enough + // to putback an entire double precision floating point number in decimal + // including 3 digit exponent and signs. Do we ever need to putback more + // than that? + m_overlap = 25; + // Assure we don't "underflow" with the overlap + m_overlap = std::min (m_overlap, m_idx - m_buf - 1); + } octave_quit (); // allow ctrl-C - if (old_remaining > 0) - { - m_buf_in_file += (m_idx - m_buf); - memmove (m_buf, m_idx, old_remaining); + if (old_remaining + m_overlap > 0) + { + m_buf_in_file += (m_idx - old_overlap - m_buf); + std::memmove (m_buf, m_idx - m_overlap, m_overlap + old_remaining); } else m_buf_in_file = m_i_stream.tellg (); // record for destructor - m_progress_marker -= m_idx - m_buf; // where original idx would have been - m_idx = m_buf; + // where original idx would have been + m_progress_marker -= m_idx - m_overlap - m_buf; + m_idx = m_buf + m_overlap; int gcount; // chars read if (! m_i_stream.eof ()) { - m_i_stream.read (m_buf + old_remaining, m_bufsize - old_remaining); + m_i_stream.read (m_buf + m_overlap + old_remaining, + m_bufsize - m_overlap - old_remaining); gcount = m_i_stream.gcount (); } else gcount = 0; - m_eob = m_buf + old_remaining + gcount; + m_eob = m_buf + m_overlap + old_remaining + gcount; m_last = m_eob; if (gcount == 0) { m_delimited = false; - if (m_eob != m_buf) // no more data in file, but still some to go + if (m_eob != m_buf + m_overlap) + // no more data in file, but still some to go retval = 0; else // file and buffer are both done. @@ -1498,13 +1531,14 @@ { m_delimited = true; - for (m_last = m_eob - m_longest; m_last - m_buf >= 0; m_last--) + for (m_last = m_eob - m_longest; m_last - m_buf - m_overlap >= 0; + m_last--) { if (m_delims.find (*m_last) != std::string::npos) break; } - if (m_last < m_buf) + if (m_last < m_buf + m_overlap) m_delimited = false; retval = 0; @@ -1528,7 +1562,7 @@ { char *retval; - if (m_eob - m_idx > size) + if (m_eob - m_idx >= size) { retval = m_idx; m_idx += size; @@ -1755,7 +1789,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: @@ -2616,8 +2651,8 @@ } // Finally, create the stream. delimited_stream is (isp, - (m_delim_table.empty () ? m_whitespace + "\r\n" - : m_delims), + (m_delims.empty () ? m_whitespace + "\r\n" + : m_delims), max_lookahead, buf_size); // Grow retval dynamically. "size" is half the initial size @@ -2792,12 +2827,12 @@ double retval = 0; bool valid = false; // syntactically correct double? - int ch = is.peek (); + int ch = is.peek_undelim (); if (ch == '+') { is.get (); - ch = is.peek (); + ch = is.peek_undelim (); if (width_left) width_left--; } @@ -2805,7 +2840,7 @@ { sign = -1; is.get (); - ch = is.peek (); + ch = is.peek_undelim (); if (width_left) width_left--; } @@ -2853,6 +2888,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) @@ -2866,7 +2906,7 @@ bool used_exp = false; if (valid && width_left > 1 && m_exp_chars.find (ch) != std::string::npos) { - int ch1 = is.peek (); + int ch1 = is.peek_undelim (); if (ch1 == '-' || ch1 == '+' || (ch1 >= '0' && ch1 <= '9')) { // if 1.0e+$ or some such, this will set failbit, as we want @@ -2885,7 +2925,7 @@ is.get (); } valid = false; - while (width_left-- && is && (ch = is.get ()) >= '0' && ch <= '9') + while (width_left-- && is && (ch = is.get_undelim ()) >= '0' && ch <= '9') { exp = exp*10 + ch - '0'; valid = true; @@ -2908,9 +2948,9 @@ is.putback (ch); // Check for +/- inf and NaN - if (! valid && width_left >= 3) - { - int i = lookahead (is, m_inf_nan, 3, false); // false -> case insensitive + if (! valid && width_left >= 3 && is.remaining () >= 3) + { + int i = lookahead (is, m_inf_nan, 3, false); // false->case insensitive if (i == 0) { retval = numeric_limits::Inf (); @@ -2944,23 +2984,23 @@ bool as_empty = false; // did we fail but match a "treat_as_empty" string? bool inf = false; - int ch = is.peek (); + int ch = is.peek_undelim (); if (ch == '+' || ch == '-') // check for [+-][ij] with no coefficients { ch = is.get (); - int ch2 = is.peek (); + int ch2 = is.peek_undelim (); if (ch2 == 'i' || ch2 == 'j') { double value = 1; is.get (); // Check not -inf - if (is.peek () == 'n') + if (is.peek_undelim () == 'n') { char *pos = is.tellg (); std::ios::iostate state = is.rdstate (); is.get (); - ch2 = is.get (); + ch2 = is.get_undelim (); if (ch2 == 'f') { inf = true; @@ -2971,6 +3011,8 @@ else { is.clear (state); + // FIXME: Buffer might have refreshed. + // pos might no longer be valid. is.seekg (pos); // reset to position before look-ahead } } @@ -2986,6 +3028,7 @@ char *pos = is.tellg (); std::ios::iostate state = is.rdstate (); //re = read_value (is); + // FIXME: read_double might refresh the buffer. So seekg might be off. re = read_double (is, fmt); // check for "treat as empty" string @@ -3037,7 +3080,8 @@ { state = is.rdstate (); // before tellg, since that fails at EOF - ch = is.peek (); // ch == EOF if read failed; no need to chk fail + ch = is.peek_undelim (); + // ch == EOF if read failed; no need to chk fail if (ch == 'i' || ch == 'j') // pure imaginary { is.get (); @@ -3051,11 +3095,13 @@ state = is.rdstate (); //im = read_value (is); + // FIXME: read_double might refresh the buffer. + // So seekg might be off after this. im = read_double (is, fmt); if (is.fail ()) im = 1; - if (is.peek () == 'i' || is.peek () == 'j') + if (is.peek_undelim () == 'i' || is.peek_undelim () == 'j') is.get (); else { @@ -3166,7 +3212,7 @@ val.append (std::max (val.length (), static_cast (16)), '\0'); - int ch = is.get (); + int ch = is.get_undelim (); if (is_delim (ch) || ch == std::istream::traits_type::eof ()) { is.putback (ch); @@ -3224,7 +3270,7 @@ { skip_whitespace (is); - if (is.peek () != '"') + if (is.peek_undelim () != '"') scan_string (is, fmt, val); else { @@ -3505,7 +3551,7 @@ { if (m_delim_list.isempty ()) { - if (! is_delim (is.peek ())) + if (! is_delim (is.peek_undelim ())) this_conversion_failed = true; } else // Cell array of multi-character delimiters @@ -3929,7 +3975,7 @@ { is.get (); if (c1 == m_eol1 && is.peek_undelim () == m_eol2) - is.get_undelim (); // if \r\n, skip the \n too. + is.get (); // if \r\n, skip the \n too. if (multiple_delims_as_one) { @@ -4042,7 +4088,7 @@ base_stream::clearerr (void) { std::istream *is = input_stream (); - std::ostream *os = output_stream (); + std::ostream *os = preferred_output_stream (); if (is) is->clear (); @@ -4058,7 +4104,7 @@ base_stream::do_gets (octave_idx_type max_len, bool& err, bool strip_newline, const std::string& who) { - interpreter& interp = __get_interpreter__ ("base_stream::do_gets"); + interpreter& interp = __get_interpreter__ (); if (interp.interactive () && file_number () == 0) ::error ("%s: unable to read from stdin while running interactively", @@ -4175,7 +4221,7 @@ off_t base_stream::skipl (off_t num, bool& err, const std::string& who) { - interpreter& interp = __get_interpreter__ ("base_stream::skipl"); + interpreter& interp = __get_interpreter__ (); if (interp.interactive () && file_number () == 0) ::error ("%s: unable to read from stdin while running interactively", @@ -4670,7 +4716,7 @@ octave_idx_type& conversion_count, const std::string& who) { - interpreter& interp = __get_interpreter__ ("base_stream::do_scanf"); + interpreter& interp = __get_interpreter__ (); if (interp.interactive () && file_number () == 0) ::error ("%s: unable to read from stdin while running interactively", @@ -5297,7 +5343,7 @@ // FIXME: is this the right thing to do? - interpreter& interp = __get_interpreter__ ("base_stream::do_oscanf"); + interpreter& interp = __get_interpreter__ (); if (interp.interactive () && ! application::forced_interactive () && name () == "stdin") @@ -5392,7 +5438,7 @@ const std::string& who, octave_idx_type& read_count) { - interpreter& interp = __get_interpreter__ ("base_stream::do_textscan"); + interpreter& interp = __get_interpreter__ (); if (interp.interactive () && file_number () == 0) ::error ("%s: unable to read from stdin while running interactively", @@ -5422,7 +5468,7 @@ { int retval = -1; - std::ostream *os = output_stream (); + std::ostream *os = preferred_output_stream (); if (! os) invalid_operation ("fflush", "writing"); @@ -5632,24 +5678,23 @@ template static int - do_printf_conv (std::ostream& os, const std::string& encoding, - const char *fmt, int nsa, int sa_1, int sa_2, T arg, - const std::string& who) + do_printf_conv (std::ostream& os, const char *fmt, int nsa, int sa_1, + int sa_2, T arg, const std::string& who) { int retval = 0; switch (nsa) { case 2: - retval = format (os, encoding, fmt, sa_1, sa_2, arg); + retval = format (os, fmt, sa_1, sa_2, arg); break; case 1: - retval = format (os, encoding, fmt, sa_1, arg); + retval = format (os, fmt, sa_1, arg); break; case 0: - retval = format (os, encoding, fmt, arg); + retval = format (os, fmt, arg); break; default: @@ -5663,7 +5708,7 @@ static std::size_t do_printf_string (std::ostream& os, const printf_format_elt *elt, int nsa, int sa_1, int sa_2, const std::string& arg, - const std::string& encoding, const std::string& who) + const std::string& who) { if (nsa > 2) ::error ("%s: internal error handling format", who.c_str ()); @@ -5677,12 +5722,6 @@ std::size_t prec = (nsa > 1 ? sa_2 : (elt->prec == -1 ? len : elt->prec)); std::string print_str = prec < arg.length () ? arg.substr (0, prec) : arg; - if (encoding.compare ("utf-8")) - { - std::size_t src_len = print_str.length (); - print_str = string::u8_to_encoding (who, print_str, encoding); - len -= src_len - print_str.length (); - } std::size_t fw = (nsa > 0 ? sa_1 : (elt->fw == -1 ? len : elt->fw)); @@ -5809,8 +5848,8 @@ tval = (lo_ieee_is_NA (dval) ? "NA" : "NaN"); } - retval += do_printf_conv (os, encoding (), tfmt.c_str (), nsa, sa_1, - sa_2, tval, who); + retval += do_printf_conv (os, tfmt.c_str (), nsa, sa_1, sa_2, tval, + who); } else { @@ -5829,8 +5868,8 @@ // Insert "long" modifier. tfmt.replace (tfmt.rfind (type), 1, llmod + type); - retval += do_printf_conv (os, encoding (), tfmt.c_str (), nsa, - sa_1, sa_2, tval.value (), who); + retval += do_printf_conv (os, tfmt.c_str (), nsa, sa_1, sa_2, + tval.value (), who); } else { @@ -5838,8 +5877,8 @@ double dval = val.double_value (true); - retval += do_printf_conv (os, encoding (), tfmt.c_str (), nsa, - sa_1, sa_2, dval, who); + retval += do_printf_conv (os, tfmt.c_str (), nsa, sa_1, sa_2, + dval, who); } break; @@ -5851,8 +5890,8 @@ // Insert "long" modifier. tfmt.replace (tfmt.rfind (type), 1, llmod + type); - retval += do_printf_conv (os, encoding (), tfmt.c_str (), nsa, - sa_1, sa_2, tval.value (), who); + retval += do_printf_conv (os, tfmt.c_str (), nsa, sa_1, sa_2, + tval.value (), who); } else { @@ -5860,8 +5899,8 @@ double dval = val.double_value (true); - retval += do_printf_conv (os, encoding (), tfmt.c_str (), nsa, - sa_1, sa_2, dval, who); + retval += do_printf_conv (os, tfmt.c_str (), nsa, sa_1, sa_2, + dval, who); } break; @@ -5870,8 +5909,8 @@ { double dval = val.double_value (true); - retval += do_printf_conv (os, encoding (), tfmt.c_str (), nsa, - sa_1, sa_2, dval, who); + retval += do_printf_conv (os, tfmt.c_str (), nsa, sa_1, sa_2, + dval, who); } break; @@ -5903,7 +5942,7 @@ octave_idx_type m_nconv = fmt_list.num_conversions (); - std::ostream *osp = output_stream (); + std::ostream *osp = preferred_output_stream (); if (! osp) invalid_operation (who, "writing"); @@ -5956,18 +5995,12 @@ if (elt->type == '%') { - if (encoding ().compare ("utf-8")) - os << string::u8_to_encoding (who, "%", encoding ()); - else - os << '%'; + os << '%'; retval++; } else if (elt->args == 0 && ! elt->text.empty ()) { - if (encoding ().compare ("utf-8")) - os << string::u8_to_encoding (who, elt->text, encoding ()); - else - os << elt->text; + os << elt->text; retval += (elt->text.length ()); } else if (elt->type == 's' || elt->type == 'c') @@ -5981,8 +6014,7 @@ std::string sval = val.string_value (); retval += do_printf_string (os, elt, nsa, sa_1, - sa_2, sval, encoding (), - who); + sa_2, sval, who); } else retval += do_numeric_printf_conv (os, elt, nsa, sa_1, @@ -6039,7 +6071,7 @@ { int retval = -1; - std::ostream *osp = output_stream (); + std::ostream *osp = preferred_output_stream (); if (! osp) invalid_operation (who, "writing"); @@ -6365,7 +6397,10 @@ stream::close (void) { if (stream_ok ()) + { + m_rep->flush (); m_rep->close (); + } } template @@ -6595,9 +6630,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 @@ -6660,7 +6692,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 (); @@ -6701,7 +6733,6 @@ std::size_t gcount = is.gcount (); - char_count += gcount; cur_pos += gcount; octave_idx_type nel = gcount / input_elt_size; diff -r 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/oct-stream.h --- a/libinterp/corefcn/oct-stream.h Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/oct-stream.h Mon Aug 29 13:58:00 2022 +0200 @@ -35,6 +35,8 @@ #include #include +#include "oct-string.h" + // These only appear as reference arguments or return values. class Cell; @@ -73,7 +75,8 @@ mach_info::float_format ff = mach_info::native_float_format (), const std::string& encoding = "utf-8") : m_mode (arg_md), m_flt_fmt (ff), m_encoding (encoding), - m_fail (false), m_open_state (true), m_errmsg () + m_conv_ostream (nullptr), m_fail (false), m_open_state (true), + m_errmsg () { } // No copying! @@ -115,6 +118,31 @@ virtual std::ostream * output_stream (void) { return nullptr; } + // Return either the original output stream or one wrapped with the + // encoding facet. + + std::ostream * preferred_output_stream (void) + { + if (! m_encoding.compare ("utf-8")) + return output_stream (); + + if (m_conv_ostream) + return m_conv_ostream; + + // wrap the output stream with encoding conversion facet + std::ostream *os = output_stream (); + if (os && *os) + { + convfacet_u8 *facet = new convfacet_u8 (m_encoding); + std::wbuffer_convert *converter + = new std::wbuffer_convert (os->rdbuf (), + facet); + m_conv_ostream = new std::ostream (converter); + } + + return (m_conv_ostream ? m_conv_ostream : output_stream ()); + } + // Return TRUE if this stream is open. bool is_open (void) const { return m_open_state; } @@ -183,6 +211,16 @@ // Code page std::string m_encoding; + // encoding conversion facet + typedef string::deletable_facet convfacet_u8; + + std::wbuffer_convert *m_converter; + + // wrappers for encoding conversion + // std::istream *m_conv_istream; + + std::ostream *m_conv_ostream; + // TRUE if an error has occurred. bool m_fail; @@ -415,7 +453,7 @@ std::ostream * output_stream (void) { - return m_rep ? m_rep->output_stream () : nullptr; + return (m_rep ? m_rep->preferred_output_stream () : nullptr); } void clearerr (void) { if (m_rep) m_rep->clearerr (); } @@ -476,7 +514,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 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/pager.cc --- a/libinterp/corefcn/pager.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/pager.cc Mon Aug 29 13:58:00 2022 +0200 @@ -127,7 +127,7 @@ int pager_buf::sync (void) { - output_system& output_sys = __get_output_system__ ("pager_buf::sync"); + output_system& output_sys = __get_output_system__ (); char *buf = pbase (); @@ -164,7 +164,7 @@ int diary_buf::sync (void) { - output_system& output_sys = __get_output_system__ ("__stdout__"); + output_system& output_sys = __get_output_system__ (); std::ofstream& external_diary_file = output_sys.external_diary_file (); @@ -259,7 +259,7 @@ void flush_stdout (void) { - output_system& output_sys = __get_output_system__ ("flush_stdout"); + output_system& output_sys = __get_output_system__ (); output_sys.flush_stdout (); } @@ -491,14 +491,14 @@ std::ostream& __stdout__ (void) { - output_system& output_sys = __get_output_system__ ("__stdout__"); + output_system& output_sys = __get_output_system__ (); return output_sys.__stdout__ (); } std::ostream& __diary__ (void) { - output_system& output_sys = __get_output_system__ ("__diary__"); + output_system& output_sys = __get_output_system__ (); return output_sys.__diary__ (); } @@ -623,13 +623,14 @@ DEFUN (terminal_size, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} terminal_size () -Query or set the size of the terminal window. If called with no -arguments, return a two-element row vector containing the current size -of the terminal window in characters (rows and columns). If called with -a two-element vector of integer values, set the terminal size and return -the previous setting. Setting the size manually should not be needed -when using readline for command-line editing. +@deftypefn {} {[@var{rows}, @var{cols}] =} terminal_size () +@deftypefnx {} {} terminal_size ([@var{rows}, @var{cols}]) +Query or set the size of the terminal window. If called with no arguments, +return a two-element row vector containing the current size of the terminal +window in characters (rows and columns). If called with a two-element vector +of integer values, set the terminal size and return the previous setting. +Setting the size manually should not be needed when using readline for +command-line editing. @seealso{list_in_columns} @end deftypefn */) { @@ -666,7 +667,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 +691,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 +715,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 +738,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 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/pinv.cc --- a/libinterp/corefcn/pinv.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/pinv.cc Mon Aug 29 13:58:00 2022 +0200 @@ -42,9 +42,9 @@ DEFUN (pinv, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} pinv (@var{x}) -@deftypefnx {} {} pinv (@var{x}, @var{tol}) -Return the @nospell{Moore-Penrose} pseudoinverse of @var{x}. +@deftypefn {} {@var{B} =} pinv (@var{A}) +@deftypefnx {} {@var{B} =} pinv (@var{A}, @var{tol}) +Return the @nospell{Moore-Penrose} pseudoinverse of @var{A}. Singular values less than @var{tol} are ignored. @@ -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 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/pow2.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libinterp/corefcn/pow2.cc Mon Aug 29 13:58:00 2022 +0200 @@ -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 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/pr-flt-fmt.cc --- a/libinterp/corefcn/pr-flt-fmt.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/pr-flt-fmt.cc Mon Aug 29 13:58:00 2022 +0200 @@ -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 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/pr-output.cc --- a/libinterp/corefcn/pr-output.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/pr-output.cc Mon Aug 29 13:58:00 2022 +0200 @@ -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) \ @@ -3398,12 +3399,11 @@ std::ostream *osp = os.output_stream (); + if (! osp) + error ("fdisp: stream FID not open for writing"); + octave_value arg = args(1); - - if (osp) - arg.print (*osp); - else - error ("fdisp: stream FID not open for writing"); + arg.print (*osp); return ovl (); } @@ -3614,7 +3614,15 @@ std::string arg = argv[idx++]; std::transform (arg.begin (), arg.end (), arg.begin (), tolower); - if (arg == "short") + if (arg == "default") + { + format = "short"; + init_format_state (); + set_output_prec (5); + Vcompact_format = false; + uppercase_format = false; + } + else if (arg == "short") { format = arg; init_format_state (); @@ -3806,6 +3814,7 @@ doc: /* -*- texinfo -*- @deftypefn {} {} format @deftypefnx {} {} format options +@deftypefnx {} {} format (@var{options}) @deftypefnx {} {[@var{format}, @var{formatspacing}, @var{uppercase}] =} format Reset or specify the format of the output produced by @code{disp} and Octave's normal echoing mechanism. @@ -3817,13 +3826,16 @@ By default, Octave displays 5 significant digits in a human readable form (option @samp{short}, option @samp{lowercase}, and option @samp{loose} format -for matrices). If @code{format} is invoked without any options, this default -format is restored. +for matrices). If @code{format} is invoked without any options, or the option +@samp{default} is specified, then this default format is restored. Valid format options for floating point numbers are listed in the following table. @table @code +@item default +Restore the default format state described above. + @item short Fixed point format with 5 significant figures (default). @@ -3972,10 +3984,12 @@ @end table If @code{format} is called with multiple competing options, the rightmost one -is used. In case of an error the format remains unchanged. +is used, except for @samp{default} which will override all other options. In +case of an error the format remains unchanged. If called with one to three output arguments, and no inputs, return the current -format, format spacing, and uppercase preference. +format, format spacing, and uppercase preference. Specifying both outputs and +inputs will produce an error. @seealso{fixed_point_format, output_precision, split_long_rows, print_empty_dimensions, rats} @@ -4023,7 +4037,7 @@ %! assert (str, "3.1415927E+00\n"); %! new_fmt = format (); %! assert (new_fmt, "longe"); -%! ## Test resetting format +%! ## Test resetting format (method #1) %! format compact; %! [~, new_spacing] = format (); %! assert (new_spacing, "compact"); @@ -4032,6 +4046,17 @@ %! assert (new_fmt, "short"); %! assert (new_spacing, "loose"); %! assert (new_case, "lowercase"); +%! ## Test resetting format (method #2) +%! format compact uppercase long e; +%! [new_fmt, new_spacing, new_case] = format (); +%! assert (new_fmt, "longe"); +%! assert (new_spacing, "compact"); +%! assert (new_case, "uppercase"); +%! format ("default"); +%! [new_fmt, new_spacing, new_case] = format (); +%! assert (new_fmt, "short"); +%! assert (new_spacing, "loose"); +%! assert (new_case, "lowercase"); %! unwind_protect_cleanup %! format (old_fmt); %! format (old_spacing); @@ -4062,7 +4087,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. @@ -4105,7 +4130,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{[]}. @@ -4136,7 +4161,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 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/psi.cc --- a/libinterp/corefcn/psi.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/psi.cc Mon Aug 29 13:58:00 2022 +0200 @@ -39,8 +39,8 @@ DEFUN (psi, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} psi (@var{z}) -@deftypefnx {} {} psi (@var{k}, @var{z}) +@deftypefn {} {@var{y} =} psi (@var{z}) +@deftypefnx {} {@var{y} =} psi (@var{k}, @var{z}) Compute the psi (polygamma) function. The polygamma functions are the @var{k}th derivative of the logarithm @@ -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 9ad55d2e1bbf -r 8340137bb190 libinterp/corefcn/qr.cc --- a/libinterp/corefcn/qr.cc Sun Aug 28 22:44:49 2022 +0200 +++ b/libinterp/corefcn/qr.cc Mon Aug 29 13:58:00 2022 +0200 @@ -116,6 +116,7 @@ @deftypefnx {} {@var{X} =} qr (@var{A}, @var{B}) # sparse A @deftypefnx {} {[@var{C}, @var{R}] =} qr (@var{A}, @var{B}) @deftypefnx {} {[@dots{}] =} qr (@dots{}, 0) +@deftypefnx {} {[@dots{}] =} qr (@dots{}, "econ") @deftypefnx {} {[@dots{}] =} qr (@dots{}, "vector") @deftypefnx {} {[@dots{}] =} qr (@dots{}, "matrix") @cindex QR factorization @@ -270,14 +271,14 @@ The default, however, is to return a permutation matrix and this may be explicitly specified by using a final argument of @qcode{"matrix"}. -If the final argument is the scalar 0 an @qcode{"economy"} factorization is -returned. If the original matrix @var{A} has size MxN and M > N, then the -@qcode{"economy"} factorization will calculate just N rows in @var{R} and N -columns in @var{Q} and omit the zeros in @var{R}. If M @leq{} N, there is no -difference between the economy and standard factorizations. When calculating -an @qcode{"economy"} factorization and @var{A} is dense, the output @var{P} is -always a vector rather than a matrix. If @var{A} is sparse, output -@var{P} is a sparse permutation matrix. +If the final argument is the scalar 0 or the string @qcode{"econ"}, an +economy factorization is returned. If the original matrix @var{A} has size +MxN and M > N, then the economy factorization will calculate just N rows in +@var{R} and N columns in @var{Q} and omit the zeros in @var{R}. If M @leq{} +N, there is no difference between the economy and standard factorizations. +When calculating an economy factorization and @var{A} is dense, the output +@var{P} is always a vector rather than a matrix. If @var{A} is sparse, +output @var{P} is a sparse permutation matrix. Background: The QR factorization has applications in the solution of least squares problems @@ -344,9 +345,14 @@ std::string str = args(nargin-1).string_value (); if (str == "vector") vector_p = true; + else if (str == "econ") + { + economy = true; + have_b = (nargin > 2); + } else if (str != "matrix") - error ("qr: type for P must be 'matrix' or 'vector', not %s", - str.c_str ()); + error ("qr: option string must be 'econ' or 'matrix' or " \ + "'vector', not \"%s\"", str.c_str ()); have_b = (nargin > 2); } else if (! args(nargin-1).is_matrix_type ()) @@ -704,45 +710,55 @@ %! %! [q, r] = qr (a); %! [qe, re] = qr (a, 0); +%! [qe2, re2] = qr (a, "econ"); %! %! assert (q * r, a, sqrt (eps)); %! assert (qe * re, a, sqrt (eps)); +%! assert (qe2 * re2, a, sqrt (eps)); %!test %! a = [0, 2, 1; 2, 1, 2]; %! %! [q, r] = qr (a); %! [qe, re] = qr (a, 0); +%! [qe2, re2] = qr (a, "econ"); %! %! assert (q * r, a, sqrt (eps)); %! assert (qe * re, a, sqrt (eps)); +%! assert (qe2 * re2, a, sqrt (eps)); %!test %! a = [0, 2, 1; 2, 1, 2]; %! %! [q, r, p] = qr (a); # FIXME: not giving right dimensions. %! [qe, re, pe] = qr (a, 0); +%! [qe2, re2, pe2] = qr (a, "econ"); %! %! assert (q * r, a * p, sqrt (eps)); %! assert (qe * re, a(:, pe), sqrt (eps)); +%! assert (qe2 * re2, a(:, pe2), sqrt (eps)); %!test %! a = [0, 2; 2, 1; 1, 2]; %! %! [q, r] = qr (a); %! [qe, re] = qr (a, 0); +%! [qe2, re2] = qr (a, "econ"); %! %! assert (q * r, a, sqrt (eps)); %! assert (qe * re, a, sqrt (eps)); +%! assert (qe2 * re2, a, sqrt (eps)); %!test %! a = [0, 2; 2, 1; 1, 2]; %! %! [q, r, p] = qr (a); %! [qe, re, pe] = qr (a, 0); +%! [qe2, re2, pe2] = qr (a, "econ"); %! %! assert (q * r, a * p, sqrt (eps)); %! assert (qe * re, a(:, pe), sqrt (eps)); +%! assert (qe2 * re2, a(:, pe2), sqrt (eps)); %!test %! a = [0, 2, 1; 2, 1, 2; 3, 1, 2]; @@ -791,6 +807,8 @@ %!error qr () %!error qr ([1, 2; 3, 4], 0, 2) +%!error