Theoretical study of the π → π∗ excited states of linear polyene radical cations and dications