Trait MultivariatePoly

Source
pub trait MultivariatePoly<P>:
    Debug
    + Send
    + Sync {
    // Required methods
    fn n_vars(&self) -> usize;
    fn degree(&self) -> usize;
    fn evaluate(&self, query: &[P]) -> Result<P, Error>;
    fn binary_tower_level(&self) -> usize;

    // Provided method
    fn erased_serialize(
        &self,
        write_buf: &mut dyn BufMut,
        mode: SerializationMode,
    ) -> Result<(), SerializationError> { ... }
}
Expand description

A multivariate polynomial over a binary tower field.

The definition MultivariatePoly is nearly identical to that of CompositionPoly, except that MultivariatePoly is object safe, whereas CompositionPoly is not.

Required Methods§

Source

fn n_vars(&self) -> usize

The number of variables.

Source

fn degree(&self) -> usize

Total degree of the polynomial.

Source

fn evaluate(&self, query: &[P]) -> Result<P, Error>

Evaluate the polynomial at a point in the extension field.

Source

fn binary_tower_level(&self) -> usize

Returns the maximum binary tower level of all constants in the arithmetic expression.

Provided Methods§

Source

fn erased_serialize( &self, write_buf: &mut dyn BufMut, mode: SerializationMode, ) -> Result<(), SerializationError>

Serialize a type erased MultivariatePoly. Since not every MultivariatePoly implements serialization, this defaults to returning an error.

Implementations§

Source§

impl<F: TowerField> dyn MultivariatePoly<F>

Source

pub const fn register_deserializer( name: &'static str, deserializer: fn(_: &mut dyn Buf, mode: SerializationMode) -> Result<Box<dyn MultivariatePoly<F>>, SerializationError>, ) -> DeserializerEntry<F>

Trait Implementations§

Implementors§