Created matrix generic class that has some operations.