Performance is not an issue here. We can use high-level APIs like `DoubleMatrix#mmul` and `DoubleMatrix#transpose`.