| To: | Riyanto Wibowo <riyantowibowo@yahoo.com.sg>, s-news@lists.biostat.wustl.edu |
|---|---|
| Subject: | Re: Matrix multiplication |
| From: | "Richard M. Heiberger" <rmh@temple.edu> |
| Date: | Thu, 23 Jun 2005 00:31:32 -0400 |
## The most efficient way to multiply two matrixes in S is to ## use the matrix multiplication function directly. a <- matrix(runif(100000), 50000, 2) b <- c(10, 20) date() P <- a %*% b date() ## This takes less than 1 second ## Do it 1000 times: date() for (i in 1:1000) P <- a %*% b date() ## This loop takes 26 seconds, or .026 seconds for each multiplication. Rich |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Fw: FIEGARCH, Bikash Jain |
|---|---|
| Next by Date: | IDA 2005: CALL FOR PARTICIPATION, IDA 2005 |
| Previous by Thread: | Matrix multiplication, Riyanto Wibowo |
| Next by Thread: | Fw: FIEGARCH, Bikash Jain |
| Indexes: | [Date] [Thread] [Top] [All Lists] |