fn compute_constraint_types<FI: Zero + PartialEq, FO: From<FI>>(
    rows: &[Row],
    ranges: Vec<SparseTuple<FI>>,
) -> Vec<RangedConstraintRelation<FO>> {
    // Sorted and unique
    debug_assert!(ranges.windows(2).all(|w| w[0].0 < w[1].0));
    debug_assert!(ranges.iter().all(|&(i, _)| i < rows.len()));

    let mut ranges = ranges.into_iter().peekable();
    rows.iter().enumerate()
        .map(|(i, row)| {
            if let Some((_, r)) = ranges.next_if(|&(ii, _)| ii == i) {
                if r == FI::zero() {
                    RangedConstraintRelation::Equal
                } else {
                    RangedConstraintRelation::Range(r.into())
                }
            } else {
                row.constraint_type.into()
            }
        })
        .collect()
}
/// Compute the constraint types by integrating bounds.
///
/// # Arguments
///
/// * `rows`: Contains the constraint types without ranges applied.
/// * `ranges`: Tuples with (row index, r value) indicating where an extra range constraint should
/// be created.
///
/// # Return value
///
/// Extended constraint types. See the documentation of the `UnstructuredRange` for more.
Compute the constraint types by integrating bounds.
Compute the constraint types by integrating bounds .
fn compute_constraint_types<FI: Zero + PartialEq, FO: From<FI>>(
    rows: &[Row],
    ranges: Vec<SparseTuple<FI>>,
) -> Vec<RangedConstraintRelation<FO>> {
    // Sorted and unique
    debug_assert!(ranges.windows(2).all(|w| w[0].0 < w[1].0));
    debug_assert!(ranges.iter().all(|&(i, _)| i < rows.len()));
    let mut ranges = ranges.into_iter().peekable();
    rows.iter().enumerate()
        .map(|(i, row)| {
            if let Some((_, r)) = ranges.next_if(|&(ii, _)| ii == i) {
                if r == FI::zero() {
                    RangedConstraintRelation::Equal
                } else {
                    RangedConstraintRelation::Range(r.into())
                }
            } else {
                row.constraint_type.into()
            }
        })
        .collect()
}
fn compute_constraint_types < FI : Zero + PartialEq , FO : From < FI > > ( rows : & [ Row ] , ranges : Vec < SparseTuple < FI > > , ) -> Vec < RangedConstraintRelation < FO > > { // Sorted and unique debug_assert ! ( ranges windows ( 2 ) all ( w w [ 0 ] 0 w [ 1 ] 0 ) ) ; debug_assert ! ( ranges iter ( ) all ( ( i ) i rows len ( ) ) ) ; let mut ranges = ranges . into_iter ( ) . peekable ( ) ; rows . iter ( ) . enumerate ( ) . map ( | ( i , row ) | { if let Some ( ( _ , r ) ) = ranges . next_if ( | & ( ii , _ ) | ii == i ) { if r == FI :: zero ( ) { RangedConstraintRelation :: Equal } else { RangedConstraintRelation :: Range ( r . into ( ) ) } } else { row . constraint_type . into ( ) } } ) . collect ( ) }
Compute the constraint types by integrating bounds.
Compute the constraint types by integrating bounds .
rows
&[Row]
ranges
Vec<SparseTuple<FI>>
rows
&[Row]
ranges
Vec<SparseTuple<FI>>
return value
Extended constraint types. See the documentation of the `UnstructuredRange` for more.
Extended constraint types . See the documentation of the ` UnstructuredRange ` for more .