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

From: Tamas K Papp <tpapp_at_princeton.edu>
Date: Wed 29 Nov 2006 - 15:33:09 GMT


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


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.



R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Thu Nov 30 02:39:15 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 30 Nov 2006 - 07:30:55 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.