pub trait Term:
Clone
+ PartialOrd
+ Ord
+ PartialEq
+ Eq
+ Hash
+ Default
+ Debug
+ Deref<Target = [(usize, usize)]>
+ Send
+ Sync
+ CanonicalSerialize
+ CanonicalDeserialize {
// Required methods
fn new(term: Vec<(usize, usize)>) -> Self;
fn degree(&self) -> usize;
fn vars(&self) -> Vec<usize>;
fn powers(&self) -> Vec<usize>;
fn is_constant(&self) -> bool;
fn evaluate<F: Field>(&self, p: &[F]) -> F;
}
Expand description
Describes the interface for a term (monomial) of a multivariate polynomial.
Required Methods§
Sourcefn new(term: Vec<(usize, usize)>) -> Self
fn new(term: Vec<(usize, usize)>) -> Self
Create a new Term
from a list of tuples of the form (variable, power)
Sourcefn degree(&self) -> usize
fn degree(&self) -> usize
Returns the total degree of self
. This is the sum of all variable
powers in self
Sourcefn is_constant(&self) -> bool
fn is_constant(&self) -> bool
Returns whether self
is a constant
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.