Possible Bug when Adding Sparse and Diagonal Matrices

Sebastian Schöps sebastian at schoeps.org
Wed Jul 1 10:43:28 CDT 2009


Dear all,
I encountered today that there is a possible bug when adding sparse  
and diagonal matrices. Here is an example
A=5*sparse(eye(2))+sparse([1 2 2],[2 1 2],[-1 1 3]);
B=5*eye(2)+sparse([1 2 2],[2 1 2],[-1 1 3]);
full(A)-full(B) % gives [0 0; 0 0]
full(A-B) % gives [-5 0; 0 0]

Best regards,
Sebastian Schoeps



More information about the Bug-octave mailing list