pub fn fold(
    &self,
    W2: &R1CSWitness<G>,
    T: &[G::Scalar],
    r: &G::Scalar,
  ) -> Result<RelaxedR1CSWitness<G>, NovaError> {
    let (W1, E1) = (&self.W, &self.E);
    let W2 = &W2.W;

    if W1.len() != W2.len() {
      return Err(NovaError::InvalidWitnessLength);
    }

    let W = W1
      .par_iter()
      .zip(W2)
      .map(|(a, b)| *a + *r * *b)
      .collect::<Vec<G::Scalar>>();
    let E = E1
      .par_iter()
      .zip(T)
      .map(|(a, b)| *a + *r * *b)
      .collect::<Vec<G::Scalar>>();
    Ok(RelaxedR1CSWitness { W, E })
  }
/// Folds an incoming R1CSWitness into the current one
Folds an incoming R1CSWitness into the current one
Folds an incoming R1CSWitness into the current one
pub fn fold(
    &self,
    W2: &R1CSWitness<G>,
    T: &[G::Scalar],
    r: &G::Scalar,
  ) -> Result<RelaxedR1CSWitness<G>, NovaError> {
    let (W1, E1) = (&self.W, &self.E);
    let W2 = &W2.W;
    if W1.len() != W2.len() {
      return Err(NovaError::InvalidWitnessLength);
    }
    let W = W1
      .par_iter()
      .zip(W2)
      .map(|(a, b)| *a + *r * *b)
      .collect::<Vec<G::Scalar>>();
    let E = E1
      .par_iter()
      .zip(T)
      .map(|(a, b)| *a + *r * *b)
      .collect::<Vec<G::Scalar>>();
    Ok(RelaxedR1CSWitness { W, E })
  }
pub fn fold ( & self , W2 : & R1CSWitness < G > , T : & [ G :: Scalar ] , r : & G :: Scalar , ) -> Result < RelaxedR1CSWitness < G > , NovaError > { let ( W1 , E1 ) = ( & self . W , & self . E ) ; let W2 = & W2 . W ; if W1 . len ( ) != W2 . len ( ) { return Err ( NovaError :: InvalidWitnessLength ) ; } let W = W1 . par_iter ( ) . zip ( W2 ) . map ( | ( a , b ) | * a + * r * * b ) . collect :: < Vec < G :: Scalar > > ( ) ; let E = E1 . par_iter ( ) . zip ( T ) . map ( | ( a , b ) | * a + * r * * b ) . collect :: < Vec < G :: Scalar > > ( ) ; Ok ( RelaxedR1CSWitness { W , E } ) }
Folds an incoming R1CSWitness into the current one
Folds an incoming R1CSWitness into the current one
&self
W2
&R1CSWitness<G>
T
&[G::Scalar]
r
&G::Scalar
&self
W2
&R1CSWitness<G>
T
&[G::Scalar]
r
&G::Scalar