octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #61903] interp1 gives wrong results for comple


From: Christof Kaufmann
Subject: [Octave-bug-tracker] [bug #61903] interp1 gives wrong results for complex matrices
Date: Sun, 23 Jan 2022 18:52:31 -0500 (EST)

URL:
  <https://savannah.gnu.org/bugs/?61903>

                 Summary: interp1 gives wrong results for complex matrices
                 Project: GNU Octave
            Submitted by: christofkaufmann
            Submitted on: Sun 23 Jan 2022 11:52:29 PM UTC
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
                 Release: dev
         Discussion Lock: Any
        Operating System: Any

    _______________________________________________________

Details:

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.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Sun 23 Jan 2022 11:52:29 PM UTC  Name: interp1_fix_complex.diff  Size:
7KiB   By: christofkaufmann
Fix interp1 for complex matrices - v1
<http://savannah.gnu.org/bugs/download.php?file_id=52711>
-------------------------------------------------------
Date: Sun 23 Jan 2022 11:52:29 PM UTC  Name: pchip_fix_complex.diff  Size:
419B   By: christofkaufmann
Fix interp1 for complex matrices - v1
<http://savannah.gnu.org/bugs/download.php?file_id=52712>

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?61903>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]