snarkvm_algorithms::polycommit::sonic_pc

Struct LabeledPolynomial

Source
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: impl Into<PolynomialLabel>, polynomial: impl Into<Polynomial<'static, F>>, degree_bound: impl Into<Option<usize>>, hiding_bound: impl Into<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 to_label(&self) -> String

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, ) -> Result<(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§

fn deserialize_with_mode<R: Read>( reader: R, compress: Compress, validate: Validate, ) -> Result<Self, SerializationError>

Source§

fn deserialize_compressed<R>(reader: R) -> Result<Self, SerializationError>
where R: Read,

Source§

fn deserialize_compressed_unchecked<R>( reader: R, ) -> Result<Self, SerializationError>
where R: Read,

Source§

fn deserialize_uncompressed<R>(reader: R) -> Result<Self, SerializationError>
where R: Read,

Source§

fn deserialize_uncompressed_unchecked<R>( reader: R, ) -> Result<Self, SerializationError>
where R: Read,

Source§

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

Source§

fn serialize_with_mode<W: Write>( &self, writer: W, compress: Compress, ) -> Result<(), SerializationError>

Source§

fn serialized_size(&self, compress: Compress) -> usize

Source§

fn serialize_compressed<W>(&self, writer: W) -> Result<(), SerializationError>
where W: Write,

Source§

fn compressed_size(&self) -> usize

Source§

fn serialize_uncompressed<W>(&self, writer: W) -> Result<(), SerializationError>
where W: Write,

Source§

fn uncompressed_size(&self) -> usize

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>

Source§

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 for LabeledPolynomial<F>

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

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> StructuralPartialEq for LabeledPolynomial<F>

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where 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
Source§

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

Source§

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 T
where 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.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize = _

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

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

Initializes a with the given initializer. Read more
Source§

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

Dereferences the given pointer. Read more
Source§

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

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

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

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.
Source§

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

Source§

fn vzip(self) -> V