java.lang.Object
dk.jonaslindstrom.ruffini.permutations.elements.Permutation
All Implemented Interfaces:
java.util.function.Function<Integer,Integer>, java.util.function.UnaryOperator<Integer>

public class Permutation extends Object implements java.util.function.UnaryOperator<Integer>
  • Constructor Details

    • Permutation

      public Permutation(Integer n)
    • Permutation

      public Permutation(int n, int[] cycle)
    • Permutation

      public Permutation(int... permutation)
  • Method Details

    • samplePermutation

      public static Permutation samplePermutation(int n, Random random)
      Sample a random permutation uniformly among all permutations on n elements.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • apply

      public Integer apply(Integer x)
      Specified by:
      apply in interface java.util.function.Function<Integer,Integer>
    • getMatrixRepresentation

      public Matrix<Integer> getMatrixRepresentation()