Mle

Trait Mle 

Source
pub trait Mle<F: Field>:
    DynClone
    + Debug
    + Send
    + Sync {
Show 15 methods // Required methods fn num_free_vars(&self) -> usize; fn get_padded_evaluations(&self) -> Vec<F>; fn add_prefix_bits(&mut self, new_bits: Vec<MleIndex<F>>); fn layer_id(&self) -> LayerId; fn len(&self) -> usize; fn iter(&self) -> EvaluationsIterator<'_, F> ; fn first(&self) -> F; fn value(&self) -> F; fn get(&self, index: usize) -> Option<F>; fn mle_indices(&self) -> &[MleIndex<F>]; fn fix_variable( &mut self, round_index: usize, challenge: F, ) -> Option<RawClaim<F>>; fn fix_variable_at_index( &mut self, indexed_bit_index: usize, point: F, ) -> Option<RawClaim<F>>; fn index_mle_indices(&mut self, curr_index: usize) -> usize; fn get_enum(self) -> MleEnum<F>; // Provided method fn is_fully_bounded(&self) -> bool { ... }
}
Expand description

The trait that defines how a semantic Type (T) and a MultiLinearEvaluation containing field elements (F) interact. T should always be a composite type containing Fs. For example (F, F) or a struct containing Fs.

If you want to construct an Mle, or use an Mle for some non-cryptographic computation (e.g. wit gen) then you should always use the iterator adaptors IntoIterator and FromIterator, this is to ensure that the semantic ordering within T is always consistent.

Required Methods§

Source

fn num_free_vars(&self) -> usize

Returns the number of free variables this Mle is defined on. Equivalently, this is the log_2 of the size of the unpruned bookkeeping table.

Source

fn get_padded_evaluations(&self) -> Vec<F>

Get the padded set of evaluations over the boolean hypercube; useful for constructing the input layer.

Source

fn add_prefix_bits(&mut self, new_bits: Vec<MleIndex<F>>)

Mutates the MLE in order to set the prefix bits. This is needed when we are working with dataparallel circuits and new bits need to be added.

Source

fn layer_id(&self) -> LayerId

Get the layer ID of the associated MLE.

Source

fn len(&self) -> usize

Returns the length of the current bookkeeping table.

Source

fn iter(&self) -> EvaluationsIterator<'_, F>

Returns an iterator over the evaluations of the current MLE.

Source

fn first(&self) -> F

Returns the first element in the bookkeeping table corresponding to the value of this Dense MLE when all free variables are set to zero. This operations never panics (see evals::MultilinearExtension::first)

Source

fn value(&self) -> F

If this is a fully-bound Dense MLE, it returns its value. Otherwise panics.

Source

fn get(&self, index: usize) -> Option<F>

Returns the first element of the evaluations table (if any).

Source

fn mle_indices(&self) -> &[MleIndex<F>]

Get the indicies of the Mle that this MleRef represents.

Source

fn fix_variable( &mut self, round_index: usize, challenge: F, ) -> Option<RawClaim<F>>

Fix the variable at round_index at a given challenge point. Mutates self to be the bookeeping table for the new MLE.

If the new MLE becomes fully bound, returns the evaluation of the fully bound Mle.

Source

fn fix_variable_at_index( &mut self, indexed_bit_index: usize, point: F, ) -> Option<RawClaim<F>>

Fix the (indexed) free variable at indexed_bit_index with a given challenge point. Mutates `self`` to be the bookeeping table for the new MLE. If the new MLE becomes fully bound, returns the evaluation of the fully bound MLE in the form of a crate::claims::RawClaim.

§Panics

If indexed_bit_index does not correspond to a MleIndex::Indexed(indexed_bit_index) in mle_indices.

Source

fn index_mle_indices(&mut self, curr_index: usize) -> usize

Mutates the MleIndexes stored in self that are MleIndex::Free and turns them into MleIndex::Indexed with the bit index being determined from curr_index. Returns the (curr_index + number of IndexedBits now in the MleIndices).

Source

fn get_enum(self) -> MleEnum<F>

Get the associated enum that this MLE is a part of (MleEnum::Dense or MleEnum::Zero).

Provided Methods§

Source

fn is_fully_bounded(&self) -> bool

An MLE is fully bounded if it has no more free variables.

Implementors§

Source§

impl<F: Field> Mle<F> for MleEnum<F>

Source§

impl<F: Field> Mle<F> for DenseMle<F>

Source§

impl<F: Field> Mle<F> for ZeroMle<F>