[Scipy-tickets] [SciPy] #329: Sparse Real matrix matvec() method gives incorrect results if the vector is complex

SciPy scipy-tickets at scipy.net
Thu Dec 7 07:17:54 CST 2006


#329: Sparse Real matrix matvec() method gives incorrect results if the vector is
complex
--------------------------+-------------------------------------------------
 Reporter:  NeilenMarais  |       Owner:  somebody
     Type:  defect        |      Status:  new     
 Priority:  normal        |   Milestone:          
Component:  Other         |     Version:          
 Severity:  normal        |    Keywords:          
--------------------------+-------------------------------------------------
 {{{
 In [105]: A = N.eye(3)

 In [106]: A_sp = scipy.sparse.csc_matrix(A)

 In [107]: b = N.array([1j, 1, -1j])

 In [108]: N.dot(A,b)
 Out[108]: array([ 0.+1.j,  1.+0.j,  0.-1.j])

 In [109]: A_sp.matvec(b)
 Out[109]: array([ 0.,  1.,  0.])
 }}}

 Note that the sparse matrix vector product ignores the imaginary part of
 b. Getting correct results requires one to make A complex which is quite a
 waste of memory if it is purely real and also a drag on performance if an
 iterative solve is being performed.

-- 
Ticket URL: <http://projects.scipy.org/scipy/scipy/ticket/329>
SciPy <http://www.scipy.org/>
SciPy is open-source software for mathematics, science, and engineering.


More information about the Scipy-tickets mailing list