Scattering-matrix propagation algorithm in full-vectorial optics of multilayer grating structures