Free Touch Pricker
    Preparing search index...

    Function inverse

    • Computes the inverse of a row.

      From Knuth 1.3.3:

      The inverse π- of a permutation π is the rearrangement that undoes the effect of π; if i goes to j under π, then j goes to i under π-. Thus the product ππ- equals the identity permutation, and so does the product π-π.

      > inverse([5, 3, 1, 2, 4, 6])
      [3, 4, 2, 5, 1, 6]
      > multiply([5, 3, 1, 2, 4, 6], inverse([5, 3, 1, 2, 4, 6]))
      [1, 2, 3, 4, 5, 6]
      > multiply(inverse([5, 3, 1, 2, 4, 6]), [5, 3, 1, 2, 4, 6])
      [1, 2, 3, 4, 5, 6]

      A new row is returned; the original is left unchanged.

      Parameters

      Returns Row