Generalize type of identity matrix