Dynamic Algorithm for LQGPC Predictive Control