Coerces a regular matrix to a matrix with type-safe dimensions and throws an error if coercion failed
The same as DMatrix.coerce but without dimension checks. Use with caution.