pub fn evaluate_constraints<CS: ConstraintSystem<F>>(&self, 
        mut cs: CS,
        x: &FG) -> Result<FG, SynthesisError>
        where FG: FieldGadget<F, F>
    {
        let mut p_cs = &mut cs.ns(|| "polynomial eval");
        let mut res = FG::zero(&mut p_cs)?;
        let mut cur_pow_x = FG::one(&mut p_cs)?;
        for i in 0..self.coeffs.len()
        {
            let term = cur_pow_x.mul(p_cs.ns(|| format!("c[i] * x^{:?}", i)), &self.coeffs[i])?;
            res.add_in_place(&mut p_cs, &term);

            cur_pow_x = cur_pow_x.mul(p_cs.ns(|| format!("x^{:?}", i)), x)?;
        }
        Ok(res)
    }
/// Evaluates the constraints and just gives you the gadget for the result.
/// Caution for use in holographic lincheck: The output has 2 entries in one matrix
Evaluates the constraints and just gives you the gadget for the result.
Caution for use in holographic lincheck: The output has 2 entries in one matrix
Evaluates the constraints and just gives you the gadget for the result . Caution for use in holographic lincheck : The output has 2 entries in one matrix
pub fn evaluate_constraints<CS: ConstraintSystem<F>>(&self, 
        mut cs: CS,
        x: &FG) -> Result<FG, SynthesisError>
        where FG: FieldGadget<F, F>
    {
        let mut p_cs = &mut cs.ns(|| "polynomial eval");
        let mut res = FG::zero(&mut p_cs)?;
        let mut cur_pow_x = FG::one(&mut p_cs)?;
        for i in 0..self.coeffs.len()
        {
            let term = cur_pow_x.mul(p_cs.ns(|| format!("c[i] * x^{:?}", i)), &self.coeffs[i])?;
            res.add_in_place(&mut p_cs, &term);
            cur_pow_x = cur_pow_x.mul(p_cs.ns(|| format!("x^{:?}", i)), x)?;
        }
        Ok(res)
    }
pub fn evaluate_constraints < CS : ConstraintSystem < F > > ( & self , mut cs : CS , x : & FG ) -> Result < FG , SynthesisError > where FG : FieldGadget < F , F > { let mut p_cs = & mut cs . ns ( | | " " ) ; let mut res = FG :: zero ( & mut p_cs ) ? ; let mut cur_pow_x = FG :: one ( & mut p_cs ) ? ; for i in 0 .. self . coeffs . len ( ) { let term = cur_pow_x . mul ( p_cs . ns ( | | format ! ( " " i ) ) , & self . coeffs [ i ] ) ? ; res . add_in_place ( & mut p_cs , & term ) ; cur_pow_x = cur_pow_x . mul ( p_cs . ns ( | | format ! ( " " i ) ) , x ) ? ; } Ok ( res ) }
Evaluates the constraints and just gives you the gadget for the result.
Evaluates the constraints and just gives you the gadget for the result .
&self
cs
CS
x
&FG