Mercurial > octave
changeset 32915:c96d0470a582 bytecode-interpreter
maint: Merge default to bytecode-interpreter.
author | Nicholas R. Jankowski <jankowski.nicholas@gmail.com> |
---|---|
date | Fri, 02 Feb 2024 20:55:11 -0500 |
parents | 3904d7116c8c (current diff) 399bdb5b3b48 (diff) |
children | 8e039e525882 |
files | libinterp/octave-value/ov.cc |
diffstat | 9 files changed, 51 insertions(+), 25 deletions(-) [+] |
line wrap: on
line diff
--- a/examples/code/embedded.cc Thu Feb 01 23:34:35 2024 -0500 +++ b/examples/code/embedded.cc Fri Feb 02 20:55:11 2024 -0500 @@ -30,7 +30,7 @@ // { // std::cerr << "Octave interpreter initialization failed!" // << std::endl; - // exit (status); + // exit (1); // } // // You may skip this step if you don't need to do anything
--- a/libinterp/octave-value/ov.cc Thu Feb 01 23:34:35 2024 -0500 +++ b/libinterp/octave-value/ov.cc Fri Feb 02 20:55:11 2024 -0500 @@ -3721,6 +3721,9 @@ If @var{idx} is an empty structure array with fields @samp{type} and @samp{subs}, return @var{val}. + +The keyword @code{end} cannot be used within @code{subsref} for indexing +assignments. @seealso{subsasgn, substruct} @end deftypefn */) { @@ -3770,6 +3773,9 @@ If @var{idx} is an empty structure array with fields @samp{type} and @samp{subs}, return @var{rhs}. + +The keyword @code{end} cannot be used within @code{subsasgn} for indexing +assignments. @seealso{subsref, substruct, optimize_subsasgn_calls} @end deftypefn */) {
--- a/libinterp/parse-tree/oct-parse.yy Thu Feb 01 23:34:35 2024 -0500 +++ b/libinterp/parse-tree/oct-parse.yy Fri Feb 02 20:55:11 2024 -0500 @@ -6315,7 +6315,7 @@ DEFMETHOD (feval, interp, args, nargout, doc: /* -*- texinfo -*- -@deftypefn {} {} feval (@var{name}, @dots{}) +@deftypefn {} {@var{retval} =} feval (@var{name}, @dots{}) Evaluate the function named @var{name}. Any arguments after the first are passed as inputs to the named function.
--- a/liboctave/array/Array-base.cc Thu Feb 01 23:34:35 2024 -0500 +++ b/liboctave/array/Array-base.cc Fri Feb 02 20:55:11 2024 -0500 @@ -210,6 +210,13 @@ } template <typename T, typename Alloc> +octave_idx_type +Array<T, Alloc>::compute_index_unchecked (const Array<octave_idx_type>& ra_idx) const +{ + return m_dimensions.compute_index (ra_idx.data (), ra_idx.numel ()); +} + +template <typename T, typename Alloc> T& Array<T, Alloc>::checkelem (octave_idx_type n) { @@ -1124,6 +1131,13 @@ } template <typename T, typename Alloc> +Array<T, Alloc> +Array<T, Alloc>::index (const Array<octave::idx_vector>& ia, bool resize_ok) const +{ + return index (ia, resize_ok, resize_fill_value ()); +} + +template <typename T, typename Alloc> void Array<T, Alloc>::assign (const octave::idx_vector& i, const Array<T, Alloc>& rhs, const T& rfv) { @@ -1394,6 +1408,14 @@ } } +template <typename T, typename Alloc> +void +Array<T, Alloc>::assign (const Array<octave::idx_vector>& ia, + const Array<T, Alloc>& rhs) +{ + assign (ia, rhs, resize_fill_value ()); +} + /* %!shared a %! a = [1 2; 3 4];
--- a/liboctave/array/Array.h Thu Feb 01 23:34:35 2024 -0500 +++ b/liboctave/array/Array.h Fri Feb 02 20:55:11 2024 -0500 @@ -123,6 +123,9 @@ //! - string_vector: Array<std::string> with 1 column //! - Cell: Array<octave_value>, equivalent to an Octave cell. +// forward declare template with visibility attributes +template <typename T, typename Alloc> class OCTARRAY_API Array; + template <typename T, typename Alloc> class OCTARRAY_TEMPLATE_API Array { @@ -511,11 +514,8 @@ OCTARRAY_API octave_idx_type compute_index (const Array<octave_idx_type>& ra_idx) const; - OCTARRAY_OVERRIDABLE_FUNC_API octave_idx_type - compute_index_unchecked (const Array<octave_idx_type>& ra_idx) const - { - return m_dimensions.compute_index (ra_idx.data (), ra_idx.numel ()); - } + OCTARRAY_API octave_idx_type + compute_index_unchecked (const Array<octave_idx_type>& ra_idx) const; // No checking, even for multiple references, ever. @@ -731,11 +731,8 @@ OCTARRAY_API Array<T, Alloc> index (const Array<octave::idx_vector>& ia, bool resize_ok, const T& rfv) const; - OCTARRAY_OVERRIDABLE_FUNC_API Array<T, Alloc> - index (const Array<octave::idx_vector>& ia, bool resize_ok) const - { - return index (ia, resize_ok, resize_fill_value ()); - } + OCTARRAY_API Array<T, Alloc> + index (const Array<octave::idx_vector>& ia, bool resize_ok) const; //@} //@{ @@ -760,11 +757,8 @@ OCTARRAY_API void assign (const Array<octave::idx_vector>& ia, const Array<T, Alloc>& rhs, const T& rfv); - OCTARRAY_OVERRIDABLE_FUNC_API void - assign (const Array<octave::idx_vector>& ia, const Array<T, Alloc>& rhs) - { - assign (ia, rhs, resize_fill_value ()); - } + OCTARRAY_API void + assign (const Array<octave::idx_vector>& ia, const Array<T, Alloc>& rhs); //@} //@{
--- a/scripts/help/which.m Thu Feb 01 23:34:35 2024 -0500 +++ b/scripts/help/which.m Fri Feb 02 20:55:11 2024 -0500 @@ -24,7 +24,8 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {} which name @dots{} +## @deftypefn {} {} which @var{name} @dots{} +## @deftypefnx {} {[@var{str}, @dots{}] =} which ('@var{name}', @dots{}) ## Display the type of each @var{name}. ## ## If @var{name} is defined from a function file, the full name of the file is
--- a/scripts/miscellaneous/substruct.m Thu Feb 01 23:34:35 2024 -0500 +++ b/scripts/miscellaneous/substruct.m Fri Feb 02 20:55:11 2024 -0500 @@ -47,6 +47,9 @@ ## @result{} 7 8 9 ## @end group ## @end example +## +## Note: The keyword @code{end} cannot be used within @code{subsref} or +## @code{subsasgn} for indexing assignments. ## @seealso{subsref, subsasgn} ## @end deftypefn
--- a/scripts/signal/ifftshift.m Thu Feb 01 23:34:35 2024 -0500 +++ b/scripts/signal/ifftshift.m Fri Feb 02 20:55:11 2024 -0500 @@ -24,8 +24,8 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {@var{y} =} ifftshift (@var{x}) -## @deftypefnx {} {@var{y} =} ifftshift (@var{x}, @var{dim}) +## @deftypefn {} {@var{x} =} ifftshift (@var{y}) +## @deftypefnx {} {@var{x} =} ifftshift (@var{y}, @var{dim}) ## Undo the action of the @code{fftshift} function. ## ## For even length @var{x}, @code{fftshift} is its own inverse, but odd lengths
--- a/scripts/signal/private/triangle_sw.m Thu Feb 01 23:34:35 2024 -0500 +++ b/scripts/signal/private/triangle_sw.m Fri Feb 02 20:55:11 2024 -0500 @@ -24,21 +24,21 @@ ######################################################################## ## -*- texinfo -*- -## @deftypefn {} {@var{retval} =} triangle_sw (@var{n}, @var{b}) +## @deftypefn {} {@var{c} =} triangle_sw (@var{n}, @var{b}) ## Triangular spectral window. ## ## Subfunction used for spectral density estimation. ## @seealso{spectral_xdf} ## @end deftypefn -function retval = triangle_sw (n, b) +function c = triangle_sw (n, b) - retval = zeros (n,1); - retval(1) = 1 / b; + c = zeros (n,1); + c(1) = 1 / b; l = (2:n)' - 1; l = 2 * pi * l / n; - retval(2:n) = b * (sin (l / (2*b)) ./ sin (l / 2)).^2; + c(2:n) = b * (sin (l / (2*b)) ./ sin (l / 2)).^2; endfunction