`write(filename)` exists for Lis and Petsc because they do not take std::ostream. On the other hand, `operator <<(ostream)` is implemented for DenseMatrix.