pub fn conditionally_select<CS: ConstraintSystem<Fp>>(
    mut cs: CS,
    a: &Self,
    b: &Self,
    condition: &Boolean,
  ) -> Result<Self, SynthesisError> {
    let x = conditionally_select(cs.namespace(|| "select x"), &a.x, &b.x, condition)?;

    let y = conditionally_select(cs.namespace(|| "select y"), &a.y, &b.y, condition)?;

    let is_infinity = conditionally_select(
      cs.namespace(|| "select is_infinity"),
      &a.is_infinity,
      &b.is_infinity,
      condition,
    )?;

    Ok(Self { x, y, is_infinity })
  }
/// If condition outputs a otherwise outputs b
If condition outputs a otherwise outputs b
If condition outputs a otherwise outputs b
pub fn conditionally_select<CS: ConstraintSystem<Fp>>(
    mut cs: CS,
    a: &Self,
    b: &Self,
    condition: &Boolean,
  ) -> Result<Self, SynthesisError> {
    let x = conditionally_select(cs.namespace(|| "select x"), &a.x, &b.x, condition)?;
    let y = conditionally_select(cs.namespace(|| "select y"), &a.y, &b.y, condition)?;
    let is_infinity = conditionally_select(
      cs.namespace(|| "select is_infinity"),
      &a.is_infinity,
      &b.is_infinity,
      condition,
    )?;
    Ok(Self { x, y, is_infinity })
  }
pub fn conditionally_select < CS : ConstraintSystem < Fp > > ( mut cs : CS , a : & Self , b : & Self , condition : & Boolean , ) -> Result < Self , SynthesisError > { let x = conditionally_select ( cs . namespace ( | | " " ) , & a . x , & b . x , condition ) ? ; let y = conditionally_select ( cs . namespace ( | | " " ) , & a . y , & b . y , condition ) ? ; let is_infinity = conditionally_select ( cs . namespace ( | | " " ) , & a . is_infinity , & b . is_infinity , condition , ) ? ; Ok ( Self { x , y , is_infinity } ) }
If condition outputs a otherwise outputs b
If condition outputs a otherwise outputs b
cs
CS
a
&Self
b
&Self
condition
&Boolean
cs
CS
a
&Self
b
&Self
condition
&Boolean