[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #32966] spdiags is slow and buggy, diag is not
From: |
Marco Caliari |
Subject: |
[Octave-bug-tracker] [bug #32966] spdiags is slow and buggy, diag is not compatible |
Date: |
Fri, 08 Apr 2011 13:54:27 +0000 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13 |
Follow-up Comment #1, bug #32966 (project octave):
I'm submitting two patches: diag.patch fixes the compatibility issue 3).
spdiags.m.patch rewrites the function calls spdiags (A) and spdiags(A, C) and
uses diag to extract diagonals. This fixes issues 1) and 2). Infact, using the
testfile testspdiags.m (which creates sparse matrices of random sizes and
extract random diagonals), I see
+verbatim-
> testspdiags(10) % random sparse matrices up to size 10
warning: spdiagsorig failed
...
warning: spdiagsorig failed
cpuorigtot = 10.013
cputot = 0.85205
> testspdiags(100) % random sparse matrices up to size 100
warning: spdiagsorig failed
...
warning: spdiagsorig failed
cpuorigtot = 11.421
cputot = 5.7804
> testspdiags(1000) % random sparse matrices up to size 1000
cpuorigtot = 326.95
cputot = 32.586
Because of issue 2) in the original spdiags, sometimes you get the warning.
Two compatibility issues remain: number 4) (which I think is a bug in ml).
Then, if A is a vector, ml gives an error, whereas the original spdiags in
Octave (and mine) works. When you call spdiags with 1 or 2 input args you want
to extract diagonals (no ambiguity as in diag): so a vector is just a
rectangular matrix.
Marco
(file #23138, file #23139, file #23140)
_______________________________________________________
Additional Item Attachment:
File name: diag.patch Size:1 KB
File name: spdiags.m.patch Size:1 KB
File name: testspdiags.m Size:0 KB
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?32966>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Octave-bug-tracker] [bug #32966] spdiags is slow and buggy, diag is not compatible,
Marco Caliari <=