On 16.06.2013 04:35, G Vishwanath wrote:
Is there a R package or function that will multiple an arbitrary number of
matrices supplied to it, preferably optimizing the sequence
R_function(matA, matB, matC, matD,....)
return matA %*% matB %*% matC %matD %....
and optimizing wether it is better to do A(BC) or (AB)C ?
For part 1) or your question:
Reduce("%*%", list(matA, matB, matC, matD, ...)
for part 2): No idea.
Best,
Uwe Ligges
Thanks,
Shiv
[[alternative HTML version deleted]]
______________________________________________
[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
and provide commented, minimal, self-contained, reproducible code.
______________________________________________
[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
and provide commented, minimal, self-contained, reproducible code.