C++, Matrix implmentation, including standard matrix, sparse matrix, diagonal matrix