pub fn alloc<CS: ConstraintSystem<<G as Group>::Base>>(
    mut cs: CS,
    u: Option<R1CSInstance<G>>,
  ) -> Result<Self, SynthesisError> {
    // Check that the incoming instance has exactly 2 io
    let W = AllocatedPoint::alloc(
      cs.namespace(|| "allocate W"),
      u.get()
        .map_or(None, |u| Some(u.comm_W.comm.to_coordinates())),
    )?;

    let X0 = alloc_scalar_as_base::<G, _>(
      cs.namespace(|| "allocate X[0]"),
      u.get().map_or(None, |u| Some(u.X[0])),
    )?;
    let X1 = alloc_scalar_as_base::<G, _>(
      cs.namespace(|| "allocate X[1]"),
      u.get().map_or(None, |u| Some(u.X[1])),
    )?;

    Ok(AllocatedR1CSInstance { W, X0, X1 })
  }
/// Takes the r1cs instance and creates a new allocated r1cs instance
Takes the r1cs instance and creates a new allocated r1cs instance
Takes the r1cs instance and creates a new allocated r1cs instance
pub fn alloc<CS: ConstraintSystem<<G as Group>::Base>>(
    mut cs: CS,
    u: Option<R1CSInstance<G>>,
  ) -> Result<Self, SynthesisError> {
    // Check that the incoming instance has exactly 2 io
    let W = AllocatedPoint::alloc(
      cs.namespace(|| "allocate W"),
      u.get()
        .map_or(None, |u| Some(u.comm_W.comm.to_coordinates())),
    )?;
    let X0 = alloc_scalar_as_base::<G, _>(
      cs.namespace(|| "allocate X[0]"),
      u.get().map_or(None, |u| Some(u.X[0])),
    )?;
    let X1 = alloc_scalar_as_base::<G, _>(
      cs.namespace(|| "allocate X[1]"),
      u.get().map_or(None, |u| Some(u.X[1])),
    )?;
    Ok(AllocatedR1CSInstance { W, X0, X1 })
  }
pub fn alloc < CS : ConstraintSystem < < G as Group > :: Base > > ( mut cs : CS , u : Option < R1CSInstance < G > > , ) -> Result < Self , SynthesisError > { // Check that the incoming instance has exactly 2 io let W = AllocatedPoint :: alloc ( cs . namespace ( | | " " ) , u . get ( ) . map_or ( None , | u | Some ( u . comm_W . comm . to_coordinates ( ) ) ) , ) ? ; let X0 = alloc_scalar_as_base :: < G , _ > ( cs . namespace ( | | " " ) , u . get ( ) . map_or ( None , | u | Some ( u . X [ 0 ] ) ) , ) ? ; let X1 = alloc_scalar_as_base :: < G , _ > ( cs . namespace ( | | " " ) , u . get ( ) . map_or ( None , | u | Some ( u . X [ 1 ] ) ) , ) ? ; Ok ( AllocatedR1CSInstance { W , X0 , X1 } ) }
Takes the r1cs instance and creates a new allocated r1cs instance
Takes the r1cs instance and creates a new allocated r1cs instance
cs
CS
u
Option<R1CSInstance<G>>
cs
CS
u
Option<R1CSInstance<G>>