An Abstract Matrix Class and Derivatives