Fri 08 Apr 2011 01:54:26 PM UTC, comment #1:
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
-verbatim-
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)
|
Thu 31 Mar 2011 01:21:38 PM UTC, original submission:
Dear maintainers,
stimulated by the comment
in spdiags.m, I found the following:
1) diag is much faster then spdiags in extracting diagonals. I get
2) spdiags fails in the following case:
whereas it works with [1,1;1,1].
3) diag is not compatible:
whereas Matlab gives empty matrix 0-by-1.
If 3) is fixed, I can easily rewrite spdiags.m to avoid problems 2) and 1) (without testing if the diagonal is out of range). However, I'm not clever and I cannot do it without a loop :-(
4) there is another incompatible behaviour:
whereas in Matlab
I do not understand this Matlab (7.6.0) behaviour.
If we take a decision about 4) and someone fixes 3), I can work on 1) and 2).
Cheers,
Marco
|