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

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

[Octave-bug-tracker] [bug #41453] norm is really slow for sparse matrice


From: Carlo de Falco
Subject: [Octave-bug-tracker] [bug #41453] norm is really slow for sparse matrices
Date: Tue, 04 Feb 2014 11:36:06 +0000
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:26.0) Gecko/20100101 Firefox/26.0

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

I don't know how "norm (A, 2)" is currently computed for 
a sparse matrix, but probably we should use "svds (A, 1, 'L')"
instead, at least with your test this works better:



for s = [50 100 150] 
  for i = 1:5
    A = sprand (s, s, 0.1);

    tic(); 
    n1 = svds (A, 1);
    t1 = toc();
    
    tic(); 
    n2 = norm (full (A)); 
    t2 = toc();

    printf (["Norm diff: %g, sparse time: %g,", ...
             "full matrix time: %g. Speed x: %g\n"],
            abs (n1-n2) / n1, t1, t2, t1/t2);
  end
end

 

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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