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

[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

http://hg.savannah.gnu.org/hgweb/octave/rev/1f0243949b77

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);
   endif


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

D.


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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