[SciPy-user] Left hand sparse matrix multiplication
Wed Oct 8 11:36:10 CDT 2008
On Wed, Oct 8, 2008 at 11:41 AM, James Philbin <firstname.lastname@example.org> wrote:
> I'm trying to compute x*A where x is a dense row vector and A is a
> sparse CSC matrix. A.rmatvec seems to do what I want but is wasteful
> as it computes:
> self.transpose().matvec( other )
> i.e. it computes A^T * x^T.
> It seems there should be a much more efficient overload for csc's
> rmatvec which doesn't involve computing the transpose. I hope i'm
> understanding things correctly.
Do you only need matrix-vector products with A in this form, i.e.,
x*A, or do you also need A*x? If you only need x*A you're probably
better off storing B=A^T in CSR format and computing B*x' where x' is
the column vector x (always stored as a column vector.)
> On Tue, Oct 7, 2008 at 9:12 PM, Anne Archibald
> <email@example.com> wrote:
>> 2008/10/7 Neilen Marais <firstname.lastname@example.org>:
>>> I have a real sparse matrix that I factorized using
>>> scipy.sparse.linalg.dsolve.factorized(). When I solve it with a complex
>>> RHS, I always get a real return. Do I need to set the matrix type as
>>> complex in this case, or is there a better way?
>> If all you're doing is solving y = A*x, then you can simply solve for
>> the real and imaginary parts separately, since a real matrix won't mix
>> them and the problem is linear.
>> SciPy-user mailing list
> SciPy-user mailing list
More information about the SciPy-user