speed up DenseMatrix