bugGNU Octave - Bugs: bug #60426, patch: huge speed-up of pchip for...

 
 

bug #60426: patch: huge speed-up of pchip for mixed precision arguments

Submitter:  A.R. Burgers <arb>
Submitted:  Tue 20 Apr 2021 08:32:48 PM UTC
   
 
Category:  Performance Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Performance
Status:  None Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 20 Apr 2021 08:32:48 PM UTC, original submission:  

as explained in bug #60361 pchip is very slow for mixed precision x and y arguments. The attached changeset fixes this, by replacing the division by a diagonal matrix with broadcast and scalar division.


   ## This is taken from SLATEC.
-  h = diag (h);
+  hr = 1.0 ./ h;

-  delta = diff (y, 1, 2) / h;
-  del1 = (d1 - delta) / h;
-  del2 = (d2 - delta) / h;
+  delta = diff (y, 1, 2) .* hr;
+  del1 = (d1 - delta) .* hr;
+  del2 = (d2 - delta) .* hr;
   c3 = del1 + del2;
   c2 = -c3 - del1;
-  c3 /= h;
+  c3 .*= hr;
   coeffs = cat (3, c3, c2, d1, f1);


A.R. Burgers <arb>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #51300:  p29634_pchip.txt added by arb (996B - text/plain)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by arb (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.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-04-20 arb Attached File- Added p29634_pchip.txt, #51300

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code