| matrix_prod {ADtools} | R Documentation |
Interface for optimal matrix chain multiplication
matrix_prod(..., method = "optimal")
... |
Numeric matrices. |
method |
"optimal" order or "natural" left-to-right order. |
A <- randn(20, 5)
B <- randn(5, 40)
C <- randn(40, 2)
system.time({ matrix_prod(A, B, C, method = "optimal") })
system.time({ matrix_prod(A, B, C, method = "natural") })