Transferring Matrix class to RLlib.