Change MatrixBase

This request will add template parameters (FP_TYPE, IDX_TYPE) and some member functions to MatrixBase class so that one can use it as interface of any matrix implementations. Its sub classes had to be changed.