if (isIdentity()) {
inverse = this;
} else {
final XMatrix matrix = getGeneralMatrix();
try {
matrix.invert();
} catch (SingularMatrixException exception) {
throw new NoninvertibleTransformException(Errors.format(
ErrorKeys.NONINVERTIBLE_TRANSFORM), exception);
} catch (MismatchedSizeException exception) {
// This exception is thrown if the matrix is not square.