Added constructor using MatrixSparsityPattern.