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

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

[Octave-bug-tracker] [bug #59840] repmat and repelem slower than needed,


From: anonymous
Subject: [Octave-bug-tracker] [bug #59840] repmat and repelem slower than needed, faster implimentation suggested
Date: Mon, 18 Jan 2021 09:11:53 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0

Follow-up Comment #7, bug #59840 (project octave):

To look for a better function to switch implementations I decided to plot the
four dimensional domain to get an idea where one function was better than the
other. I only found one case where the current implementation of repmat was
clearly better than the kron implementation.

let m and n be the matrix size, p the number of times vertically repeated and
q be the number of times horizontally repeated.

The current implementation is better when p=1, q>12 m>20, n>20 (very rough)
also as q increases m and n decrease from the above numbers, otherwise kron is
generally faster by a tiny amount. I plotted 10 points between 1 and 100 in
each variable (10000 points total) and ran each repmap case 10 times. Total
run time to create the data was around two hours and overall the kron way was
around 24 seconds faster.

I have not run repelem yet.

I have attached my data (repmattimekronindx), the method to visualize and
create the data (repmatrepelemfaster.m). To create new data change the first
line to true.

(file #50743, file #50744)
    _______________________________________________________

Additional Item Attachment:

File name: repmattimekronindx             Size:1761 KB
    <https://file.savannah.gnu.org/file/repmattimekronindx?file_id=50743>

File name: repmatrepelemfaster.m          Size:21 KB
    <https://file.savannah.gnu.org/file/repmatrepelemfaster.m?file_id=50744>



    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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