A simple class template for matrix based on dynamic memory