Add clone method and serialize method to hash and array matrix.
Add clone method and serialize method for linked matrix