Added dimension function to Matrix.hpp