Add more functions to initialize DMat and DVec.