[Top][All Lists]

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

[Octave-bug-tracker] [bug #35150] spdiags() 4-argument incompatibility

From: David Bateman
Subject: [Octave-bug-tracker] [bug #35150] spdiags() 4-argument incompatibility
Date: Mon, 21 May 2012 00:23:39 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:12.0) Gecko/20100101 Firefox/12.0

Update of bug #35150 (project octave):

                  Status:                    None => Fixed                  
             Assigned to:                    None => dbateman               


Follow-up Comment #3:

Sorry I accidently flagged an entry in this bug report as spam, and I can't
seem to remove the flag !! In any case the error here is a combination of the
addition of broadcast operators and the bug fix in the changeset


which combined means that spdiags treated row vectors of values badly. I
believe a more generic fix is 

diff --git a/scripts/sparse/spdiags.m b/scripts/sparse/spdiags.m
--- a/scripts/sparse/spdiags.m
+++ b/scripts/sparse/spdiags.m
@@ -79,8 +79,8 @@
     ## Create new matrix of size mxn using v,c
     [j, i, v] = find (v);
     offset = max (min (c(:), n-m), 0);
-    j = j + offset(i);
-    i = j-c(:)(i);
+    j = j(:) + offset(i(:));
+    i = j - c(:)(i(:));
     idx = i > 0 & i <= m & j > 0 & j <= n;
     A = sparse (i(idx), j(idx), v(idx), m, n);

I'll push this fix and so am closing this bug



Reply to this item at:


  Message sent via/by Savannah

reply via email to

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