Learn R Programming

ADtools (version 0.5.4)

matrix_prod: Interface for optimal matrix chain multiplication

Description

Interface for optimal matrix chain multiplication

Usage

matrix_prod(..., method = "optimal")

Arguments

...

Numeric matrices.

method

"optimal" order or "natural" left-to-right order.

Examples

Run this code
# NOT RUN {
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") })

# }

Run the code above in your browser using DataLab