Template library for linear algebra