fn mul(self, rhs: &'b Permutation) -> Self::Output {
        match (self.inv, rhs.inv) {
            (_, false) => Permutation::from_vec(self.apply_slice(&rhs.indices[..])),
            (false, true) => return self * &(rhs * &Permutation::one(self.len())),
            (true, true) => Permutation {
                inv: true,
                indices: rhs.apply_inv_slice(&self.indices[..]),
            },
        }
    }
/// Multiply permutations, in the mathematical sense.
///
/// Given two permutations `a`, and `b`, `a * b` is defined as
/// the permutation created by first applying b, then applying a.
///
/// # Examples
///
/// ```
/// # use permutation::Permutation;
/// let p1 = Permutation::from_vec(vec![1, 0, 2]);
/// let p2 = Permutation::from_vec(vec![0, 2, 1]);
/// assert!(&p1 * &p2 == Permutation::from_vec(vec![2,0,1]));
/// ```
Multiply permutations, in the mathematical sense.
Multiply permutations in the mathematical sense .
fn mul(self, rhs: &'b Permutation) -> Self::Output {
        match (self.inv, rhs.inv) {
            (_, false) => Permutation::from_vec(self.apply_slice(&rhs.indices[..])),
            (false, true) => return self * &(rhs * &Permutation::one(self.len())),
            (true, true) => Permutation {
                inv: true,
                indices: rhs.apply_inv_slice(&self.indices[..]),
            },
        }
    }
fn mul ( self , rhs : & ' b Permutation ) -> Self :: Output { match ( self . inv , rhs . inv ) { ( _ , false ) => Permutation :: from_vec ( self . apply_slice ( & rhs . indices [ .. ] ) ) , ( false , true ) => return self * & ( rhs * & Permutation :: one ( self . len ( ) ) ) , ( true , true ) => Permutation { inv : true , indices : rhs . apply_inv_slice ( & self . indices [ .. ] ) , } , } }
Multiply permutations, in the mathematical sense.
Multiply permutations in the mathematical sense .
self
rhs
&'b Permutation
self
rhs
&'b Permutation
examples
None
use permutation::permutation;
None