computeUpRightToBottomRight method

int computeUpRightToBottomRight()

Implementation

int computeUpRightToBottomRight() {
  final perm = List.of(_ep);
  var b = 0;

  // compute the index b < 12! for the permutation
  for (var j = 11; j > 0; j--) {
    var k = 0;

    while (perm[j].index != j) {
      _rotateLeft(perm, 0, j);
      k++;
    }

    b = (j + 1) * b + k;
  }

  return b;
}