Good point, this is a classic space-time tradeoff — it’s a good idea to cache these products with A
since they are re-used many times. This sort of thing comes up a lot in broadcast-type operations, e.g. Why is this Julia code considerably slower than Matlab - #62 by stevengj
4 Likes