An algorithm for automatic domain partitioning of Piecewise-Affine Model Predictive Control laws