Matrix and Vector in template