toInverse function

Matrix toInverse(
  1. Matrix input
)

Implementation

Matrix toInverse(Matrix input) {
  assert(input.isSquare, 'input must have equal numbers of columns and rows');
  return Matrix.fromList(matrixSolve(fromIterable(input.toList()),
          fromIterable(Matrix.identity(input.rowsNum).toList())))
      .transpose();
}