From tpapp at Princeton.EDU  Wed Nov 29 16:33:09 2006
From: tpapp at Princeton.EDU (Tamas K Papp)
Date: Wed, 29 Nov 2006 10:33:09 -0500
Subject: [Rd] Matrix*vector: coercing sparse to dense matrix for arithmetic
Message-ID: <20061129153309.GA6836@pu100877.student.princeton.edu>

Hi,

I have a sparse Matrix (kronecker product of spline design matrices),
and I need to multiply each row by a number to get another matrix.  If
the matrix is A and the numbers are stored in a vector k, with plain
vanilla matrices I would do

A*k

But when using the Matrix package (class of A is "dgCMatrix"), I get
the warning "coercing sparse to dense matrix for arithmetic".  The
error message is perfectly reasonable, I am looking for a way to do it
right (keeping operations in the realm of sparse matrices).  Any help
would be appreciated.

Thanks,

Tamas



[Rd] Matrix*vector: coercing sparse to dense matrix for arithmetic
Tamas K Papp