templated sMatrix class