pub fn pow_unsigned(&self, mut exp: u64) -> Perm {
        // Exponentiation by squaring (permutations form a monoid)

        // NOTE: there's plenty of room to optimize the number of heap
        //       allocations here
        let mut acc = Perm::eye(self.len());
        let mut base = self.clone();
        while exp > 0 {
            if (exp & 1) == 1 {
                acc = acc.permuted_by(&base);
            }
            base = base.clone().permuted_by(&base);
            exp /= 2;
        }
        acc
    }
/// Compute the permutation that applies this permutation `exp` times in a row.
///
/// This uses exponentiation by squaring to run in `O(log(exp))` time.
Compute the permutation that applies this permutation `exp` times in a row.
This uses exponentiation by squaring to run in `O(log(exp))` time.
Compute the permutation that applies this permutation ` exp ` times in a row . This uses exponentiation by squaring to run in ` O ( log ( exp )) ` time .
pub fn pow_unsigned(&self, mut exp: u64) -> Perm {
        // Exponentiation by squaring (permutations form a monoid)
        // NOTE: there's plenty of room to optimize the number of heap
        //       allocations here
        let mut acc = Perm::eye(self.len());
        let mut base = self.clone();
        while exp > 0 {
            if (exp & 1) == 1 {
                acc = acc.permuted_by(&base);
            }
            base = base.clone().permuted_by(&base);
            exp /= 2;
        }
        acc
    }
pub fn pow_unsigned ( & self , mut exp : u64 ) -> Perm { // Exponentiation by squaring (permutations form a monoid) // NOTE: there's plenty of room to optimize the number of heap //       allocations here let mut acc = Perm :: eye ( self . len ( ) ) ; let mut base = self . clone ( ) ; while exp > 0 { if ( exp & 1 ) == 1 { acc = acc . permuted_by ( & base ) ; } base = base . clone ( ) . permuted_by ( & base ) ; exp /= 2 ; } acc }
Compute the permutation that applies this permutation `exp` times in a row.
Compute the permutation that applies this permutation ` exp ` times in a row .
&self
exp
u64
&self
exp
u64