invert_byname function

Invert a matrix