Rewrite the CoordinateMatrix class to make it support Boolean, Int, Double