Struct sp1_core::air::Polynomial

source ·
pub struct Polynomial<T> { /* private fields */ }
Expand description

A polynomial represented as a vector of coefficients.

Implementations§

source§

impl<T> Polynomial<T>

source

pub const fn new(coefficients: Vec<T>) -> Self

Create a new polynomial from a vector of coefficients.

source

pub fn from_coefficients(coefficients: &[T]) -> Self
where T: Clone,

Create a new polynomial from a slice of coefficients.

source

pub fn as_coefficients(self) -> Vec<T>

Gets the coefficients of the polynomial.

source

pub fn coefficients(&self) -> &[T]

Gets the coefficients of the polynomial.

source

pub fn degree(&self) -> usize

Gets the degree of the polynomial.

source

pub fn eval<S: AbstractExtensionField<T>>(&self, x: S) -> S
where T: AbstractField,

Evaluates the polynomial at a given point.

source

pub fn root_quotient(&self, r: T) -> Self
where T: Field,

Computes the root quotient of the polynomial.

source§

impl Polynomial<u8>

source

pub fn as_field<F: Field>(self) -> Polynomial<F>

Trait Implementations§

source§

impl<T: Add<Output = T> + Clone> Add<&Polynomial<T>> for Polynomial<T>

§

type Output = Polynomial<T>

The resulting type after applying the + operator.
source§

fn add(self, other: &Polynomial<T>) -> Polynomial<T>

Performs the + operation. Read more
source§

impl<T: Mul<Output = T> + Add<Output = T> + Add + Clone> Add<T> for &Polynomial<T>

§

type Output = Polynomial<T>

The resulting type after applying the + operator.
source§

fn add(self, other: T) -> Polynomial<T>

Performs the + operation. Read more
source§

impl<T: Mul<Output = T> + Add<Output = T> + AddAssign + Clone> Add<T> for Polynomial<T>

§

type Output = Polynomial<T>

The resulting type after applying the + operator.
source§

fn add(self, other: T) -> Polynomial<T>

Performs the + operation. Read more
source§

impl<T: Add<Output = T> + Clone> Add for &Polynomial<T>

§

type Output = Polynomial<T>

The resulting type after applying the + operator.
source§

fn add(self, other: Self) -> Polynomial<T>

Performs the + operation. Read more
source§

impl<T: Add<Output = T> + Clone> Add for Polynomial<T>

§

type Output = Polynomial<T>

The resulting type after applying the + operator.
source§

fn add(self, other: Self) -> Self

Performs the + operation. Read more
source§

impl<T: Clone> Clone for Polynomial<T>

source§

fn clone(&self) -> Polynomial<T>

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<T: Debug> Debug for Polynomial<T>

source§

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

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

impl<'a, Var: Into<Expr> + Clone, Expr: Clone> From<Iter<'a, Var>> for Polynomial<Expr>

source§

fn from(value: Iter<'a, Var>) -> Self

Converts to this type from the input type.
source§

impl<Var: Into<Expr> + Clone, N: ArrayLength, Expr: Clone> From<Limbs<Var, N>> for Polynomial<Expr>

source§

fn from(value: Limbs<Var, N>) -> Self

Converts to this type from the input type.
source§

impl<T: Debug + Default + Clone, N: ArrayLength> From<Polynomial<T>> for Limbs<T, N>

source§

fn from(value: Polynomial<T>) -> Self

Converts to this type from the input type.
source§

impl<T> FromIterator<T> for Polynomial<T>

source§

fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self

Creates a value from an iterator. Read more
source§

impl<T: AbstractField> Mul<T> for &Polynomial<T>

§

type Output = Polynomial<T>

The resulting type after applying the * operator.
source§

fn mul(self, other: T) -> Polynomial<T>

Performs the * operation. Read more
source§

impl<T: AbstractField> Mul<T> for Polynomial<T>

§

type Output = Polynomial<T>

The resulting type after applying the * operator.
source§

fn mul(self, other: T) -> Self

Performs the * operation. Read more
source§

impl<T: AbstractField> Mul for &Polynomial<T>

§

type Output = Polynomial<T>

The resulting type after applying the * operator.
source§

fn mul(self, other: Self) -> Polynomial<T>

Performs the * operation. Read more
source§

impl<T: AbstractField> Mul for Polynomial<T>

§

type Output = Polynomial<T>

The resulting type after applying the * operator.
source§

fn mul(self, other: Self) -> Self

Performs the * operation. Read more
source§

impl<T: Neg<Output = T>> Neg for Polynomial<T>

§

type Output = Polynomial<T>

The resulting type after applying the - operator.
source§

fn neg(self) -> Self

Performs the unary - operation. Read more
source§

impl<T: Eq + AbstractField> PartialEq for Polynomial<T>

source§

fn eq(&self, other: &Polynomial<T>) -> 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<T: Sub<Output = T> + Neg<Output = T> + Clone> Sub<&Polynomial<T>> for Polynomial<T>

§

type Output = Polynomial<T>

The resulting type after applying the - operator.
source§

fn sub(self, other: &Polynomial<T>) -> Polynomial<T>

Performs the - operation. Read more
source§

impl<T: Sub<Output = T> + Neg<Output = T> + Clone> Sub for &Polynomial<T>

§

type Output = Polynomial<T>

The resulting type after applying the - operator.
source§

fn sub(self, other: Self) -> Polynomial<T>

Performs the - operation. Read more
source§

impl<T: Sub<Output = T> + Neg<Output = T> + Clone> Sub for Polynomial<T>

§

type Output = Polynomial<T>

The resulting type after applying the - operator.
source§

fn sub(self, other: Self) -> Self

Performs the - operation. Read more

Auto Trait Implementations§

§

impl<T> Freeze for Polynomial<T>

§

impl<T> RefUnwindSafe for Polynomial<T>
where T: RefUnwindSafe,

§

impl<T> Send for Polynomial<T>
where T: Send,

§

impl<T> Sync for Polynomial<T>
where T: Sync,

§

impl<T> Unpin for Polynomial<T>
where T: Unpin,

§

impl<T> UnwindSafe for Polynomial<T>
where T: UnwindSafe,

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§

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

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

impl<T> Downcast for T
where T: Any,

source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

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<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where 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 T
where 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 T
where 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.
source§

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

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> JsonSchemaMaybe for T