fn remove_possibility<A, C>(&'a mut self, clique_id: CliqueId,
                                (axis, cross_axis): (&[A], &[C]),
                                (axis_item, cross_axis_item): (A, C))
        where A: Copy + Eq + Hash + Ord + 'a,
              C: Copy + Ord + 'a,
              CaseId: FromIndex<(A,C)>,
              &'a mut Lookup<A, C>: From<&'a mut LookupPair> {

        let grid = &self.grid;
        let referrers_lookup: &mut Lookup<A, C> = (&mut self.lookups).into();
        let possibilities: Vec<_> =
            axis.iter()
                .cloned()
                .filter(|&axis_id| {
                    let case_id: CaseId = grid.convert((axis_id, cross_axis_item));
                    grid[case_id]
                }).collect();
        let mut key = (clique_id, possibilities);

        // Here we remove `cross_axis_item` from the list of `referrers` of `possibilities`,
        // and check if we've found a partition.
        let referrers_len = {
            let referrers = referrers_lookup.get_mut(&key)
                                            .expect("Partitioner bug: \
                                                     No referrers for possibilities");
            Self::remove(referrers, &cross_axis_item);
            Self::check_for_partition(&key.1,
                                      referrers,
                                      cross_axis,
                                      grid,
                                      &mut self.inferences);
            referrers.len()
        };
        if referrers_len == 0 {
            referrers_lookup.remove(&key);
        }

        // `cross_axis_item`s new `possibilties` are (possibilities - axis_item)
        // It's easiest/fastest to just tweak `possibilities` to remove the `axis_item`.
        Self::remove(&mut key.1, &axis_item);

        // Here we add `cross_axis_item` to the list of `referrers` of the the new
        // `possibilities` and check if we've found a partition.
        if !referrers_lookup.contains_key(&key) { // avoiding entry() because it'd consume key
            referrers_lookup.insert(key.clone(), vec![]);
        }
        let referrers = referrers_lookup.get_mut(&key)
                                        .expect("Partitioner bug: \
                                                 No referrers for new possibilities.");
        Self::insert(referrers, cross_axis_item);
        Self::check_for_partition(&key.1,
                                  referrers,
                                  cross_axis,
                                  grid,
                                  &mut self.inferences);
    }
// The core idea of what this does, is it marks `cross_axis_item` as
// no longer referring to a set of possibilities that includes `axis_item`,
// updating the bookkeeping as appropriate
The core idea of what this does, is it marks `cross_axis_item` as
no longer referring to a set of possibilities that includes `axis_item`,
updating the bookkeeping as appropriate
The core idea of what this does is it marks ` cross_axis_item ` as no longer referring to a set of possibilities that includes ` axis_item ` updating the bookkeeping as appropriate
fn remove_possibility<A, C>(&'a mut self, clique_id: CliqueId,
                                (axis, cross_axis): (&[A], &[C]),
                                (axis_item, cross_axis_item): (A, C))
        where A: Copy + Eq + Hash + Ord + 'a,
              C: Copy + Ord + 'a,
              CaseId: FromIndex<(A,C)>,
              &'a mut Lookup<A, C>: From<&'a mut LookupPair> {
        let grid = &self.grid;
        let referrers_lookup: &mut Lookup<A, C> = (&mut self.lookups).into();
        let possibilities: Vec<_> =
            axis.iter()
                .cloned()
                .filter(|&axis_id| {
                    let case_id: CaseId = grid.convert((axis_id, cross_axis_item));
                    grid[case_id]
                }).collect();
        let mut key = (clique_id, possibilities);
        // Here we remove `cross_axis_item` from the list of `referrers` of `possibilities`,
        // and check if we've found a partition.
        let referrers_len = {
            let referrers = referrers_lookup.get_mut(&key)
                                            .expect("Partitioner bug: \
                                                     No referrers for possibilities");
            Self::remove(referrers, &cross_axis_item);
            Self::check_for_partition(&key.1,
                                      referrers,
                                      cross_axis,
                                      grid,
                                      &mut self.inferences);
            referrers.len()
        };
        if referrers_len == 0 {
            referrers_lookup.remove(&key);
        }
        // `cross_axis_item`s new `possibilties` are (possibilities - axis_item)
        // It's easiest/fastest to just tweak `possibilities` to remove the `axis_item`.
        Self::remove(&mut key.1, &axis_item);
        // Here we add `cross_axis_item` to the list of `referrers` of the the new
        // `possibilities` and check if we've found a partition.
        if !referrers_lookup.contains_key(&key) { // avoiding entry() because it'd consume key
            referrers_lookup.insert(key.clone(), vec![]);
        }
        let referrers = referrers_lookup.get_mut(&key)
                                        .expect("Partitioner bug: \
                                                 No referrers for new possibilities.");
        Self::insert(referrers, cross_axis_item);
        Self::check_for_partition(&key.1,
                                  referrers,
                                  cross_axis,
                                  grid,
                                  &mut self.inferences);
    }
fn remove_possibility < A , C > ( & ' a mut self , clique_id : CliqueId , ( axis , cross_axis ) : ( & [ A ] , & [ C ] ) , ( axis_item , cross_axis_item ) : ( A , C ) ) where A : Copy + Eq + Hash + Ord + ' a , C : Copy + Ord + ' a , CaseId : FromIndex < ( A , C ) > , & ' a mut Lookup < A , C > : From < & ' a mut LookupPair > { let grid = & self . grid ; let referrers_lookup : & mut Lookup < A , C > = ( & mut self . lookups ) . into ( ) ; let possibilities : Vec < _ > = axis . iter ( ) . cloned ( ) . filter ( | & axis_id | { let case_id : CaseId = grid . convert ( ( axis_id , cross_axis_item ) ) ; grid [ case_id ] } ) . collect ( ) ; let mut key = ( clique_id , possibilities ) ; // Here we remove `cross_axis_item` from the list of `referrers` of `possibilities`, // and check if we've found a partition. let referrers_len = { let referrers = referrers_lookup . get_mut ( & key ) . expect ( " \
 " ) ; Self :: remove ( referrers , & cross_axis_item ) ; Self :: check_for_partition ( & key . 1 , referrers , cross_axis , grid , & mut self . inferences ) ; referrers . len ( ) } ; if referrers_len == 0 { referrers_lookup . remove ( & key ) ; } // `cross_axis_item`s new `possibilties` are (possibilities - axis_item) // It's easiest/fastest to just tweak `possibilities` to remove the `axis_item`. Self :: remove ( & mut key . 1 , & axis_item ) ; // Here we add `cross_axis_item` to the list of `referrers` of the the new // `possibilities` and check if we've found a partition. if ! referrers_lookup . contains_key ( & key ) { // avoiding entry() because it'd consume key referrers_lookup . insert ( key . clone ( ) , vec ! [ ] ) ; } let referrers = referrers_lookup . get_mut ( & key ) . expect ( " \
 " ) ; Self :: insert ( referrers , cross_axis_item ) ; Self :: check_for_partition ( & key . 1 , referrers , cross_axis , grid , & mut self . inferences ) ; }
The core idea of what this does, is it marks `cross_axis_item` as
no longer referring to a set of possibilities that includes `axis_item`,
updating the bookkeeping as appropriate
The core idea of what this does is it marks ` cross_axis_item ` as no longer referring to a set of possibilities that includes ` axis_item ` updating the bookkeeping as appropriate
&'a mut self
clique_id
(A, C)
&'a mut self
clique_id
(A, C)