I read an article about the optimisation of nested product of matrices, using dynamic programming, and I wanted to see how it is implemented in boost::uBLAS.
I'm not sure I understood the documentation (they talk about it at the very end of the page), but it seems they handle this problem. When you write R = prod(A, prod(B,C));
, the library computes A x (B x C)
or (A x B) x C
depending on the sizes of A
, B
and C
.
How can it be achieved ? How can the library "move the brackets" ? When writing such a code line, I thought the arguments of prod
would be evaluated, and then the function would be run.
The FAQ mentions the notion of expression templates. Is it linked ?