pub struct Alphas<F> { /* private fields */ }
Expand description
This type can be used to create a mapping between powers of alpha and constraint types. See Self::default to create one, and Self::register to register a new mapping. Once you know the alpha value, you can convert this type to a Alphas.
Implementations§
source§impl<F: Field> Alphas<F>
impl<F: Field> Alphas<F>
sourcepub fn register(&mut self, ty: ArgumentType, powers: u32)
pub fn register(&mut self, ty: ArgumentType, powers: u32)
Registers a new ArgumentType,
associating it with a number powers
of powers of alpha.
This function will panic if you register the same type twice.
sourcepub fn get_exponents(
&self,
ty: ArgumentType,
num: u32
) -> MustConsumeIterator<Range<u32>, u32> ⓘ
pub fn get_exponents( &self, ty: ArgumentType, num: u32 ) -> MustConsumeIterator<Range<u32>, u32> ⓘ
Returns a range of exponents, for a given ArgumentType, upperbounded by num
.
Note that this function will panic if you did not register enough powers of alpha.
sourcepub fn instantiate(&mut self, alpha: F)
pub fn instantiate(&mut self, alpha: F)
Instantiates the ranges with an actual field element alpha
.
Once you call this function, you cannot register new constraints via Self::register.
sourcepub fn get_alphas(
&self,
ty: ArgumentType,
num: u32
) -> MustConsumeIterator<Cloned<Take<Skip<Iter<'_, F>>>>, F> ⓘ
pub fn get_alphas( &self, ty: ArgumentType, num: u32 ) -> MustConsumeIterator<Cloned<Take<Skip<Iter<'_, F>>>>, F> ⓘ
This function allows us to retrieve the powers of alpha, upperbounded by num