BLAS (basic linear algebra subprograms) provide many other programming languages, like Matlab, which I use, with fast routines to do things like matrix multiplication.
However, when multiplying multiple matrices together, there is an optimal order to "bracket" the matrices. Taken from the wikipedia article:
For example, suppose A is a 10 × 30 matrix, B is a 30 × 5 matrix, and C is a 5 × 60 matrix. Then,
(AB)C = (10×30×5) + (10×5×60) = 1500 + 3000 = 4500 operations
A(BC) = (30×5×60) + (10×30×60) = 9000 + 18000 = 27000 operations.
The article goes on to discuss ways you solve for the optimal order of this multiplication. My question is, are any of these optimisation procedures utilised in BLAS? If not, can I get better speed if I explicitly define the order of matrix multiplications in programs like Matlab with appropriate use of brackets?