S-linear algebra and applications