Struct snarkvm_algorithms::polycommit::sonic_pc::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
sourceimpl<F: Field> LabeledPolynomial<F>
impl<F: Field> LabeledPolynomial<F>
sourcepub fn new(
label: PolynomialLabel,
polynomial: impl Into<Polynomial<'static, F>>,
degree_bound: Option<usize>,
hiding_bound: Option<usize>
) -> Self
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
.
pub fn info(&self) -> &PolynomialInfo
sourcepub fn polynomial(&self) -> &Polynomial<'_, F>
pub fn polynomial(&self) -> &Polynomial<'_, F>
Retrieve the polynomial from self
.
sourcepub fn polynomial_mut(&mut self) -> &mut Polynomial<'static, F>
pub fn polynomial_mut(&mut self) -> &mut Polynomial<'static, F>
Retrieve a mutable reference to the enclosed polynomial.
sourcepub fn degree_bound(&self) -> Option<usize>
pub fn degree_bound(&self) -> Option<usize>
Retrieve the degree bound in self
.
sourcepub fn hiding_bound(&self) -> Option<usize>
pub fn hiding_bound(&self) -> Option<usize>
Retrieve the hiding bound for the polynomial in self
.
Methods from Deref<Target = Polynomial<'static, F>>
pub fn leading_coefficient(&self) -> Option<&F>
pub fn as_dense(&self) -> Option<&DensePolynomial<F>>
pub fn to_dense(&self) -> Cow<'_, DensePolynomial<F>>
pub fn as_sparse(&self) -> Option<&SparsePolynomial<F>>
pub fn into_dense(&self) -> DensePolynomial<F>
pub fn evaluate(&self, point: F) -> F
pub fn coeffs(&'a self) -> Box<dyn Iterator<Item = (usize, &'a F)> + 'a>
sourcepub fn divide_with_q_and_r(
&self,
divisor: &Self
) -> Option<(DensePolynomial<F>, DensePolynomial<F>)>
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
sourceimpl<F: Field> CanonicalDeserialize for LabeledPolynomial<F>
impl<F: Field> CanonicalDeserialize for LabeledPolynomial<F>
fn deserialize_with_mode<R: Read>(
reader: R,
compress: Compress,
validate: Validate
) -> Result<Self, SerializationError>
fn deserialize_compressed<R>(reader: R) -> Result<Self, SerializationError>where
R: Read,
fn deserialize_compressed_unchecked<R>(
reader: R
) -> Result<Self, SerializationError>where
R: Read,
fn deserialize_uncompressed<R>(reader: R) -> Result<Self, SerializationError>where
R: Read,
fn deserialize_uncompressed_unchecked<R>(
reader: R
) -> Result<Self, SerializationError>where
R: Read,
sourceimpl<F: Field> CanonicalSerialize for LabeledPolynomial<F>
impl<F: Field> CanonicalSerialize for LabeledPolynomial<F>
fn serialize_with_mode<W: Write>(
&self,
writer: W,
compress: Compress
) -> Result<(), SerializationError>
fn serialized_size(&self, compress: Compress) -> usize
fn serialize_compressed<W>(&self, writer: W) -> Result<(), SerializationError>where
W: Write,
fn compressed_size(&self) -> usize
fn serialize_uncompressed<W>(&self, writer: W) -> Result<(), SerializationError>where
W: Write,
fn uncompressed_size(&self) -> usize
sourceimpl<F: Clone + Field> Clone for LabeledPolynomial<F>
impl<F: Clone + Field> Clone for LabeledPolynomial<F>
sourcefn clone(&self) -> LabeledPolynomial<F>
fn clone(&self) -> LabeledPolynomial<F>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl<F: Debug + Field> Debug for LabeledPolynomial<F>
impl<F: Debug + Field> Debug for LabeledPolynomial<F>
sourceimpl<F: Field> Deref for LabeledPolynomial<F>
impl<F: Field> Deref for LabeledPolynomial<F>
type Target = Polynomial<'static, F>
type Target = Polynomial<'static, F>
The resulting type after dereferencing.
sourceimpl<'a, F: PrimeField> From<&'a LabeledPolynomial<F>> for LabeledPolynomialWithBasis<'a, F>
impl<'a, F: PrimeField> From<&'a LabeledPolynomial<F>> for LabeledPolynomialWithBasis<'a, F>
sourcefn from(other: &'a LabeledPolynomial<F>) -> Self
fn from(other: &'a LabeledPolynomial<F>) -> Self
Converts to this type from the input type.
sourceimpl<'a, F: PrimeField> From<LabeledPolynomial<F>> for LabeledPolynomialWithBasis<'a, F>
impl<'a, F: PrimeField> From<LabeledPolynomial<F>> for LabeledPolynomialWithBasis<'a, F>
sourcefn from(other: LabeledPolynomial<F>) -> Self
fn from(other: LabeledPolynomial<F>) -> Self
Converts to this type from the input type.
sourceimpl<F: PartialEq + Field> PartialEq<LabeledPolynomial<F>> for LabeledPolynomial<F>
impl<F: PartialEq + Field> PartialEq<LabeledPolynomial<F>> for LabeledPolynomial<F>
sourcefn eq(&self, other: &LabeledPolynomial<F>) -> bool
fn eq(&self, other: &LabeledPolynomial<F>) -> bool
sourceimpl<F: Field> Valid for LabeledPolynomial<F>
impl<F: Field> Valid for LabeledPolynomial<F>
fn check(&self) -> Result<(), SerializationError>
fn batch_check<'a>(
batch: impl Iterator<Item = &'a Self> + Send
) -> Result<(), SerializationError>where
Self: 'a,
impl<F: Eq + Field> Eq for LabeledPolynomial<F>
impl<F: Field> StructuralEq for LabeledPolynomial<F>
impl<F: Field> StructuralPartialEq for LabeledPolynomial<F>
Auto Trait Implementations
impl<F> RefUnwindSafe for LabeledPolynomial<F>where
F: RefUnwindSafe,
impl<F> Send for LabeledPolynomial<F>
impl<F> Sync for LabeledPolynomial<F>
impl<F> Unpin for LabeledPolynomial<F>where
F: Unpin,
impl<F> UnwindSafe for LabeledPolynomial<F>where
F: UnwindSafe + RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.