/// Applies a specified flag change to the flag in place.
///
/// Recall that an `i`-flag change sends a flag to another that shares all
/// elements except for the `i`-th one. In a valid (dyadic) polytope, the
/// resulting flag always exists and is unique.
///
/// # Panics
/// You must call [`Polytope::element_sort`] before calling this method.
/// Further, flag changes only really make sense from rank 1 up to the rank
/// of the polytope minus 1.
Applies a specified flag change to the flag in place.
Recall that an `i`-flag change sends a flag to another that shares all
elements except for the `i`-th one. In a valid (dyadic) polytope, the
resulting flag always exists and is unique.
Applies a specified flag change to the flag in place . Recall that an ` i ` - flag change sends a flag to another that shares all elements except for the ` i ` - th one . In a valid ( dyadic ) polytope the resulting flag always exists and is unique .
pub fn change_mut(&mut self, polytope: &Abstract, r: usize) {
        // This is running in a hot loop. Maybe get rid of it?
        if cfg!(debug_assertions) {
            assert_sorted(polytope);
        }
        debug_assert!(r >= 1);
        // Determines the common elements between the subelements of the element
        // above and the superelements of the element below.
        let below_idx = self[r - 1];
        let below = &polytope[(r - 1, below_idx)];
        let above_idx = self[r + 1];
        let above = &polytope[(r + 1, above_idx)];
        let (c0, c1) = common(&below.sups, &above.subs);
        // Changes the element at idx to the other element in the section
        // determined by the elements above and below.
        if self[r] == c0 {
            self[r] = c1;
        } else {
            self[r] = c0;
        }
    }
pub fn change_mut ( & mut self , polytope : & Abstract , r : usize ) { // This is running in a hot loop. Maybe get rid of it? if cfg ! ( debug_assertions ) { assert_sorted ( polytope ) ; } debug_assert ! ( r 1 ) ; // Determines the common elements between the subelements of the element // above and the superelements of the element below. let below_idx = self [ r - 1 ] ; let below = & polytope [ ( r - 1 , below_idx ) ] ; let above_idx = self [ r + 1 ] ; let above = & polytope [ ( r + 1 , above_idx ) ] ; let ( c0 , c1 ) = common ( & below . sups , & above . subs ) ; // Changes the element at idx to the other element in the section // determined by the elements above and below. if self [ r ] == c0 { self [ r ] = c1 ; } else { self [ r ] = c0 ; } }
Applies a specified flag change to the flag in place.
Applies a specified flag change to the flag in place .
&mut self
polytope
&Abstract
r
usize
panics
You must call [`Polytope::element_sort`] before calling this method.
Further, flag changes only really make sense from rank 1 up to the rank
of the polytope minus 1.
You must call [ ` Polytope :: element_sort ` ] before calling this method . Further flag changes only really make sense from rank 1 up to the rank of the polytope minus 1 .