move det methods to matrix class template