Is y dimension (1xJ) a type or the actual dimension ? In that later
case, a ValueError is expected for matrix product :)
cheers,
David
_______________________________________________
SciPy-user mailing list
SciPy...@scipy.org
http://projects.scipy.org/mailman/listinfo/scipy-user
I guess this is the problem
It looks like, which multiplication is used, is defined by the order,
__rmult__, __mult__
>>> A = sparse.lil_matrix([[0.0,0,5,3],]).tocsr()
>>> A
<1x4 sparse matrix of type '<type 'numpy.float64'>'
with 2 stored elements in Compressed Sparse Row format>
>>> np.ones(4)*A
Traceback (most recent call last):
File "<pyshell#126>", line 1, in <module>
np.ones(4)*A
File "\Programs\Python25\Lib\site-packages\scipy\sparse\base.py",
line 350, in __rmul__
return (self.transpose() * tr).transpose()
File "\Programs\Python25\Lib\site-packages\scipy\sparse\base.py",
line 299, in __mul__
raise ValueError('dimension mismatch')
ValueError: dimension mismatch
>>> A*np.ones(4)
array([ 8.])
Josef