Dear members, The code I am writing heavily use element-wise multiplication of matrix and vectors, e.g.
X, is nxm matrix e, is nx1 matrix Doing Z=X*e[,], I obtain a nxm matrix, Z, where each column of X is multiplied (element-wise) by e. Is this the best way to achieve the result I want? By best way, I mean the fastest way. By profiling my code, 45% of the time is spent by "*" and even a 30% speedup in obtaining Z would greatly benefit the total speed of the code. Aby suggestion is greatly appreciated. |Giuseppe Ragusa |University of California, San Diego ------------------------------------------------------------ Please avoid sending me Word or PowerPoint attachments. See http://www.gnu.org/philosophy/no-word-attachments.html ______________________________________________ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
