Application of GPC to the control of switching linear systems