Adds matrix preprocessing.