Add several basic fields/functions for class Matrix.