lballabio/quantlib — pull request #96 by pcaspers (2014-05-17 19:57:19+00:00)
Title: optimize matrix multiplication

This seems to be an easy way to speed up the (native) matrix multiplication in QuantLib: There is a nice article on matrix multiplication here http://www.heise.de/ct/inhalt/2014/12/176/ (in german only though), from which I just took the part of (explicit loops and) using a loop order i-k-j instead of i-j-k. The results might well depend on optimization level and target; with clang 3.5.0 -O3 and x86_64 under linux I get the following timings for the test code under https://gist.github.com/pcaspers/bcc61ff74ae50bc2d9b3 which performs A*B with 1024x1024 matrices A and B

Original Code 10.59s
Explicit Loops i-j-k 8.01s
Explicit Loops i-k-j 0.96s