From: Dominique O. <dom...@gm...> - 2010-03-26 23:15:47
|
On Fri, Mar 26, 2010 at 4:32 PM, Rob Speer <rs...@mi...> wrote: >> The matvec behavior is the intended behavior. The whole idea of the >> PysparseMatrix class is that it is "easy" and "natural" to use. >> Amongst other things, that means you can say y=A*x instead of >> A.matvec(x,y). The savvy user will notice (as you did) that ll_mat >> objects are more efficient and will use those. The typical user will >> use the PysparseMatrix class. > > That creates a rather broken API. Having an inplace version of matvec > is fine, but please at least call it "matvec_inplace" or something, in > both ll_mat and jdsym, to make it clear that it's not supposed to be > matvec. The current situation is very confusing. I understand your confusion now. You're not supposed to use the matvec method of a PysparseMatrix object. You're just supposed to say "*", as in y=A*x. One of us did add a matvec method in there just because that is what Scipy solvers expect. I should really let the others chime in about renaming ll_mat.matvec. That would surely break some existing code. Perhaps the surest thing is to subclass PysparseMatrix and add the matvec method there, just for Scipy solvers. Thanks for the raising this point. Dominique -- Dominique |