Add a copy constructor and assignment operator for the matrix class