-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
PySparse has the ability to scale multiple rows/columns via the *= operand
from pysparse.sparse import PysparseMatrix as psp
J = psp(nrow=3, ncol=3)
J[0,0] = 1
J[1,1] = 2
J[2,2] = 3
# Scale two first rows:"
J[:2,:] *= -1.0It is not possible to do that with CySparse. The same operation fails with error message:
TypeError: unsupported operand type(s) for *=: 'cysparse.sparse.ll_mat_views.ll_mat_view_INT64_t_FLOAT64_t.LLSparseMatrixView_INT64_t_FLOAT64_t' and 'float'
Is there a way to efficiently do the same operation? (without having to call J.row_scale multiple times)
@counterclocker
Reactions are currently unavailable