[−][src]Struct amcl_wrapper::univar_poly::UnivarPolynomial
Univariate polynomial represented with coefficients in a vector. The ith element of the vector is the coefficient of the ith degree term.
Implementations
impl UnivarPolynomial
[src]
pub fn new(degree: usize) -> Self
[src]
Return a zero polynomial of degree degree
pub fn new_constant(constant: FieldElement) -> Self
[src]
Return a constant polynomial
pub fn random(degree: usize) -> Self
[src]
Return a randomly chosen polynomial (each coefficient is randomly chosen) of degree degree
.
pub fn new_with_roots(roots: &[FieldElement]) -> Self
[src]
Create a polynomial with given roots in roots
i.e. (x-roots[0])(x-roots[1])(x-roots[2])...(x-roots[last]) given roots
pub fn coefficients(&self) -> &FieldElementVector
[src]
pub fn degree(&self) -> usize
[src]
pub fn is_zero(&self) -> bool
[src]
Polynomial is zero if all coefficients are 0
pub fn eval(&self, x: &FieldElement) -> FieldElement
[src]
pub fn long_division(dividend: &Self, divisor: &Self) -> (Self, Self)
[src]
Divides 2 polynomials i.e. dividend
/ divisor
using long division.
Returns (quotient, remainder)
pub fn multiply(left: &Self, right: &Self) -> Self
[src]
Return product of 2 polynomials. left
* right
pub fn sum(left: &Self, right: &Self) -> Self
[src]
Return sum of 2 polynomials. left
+ right
pub fn difference(left: &Self, right: &Self) -> Self
[src]
Return difference of 2 polynomials. left
- right
pub fn multiply_by_constant(&self, constant: &FieldElement) -> UnivarPolynomial
[src]
pub fn multiply_by_monic_monomial(
&self,
monomial_degree: u64
) -> UnivarPolynomial
[src]
&self,
monomial_degree: u64
) -> UnivarPolynomial
Trait Implementations
impl<'a, '_> Add<&'a UnivarPolynomial> for &'_ UnivarPolynomial
[src]
type Output = UnivarPolynomial
The resulting type after applying the +
operator.
fn add(self, other: &'a UnivarPolynomial) -> UnivarPolynomial
[src]
impl Clone for UnivarPolynomial
[src]
fn clone(&self) -> UnivarPolynomial
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for UnivarPolynomial
[src]
impl<'de> Deserialize<'de> for UnivarPolynomial
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Eq for UnivarPolynomial
[src]
impl Index<usize> for UnivarPolynomial
[src]
type Output = FieldElement
The returned type after indexing.
fn index(&self, idx: usize) -> &FieldElement
[src]
impl IndexMut<usize> for UnivarPolynomial
[src]
fn index_mut(&mut self, idx: usize) -> &mut FieldElement
[src]
impl<'a, '_> Mul<&'a UnivarPolynomial> for &'_ UnivarPolynomial
[src]
type Output = UnivarPolynomial
The resulting type after applying the *
operator.
fn mul(self, other: &'a UnivarPolynomial) -> UnivarPolynomial
[src]
impl PartialEq<UnivarPolynomial> for UnivarPolynomial
[src]
fn eq(&self, other: &UnivarPolynomial) -> bool
[src]
fn ne(&self, other: &UnivarPolynomial) -> bool
[src]
impl Serialize for UnivarPolynomial
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralPartialEq for UnivarPolynomial
[src]
impl<'a, '_> Sub<&'a UnivarPolynomial> for &'_ UnivarPolynomial
[src]
type Output = UnivarPolynomial
The resulting type after applying the -
operator.
fn sub(self, other: &'a UnivarPolynomial) -> UnivarPolynomial
[src]
Auto Trait Implementations
impl RefUnwindSafe for UnivarPolynomial
impl Send for UnivarPolynomial
impl Sync for UnivarPolynomial
impl Unpin for UnivarPolynomial
impl UnwindSafe for UnivarPolynomial
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,