pub fn new(tie_resolutions : Vec<Vec<CandidateIndex>>) -> anyhow::Result<Self> {
        for decision in &tie_resolutions {
            let mut ordered = decision.clone();
            ordered.sort_by_key(|c|c.0);
            ordered.dedup();
            if ordered.len()!=decision.len() {
                return Err(anyhow!("Tie resolutions {} contain at least one repeated candidate",decision.iter().map(|c|c.to_string()).collect::<Vec<_>>().join(",")));
            }
        }
        Ok(TieResolutionsMadeByEC{tie_resolutions})
    }
/// Simple constructor that checks to see that a candidate is not repeated which would cause later bugs and would be ambiguous in any case.
Simple constructor that checks to see that a candidate is not repeated which would cause later bugs and would be ambiguous in any case.
Simple constructor that checks to see that a candidate is not repeated which would cause later bugs and would be ambiguous in any case .
pub fn new(tie_resolutions : Vec<Vec<CandidateIndex>>) -> anyhow::Result<Self> {
        for decision in &tie_resolutions {
            let mut ordered = decision.clone();
            ordered.sort_by_key(|c|c.0);
            ordered.dedup();
            if ordered.len()!=decision.len() {
                return Err(anyhow!("Tie resolutions {} contain at least one repeated candidate",decision.iter().map(|c|c.to_string()).collect::<Vec<_>>().join(",")));
            }
        }
        Ok(TieResolutionsMadeByEC{tie_resolutions})
    }
pub fn new ( tie_resolutions : Vec < Vec < CandidateIndex > > ) -> anyhow :: Result < Self > { for decision in & tie_resolutions { let mut ordered = decision . clone ( ) ; ordered . sort_by_key ( | c | c . 0 ) ; ordered . dedup ( ) ; if ordered . len ( ) != decision . len ( ) { return Err ( anyhow ! ( " " decision iter ( ) map ( c c to_string ( ) ) collect Vec ( ) join ( " " ) ) ) ; } } Ok ( TieResolutionsMadeByEC { tie_resolutions } ) }
Simple constructor that checks to see that a candidate is not repeated which would cause later bugs and would be ambiguous in any case.
Simple constructor that checks to see that a candidate is not repeated which would cause later bugs and would be ambiguous in any case .
tie_resolutions
Vec<Vec<CandidateIndex>>
tie_resolutions
Vec<Vec<CandidateIndex>>