[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-patch-tracker] [patch #10119] functions sumsqr, sumabs, meansqr,
From: |
Nicholas Jankowski |
Subject: |
[Octave-patch-tracker] [patch #10119] functions sumsqr, sumabs, meansqr, meanabs |
Date: |
Fri, 8 Oct 2021 11:51:04 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36 |
URL:
<https://savannah.gnu.org/patch/?10119>
Summary: functions sumsqr, sumabs, meansqr, meanabs
Project: GNU Octave
Submitted by: nrjank
Submitted on: Fri 08 Oct 2021 11:51:03 AM EDT
Category: Core : new function
Priority: 5 - Normal
Status: In Progress
Privacy: Public
Assigned to: None
Originator Email:
Open/Closed: Open
Discussion Lock: Any
_______________________________________________________
Details:
attached are matlab compatible implementations of the functions sumsqr,
sumabs, meansqr, and meanabs. they are all fairly similar in behavior and
were introduced in matlab <2010. After some input handling, they all just
call elementwise sqr or abs followed by sum or mean over all elements to
return a scalar, skipping over anything failing an isfinite() test.
I noticed there are sumsq and meansq functions that were probably introduced a
long time ago that are not compatible with the matlab sumsqr and meansqr
functions. their behavior is different enough it's probably worth keeping the
separate functions rather than just modifying the octave functions, since the
names don't match anyway. (similar to what was done with repelem and
repelems).
Of note these functions can handle numeric, char, and logical inputs, as well
as arbitrarily shaped cell arrays of the same.
I did verify that these functions work with complex inputs, whereas the matlab
functions error for any complex valued inputs, and Octave's meansq & sumsq
functions produce odd results with complex values. (meansq appears to ignore
complex numbers, sumsq appears to apply sum((abs(Z))^2) )
will generate and a patch once i have a number.
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Fri 08 Oct 2021 11:51:03 AM EDT Name: sumsqr.m Size: 4KiB By: nrjank
Matlab compatible functions
<http://savannah.gnu.org/patch/download.php?file_id=52072>
-------------------------------------------------------
Date: Fri 08 Oct 2021 11:51:03 AM EDT Name: meanabs.m Size: 5KiB By:
nrjank
Matlab compatible functions
<http://savannah.gnu.org/patch/download.php?file_id=52073>
-------------------------------------------------------
Date: Fri 08 Oct 2021 11:51:03 AM EDT Name: sumabs.m Size: 4KiB By: nrjank
Matlab compatible functions
<http://savannah.gnu.org/patch/download.php?file_id=52074>
-------------------------------------------------------
Date: Fri 08 Oct 2021 11:51:03 AM EDT Name: meansqr.m Size: 5KiB By:
nrjank
Matlab compatible functions
<http://savannah.gnu.org/patch/download.php?file_id=52075>
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/patch/?10119>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-patch-tracker] [patch #10119] functions sumsqr, sumabs, meansqr, meanabs,
Nicholas Jankowski <=