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

 
 

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

Submitted by:  A.R. Burgers <arb>
Submitted on:  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

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project 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.6