lib/more_math/permutation.rb
# Switchtes this Permutation instance to the inverted permutation.
# (See Permutation#compose for an example.)
Switchtes this Permutation instance to the inverted permutation.
(See Permutation#compose for an example.)
Switchtes this Permutation instance to the inverted permutation . ( See Permutation#compose for an example . )
def invert!
      indices = unrank_indices(rank)
      inverted = Array.new(size)
      for i in 0...size
        inverted[indices[i]] = i
      end
      self.rank = rank_indices(inverted)
      self
    end
def invert! indices = unrank_indices ( rank ) inverted = Array . new ( size ) for i in 0 ... size inverted [ indices [ i ] ] = i end self . rank = rank_indices ( inverted ) self end
Switchtes this Permutation instance to the inverted permutation.
Switchtes this Permutation instance to the inverted permutation .