pub fn apply<Tally:PartialEq+Clone+Display+FromStr>(&mut self,count:CountIndex,transcript:&SingleCount<Tally>) {
        if count.0>0 && self.count.0+1!=count.0 { panic!("Counts must be processed in order without skipping any.")}
        self.count=count;
        for c in &transcript.not_continuing {
            self.continuing.remove(c);
        }
        self.transfer_values.push(transcript.created_transfer_value.as_ref().map(|c|c.transfer_value.clone()).or(transcript.portion.transfer_value.clone()).unwrap_or(TransferValue::one()));
        match &transcript.reason {
            ReasonForCount::FirstPreferenceCount => { self.first_preferences(count); }
            ReasonForCount::ExcessDistribution(c) => { self.update(count,transcript.reason_completed,&[*c],&transcript.portion.papers_came_from_counts); }
            ReasonForCount::Elimination(c) => { self.update(count,transcript.reason_completed,c,&transcript.portion.papers_came_from_counts); }
        }
        // elections occur after distribution.
        for c in &transcript.elected {
            self.continuing.remove(&c.who);
            self.elected.push(c.who);
        }
    }
/// Apply the given count to the Retroscope. Update all the internal fields.
Apply the given count to the Retroscope. Update all the internal fields.
Apply the given count to the Retroscope . Update all the internal fields .
pub fn apply<Tally:PartialEq+Clone+Display+FromStr>(&mut self,count:CountIndex,transcript:&SingleCount<Tally>) {
        if count.0>0 && self.count.0+1!=count.0 { panic!("Counts must be processed in order without skipping any.")}
        self.count=count;
        for c in &transcript.not_continuing {
            self.continuing.remove(c);
        }
        self.transfer_values.push(transcript.created_transfer_value.as_ref().map(|c|c.transfer_value.clone()).or(transcript.portion.transfer_value.clone()).unwrap_or(TransferValue::one()));
        match &transcript.reason {
            ReasonForCount::FirstPreferenceCount => { self.first_preferences(count); }
            ReasonForCount::ExcessDistribution(c) => { self.update(count,transcript.reason_completed,&[*c],&transcript.portion.papers_came_from_counts); }
            ReasonForCount::Elimination(c) => { self.update(count,transcript.reason_completed,c,&transcript.portion.papers_came_from_counts); }
        }
        // elections occur after distribution.
        for c in &transcript.elected {
            self.continuing.remove(&c.who);
            self.elected.push(c.who);
        }
    }
pub fn apply < Tally : PartialEq + Clone + Display + FromStr > ( & mut self , count : CountIndex , transcript : & SingleCount < Tally > ) { if count . 0 > 0 && self . count . 0 + 1 != count . 0 { panic ! ( " " ) } self . count = count ; for c in & transcript . not_continuing { self . continuing . remove ( c ) ; } self . transfer_values . push ( transcript . created_transfer_value . as_ref ( ) . map ( | c | c . transfer_value . clone ( ) ) . or ( transcript . portion . transfer_value . clone ( ) ) . unwrap_or ( TransferValue :: one ( ) ) ) ; match & transcript . reason { ReasonForCount :: FirstPreferenceCount => { self . first_preferences ( count ) ; } ReasonForCount :: ExcessDistribution ( c ) => { self . update ( count , transcript . reason_completed , & [ * c ] , & transcript . portion . papers_came_from_counts ) ; } ReasonForCount :: Elimination ( c ) => { self . update ( count , transcript . reason_completed , c , & transcript . portion . papers_came_from_counts ) ; } } // elections occur after distribution. for c in & transcript . elected { self . continuing . remove ( & c . who ) ; self . elected . push ( c . who ) ; } }
Apply the given count to the Retroscope.
Apply the given count to the Retroscope .
&mut self
count
CountIndex
transcript
&SingleCount<Tally>
&mut self
count
CountIndex
transcript
&SingleCount<Tally>