Matrix template library in c++