pub struct LabeledPolynomial<F: Field> {
    pub info: PolynomialInfo,
    pub polynomial: Polynomial<'static, F>,
}
Expand description

A polynomial along with information about its degree bound (if any), and the maximum number of queries that will be made to it. This latter number determines the amount of protection that will be provided to a commitment for this polynomial.

Fields§

§info: PolynomialInfo§polynomial: Polynomial<'static, F>

Implementations§

source§

impl<F: Field> LabeledPolynomial<F>

source

pub fn new( label: PolynomialLabel, polynomial: impl Into<Polynomial<'static, F>>, degree_bound: Option<usize>, hiding_bound: Option<usize> ) -> Self

Construct a new labeled polynomial by consuming polynomial.

source

pub fn info(&self) -> &PolynomialInfo

source

pub fn label(&self) -> &str

Return the label for self.

source

pub fn polynomial(&self) -> &Polynomial<'_, F>

Retrieve the polynomial from self.

source

pub fn polynomial_mut(&mut self) -> &mut Polynomial<'static, F>

Retrieve a mutable reference to the enclosed polynomial.

source

pub fn evaluate(&self, point: F) -> F

Evaluate the polynomial in self.

source

pub fn degree_bound(&self) -> Option<usize>

Retrieve the degree bound in self.

source

pub fn is_hiding(&self) -> bool

Retrieve whether the polynomial in self should be hidden.

source

pub fn hiding_bound(&self) -> Option<usize>

Retrieve the hiding bound for the polynomial in self.

Methods from Deref<Target = Polynomial<'static, F>>§

source

pub fn is_zero(&self) -> bool

Checks if the given polynomial is zero.

source

pub fn degree(&self) -> usize

Return the degree of `self.

source

pub fn leading_coefficient(&self) -> Option<&F>

source

pub fn as_dense(&self) -> Option<&DensePolynomial<F>>

source

pub fn to_dense(&self) -> Cow<'_, DensePolynomial<F>>

source

pub fn as_sparse(&self) -> Option<&SparsePolynomial<F>>

source

pub fn into_dense(&self) -> DensePolynomial<F>

source

pub fn evaluate(&self, point: F) -> F

source

pub fn coeffs(&'a self) -> Box<dyn Iterator<Item = (usize, &'a F)> + 'a>

source

pub fn divide_with_q_and_r( &self, divisor: &Self ) -> Option<(DensePolynomial<F>, DensePolynomial<F>)>

Divide self by another (sparse or dense) polynomial, and returns the quotient and remainder.

Trait Implementations§

source§

impl<F: Field> CanonicalDeserialize for LabeledPolynomial<F>

source§

impl<F: Field> CanonicalSerialize for LabeledPolynomial<F>

source§

impl<F: Clone + Field> Clone for LabeledPolynomial<F>

source§

fn clone(&self) -> LabeledPolynomial<F>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<F: Debug + Field> Debug for LabeledPolynomial<F>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<F: Field> Deref for LabeledPolynomial<F>

§

type Target = Polynomial<'static, F>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<'a, F: PrimeField> From<&'a LabeledPolynomial<F>> for LabeledPolynomialWithBasis<'a, F>

source§

fn from(other: &'a LabeledPolynomial<F>) -> Self

Converts to this type from the input type.
source§

impl<'a, F: PrimeField> From<LabeledPolynomial<F>> for LabeledPolynomialWithBasis<'a, F>

source§

fn from(other: LabeledPolynomial<F>) -> Self

Converts to this type from the input type.
source§

impl<F: PartialEq + Field> PartialEq<LabeledPolynomial<F>> for LabeledPolynomial<F>

source§

fn eq(&self, other: &LabeledPolynomial<F>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<F: Field> Valid for LabeledPolynomial<F>

source§

fn check(&self) -> Result<(), SerializationError>

source§

fn batch_check<'a>( batch: impl Iterator<Item = &'a Self> + Send ) -> Result<(), SerializationError>where Self: 'a,

source§

impl<F: Eq + Field> Eq for LabeledPolynomial<F>

source§

impl<F: Field> StructuralEq for LabeledPolynomial<F>

source§

impl<F: Field> StructuralPartialEq for LabeledPolynomial<F>

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V