bugGNU Octave - Bugs: bug #61903, interp1 gives wrong results for...

 
 

bug #61903: interp1 gives wrong results for complex matrices

Submitter:  Christof Kaufmann <christofkaufmann>
Submitted:  Sun 23 Jan 2022 11:52:29 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 7.0.90 Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 31 Jan 2022 03:08:48 AM UTC, comment #5: 

Verified changeset.  Marking as Fixed and closing report.

Rik <rik5>
Group administrator
Fri 28 Jan 2022 07:27:23 AM UTC, comment #4: 


> I noticed the commit message is not correct. It says "interp2: ..."


Oops. I copied the commit message from that bug and forgot to change that. Unfortunately, there is no way of changing the history of the Mercurial repository (without potentially causing lots of headaches) once it is pushed to the public server.

Markus Mützel <mmuetzel>
Group administrator
Thu 27 Jan 2022 07:28:59 PM UTC, comment #3: 

Thanks.

Yes, sorry for the inconvenience! The last three patch versions in bug #61863 are exported mercurial commits.

I noticed the commit message is not correct. It says "interp2: ..."

Christof Kaufmann <christofkaufmann>
Thu 27 Jan 2022 06:04:41 PM UTC, comment #2: 

I pushed your changes to stable here:
https://hg.savannah.gnu.org/hgweb/octave/rev/79d6280fb00a

Marking as ready for test.

PS: It would be really helpful if you could provide complete Mercurial patches (including commit message) instead of patches for singular files.

Markus Mützel <mmuetzel>
Group administrator
Tue 25 Jan 2022 04:40:40 PM UTC, comment #1: 

I submitted a new patch in bug #61863, which modifies `__pchip_deriv__()`. That patch also fixes this bug report.

Christof Kaufmann <christofkaufmann>
Sun 23 Jan 2022 11:52:29 PM UTC, original submission:  

Interpolating complex matrices gives a default extrapolation value of NA + 0i instead of NA + NAi. Example:

> interp1((1:2) + 1i, 0:1)
ans =

    NA +   0i     1 +   1i

Additionally "pchip" gives wrong results for the imaginary part:

> interp1((1:2) * 1i, 1.25, "pchip")
ans =  0.00000 + 1.15625i

while it should give:

> interp1((1:2), 1.25, "pchip") * 1i
ans =  0.00000 + 1.25000i

The appended patches fixes interp1 and pchip for complex matrices.

Christof Kaufmann <christofkaufmann>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #52711:  interp1_fix_complex.diff added by christofkaufmann (7KiB - text/x-patch - Fix interp1 for complex matrices - v1)
file #52712:  pchip_fix_complex.diff added by christofkaufmann (419B - text/x-patch - Fix interp1 for complex matrices - v1)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by christofkaufmann (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-01-31 rik5 StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2022-01-27 mmuetzel StatusNone Ready For Test
        Releasedev 7.0.90
    2022-01-23 christofkaufmann Attached File- Added interp1_fix_complex.diff, #52711
        Attached File- Added pchip_fix_complex.diff, #52712

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code