Closed Realtyxxx closed 1 year ago
Suppose you have
d = A * B * c
where A
and B
are matrices and c
and d
are vectors. If you multiply from left to right that is A->B->c
you end up doing a matrix-matrix multiplication A*B
which is costly. If you multiply from right-to-left A<-B-<c
then the matrix-vector product B*c
is computed first as an intermediate matrix e = B*c
and finally we get d=A*e
which is another matrix-vector product. So we reduce matrix-matrix multiplication to matrix-vector multiplication which is certainly faster.
This is greedy-matrix chain product in a nutshell. Obviously, Fastor is capable of reducing the cost of much more complicated expressions.
I'm learning the Fastor by interest, AndI want to know what is "greedy matrix-chain products "