Matrix class for symbolic product