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

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

[Octave-bug-tracker] [bug #53198] nnz could be improved for diagonal mat


From: Sahil Yadav
Subject: [Octave-bug-tracker] [bug #53198] nnz could be improved for diagonal matrices
Date: Wed, 21 Feb 2018 13:03:05 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.167 Safari/537.36

Follow-up Comment #1, bug #53198 (project octave):

Indeed the time difference is huge.

I tried the following test script:

N = 1e2;

f = zeros(N,1);
for i=1:N
  r = rand(5000,1);
  s = diag(r);
  tic;
  z = nnz(s);
  f(i)=toc;
endfor

sum(f)


Got a total time of 0.0039184 seconds with the patch applied and 11.160
seconds without the patch.

Hope this helps :)


(file #43379, file #43380)
    _______________________________________________________

Additional Item Attachment:

File name: 53198.diff                     Size:0 KB
File name: test.m                         Size:0 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?53198>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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