pub fn commit_T(
    &self,
    gens: &R1CSGens<G>,
    U1: &RelaxedR1CSInstance<G>,
    W1: &RelaxedR1CSWitness<G>,
    U2: &R1CSInstance<G>,
    W2: &R1CSWitness<G>,
  ) -> Result<(Vec<G::Scalar>, Commitment<G>), NovaError> {
    let (AZ_1, BZ_1, CZ_1) = {
      let Z1 = concat(vec![W1.W.clone(), vec![U1.u], U1.X.clone()]);
      self.multiply_vec(&Z1)?
    };

    let (AZ_2, BZ_2, CZ_2) = {
      let Z2 = concat(vec![W2.W.clone(), vec![G::Scalar::one()], U2.X.clone()]);
      self.multiply_vec(&Z2)?
    };

    let AZ_1_circ_BZ_2 = (0..AZ_1.len())
      .map(|i| AZ_1[i] * BZ_2[i])
      .collect::<Vec<G::Scalar>>();
    let AZ_2_circ_BZ_1 = (0..AZ_2.len())
      .map(|i| AZ_2[i] * BZ_1[i])
      .collect::<Vec<G::Scalar>>();
    let u_1_cdot_CZ_2 = (0..CZ_2.len())
      .map(|i| U1.u * CZ_2[i])
      .collect::<Vec<G::Scalar>>();
    let u_2_cdot_CZ_1 = (0..CZ_1.len()).map(|i| CZ_1[i]).collect::<Vec<G::Scalar>>();

    let T = AZ_1_circ_BZ_2
      .par_iter()
      .zip(&AZ_2_circ_BZ_1)
      .zip(&u_1_cdot_CZ_2)
      .zip(&u_2_cdot_CZ_1)
      .map(|(((a, b), c), d)| *a + *b - *c - *d)
      .collect::<Vec<G::Scalar>>();

    let comm_T = T.commit(&gens.gens_E);

    Ok((T, comm_T))
  }
/// A method to compute a commitment to the cross-term `T` given a
/// Relaxed R1CS instance-witness pair and an R1CS instance-witness pair
A method to compute a commitment to the cross-term `T` given a
Relaxed R1CS instance-witness pair and an R1CS instance-witness pair
A method to compute a commitment to the cross - term ` T ` given a Relaxed R1CS instance - witness pair and an R1CS instance - witness pair
pub fn commit_T(
    &self,
    gens: &R1CSGens<G>,
    U1: &RelaxedR1CSInstance<G>,
    W1: &RelaxedR1CSWitness<G>,
    U2: &R1CSInstance<G>,
    W2: &R1CSWitness<G>,
  ) -> Result<(Vec<G::Scalar>, Commitment<G>), NovaError> {
    let (AZ_1, BZ_1, CZ_1) = {
      let Z1 = concat(vec![W1.W.clone(), vec![U1.u], U1.X.clone()]);
      self.multiply_vec(&Z1)?
    };
    let (AZ_2, BZ_2, CZ_2) = {
      let Z2 = concat(vec![W2.W.clone(), vec![G::Scalar::one()], U2.X.clone()]);
      self.multiply_vec(&Z2)?
    };
    let AZ_1_circ_BZ_2 = (0..AZ_1.len())
      .map(|i| AZ_1[i] * BZ_2[i])
      .collect::<Vec<G::Scalar>>();
    let AZ_2_circ_BZ_1 = (0..AZ_2.len())
      .map(|i| AZ_2[i] * BZ_1[i])
      .collect::<Vec<G::Scalar>>();
    let u_1_cdot_CZ_2 = (0..CZ_2.len())
      .map(|i| U1.u * CZ_2[i])
      .collect::<Vec<G::Scalar>>();
    let u_2_cdot_CZ_1 = (0..CZ_1.len()).map(|i| CZ_1[i]).collect::<Vec<G::Scalar>>();
    let T = AZ_1_circ_BZ_2
      .par_iter()
      .zip(&AZ_2_circ_BZ_1)
      .zip(&u_1_cdot_CZ_2)
      .zip(&u_2_cdot_CZ_1)
      .map(|(((a, b), c), d)| *a + *b - *c - *d)
      .collect::<Vec<G::Scalar>>();
    let comm_T = T.commit(&gens.gens_E);
    Ok((T, comm_T))
  }
pub fn commit_T ( & self , gens : & R1CSGens < G > , U1 : & RelaxedR1CSInstance < G > , W1 : & RelaxedR1CSWitness < G > , U2 : & R1CSInstance < G > , W2 : & R1CSWitness < G > , ) -> Result < ( Vec < G :: Scalar > , Commitment < G > ) , NovaError > { let ( AZ_1 , BZ_1 , CZ_1 ) = { let Z1 = concat ( vec ! [ W1 W clone ( ) vec [ U1 u ] U1 X clone ( ) ] ) ; self . multiply_vec ( & Z1 ) ? } ; let ( AZ_2 , BZ_2 , CZ_2 ) = { let Z2 = concat ( vec ! [ W2 W clone ( ) vec [ G Scalar one ( ) ] U2 X clone ( ) ] ) ; self . multiply_vec ( & Z2 ) ? } ; let AZ_1_circ_BZ_2 = ( 0 .. AZ_1 . len ( ) ) . map ( | i | AZ_1 [ i ] * BZ_2 [ i ] ) . collect :: < Vec < G :: Scalar > > ( ) ; let AZ_2_circ_BZ_1 = ( 0 .. AZ_2 . len ( ) ) . map ( | i | AZ_2 [ i ] * BZ_1 [ i ] ) . collect :: < Vec < G :: Scalar > > ( ) ; let u_1_cdot_CZ_2 = ( 0 .. CZ_2 . len ( ) ) . map ( | i | U1 . u * CZ_2 [ i ] ) . collect :: < Vec < G :: Scalar > > ( ) ; let u_2_cdot_CZ_1 = ( 0 .. CZ_1 . len ( ) ) . map ( | i | CZ_1 [ i ] ) . collect :: < Vec < G :: Scalar > > ( ) ; let T = AZ_1_circ_BZ_2 . par_iter ( ) . zip ( & AZ_2_circ_BZ_1 ) . zip ( & u_1_cdot_CZ_2 ) . zip ( & u_2_cdot_CZ_1 ) . map ( | ( ( ( a , b ) , c ) , d ) | * a + * b - * c - * d ) . collect :: < Vec < G :: Scalar > > ( ) ; let comm_T = T . commit ( & gens . gens_E ) ; Ok ( ( T , comm_T ) ) }
A method to compute a commitment to the cross-term `T` given a
Relaxed R1CS instance-witness pair and an R1CS instance-witness pair
A method to compute a commitment to the cross - term ` T ` given a Relaxed R1CS instance - witness pair and an R1CS instance - witness pair
&self
gens
&R1CSGens<G>
U1
&RelaxedR1CSInstance<G>
W1
&RelaxedR1CSWitness<G>
U2
&R1CSInstance<G>
W2
&R1CSWitness<G>
&self
gens
&R1CSGens<G>
U1
&RelaxedR1CSInstance<G>
W1
&RelaxedR1CSWitness<G>
U2
&R1CSInstance<G>
W2
&R1CSWitness<G>