pub struct MPolynomial<T: PrimeField> {
    pub variable_count: usize,
    pub coefficients: HashMap<Vec<u64>, T>,
}

Fields

variable_count: usizecoefficients: HashMap<Vec<u64>, T>

Implementations

Returns an MPolynomial instance over variable_count variables that evaluates to element everywhere. I.e. P(x,y..,z) = element

Note that in this encoding P(x,y) == P(x,w) but P(x,y) != P(x,y,z).

Returns a vector of multivariate polynomials that each represent a function of one indeterminate variable to the first power. For example, let p = variables(3, 1.into()) represents the functions

  • p[0] = $f(x,y,z) = x$
  • p[1] =$f(x,y,z) = y$
  • p[2] =$f(x,y,z) = z$

and let p = variables(5, 1.into()) represents the functions

  • p[0] = $p(a,b,c,d,e) = a$
  • p[1] = $p(a,b,c,d,e) = b$
  • p[2] = $p(a,b,c,d,e) = c$
  • p[3] = $p(a,b,c,d,e) = d$
  • p[4] = $p(a,b,c,d,e) = e$

Get a hash map with precalculated values for point[i]^j Only exponents 2 and above are stored.

Return the highest number present in the list of list of exponents For P(x,y) = x^4*y^3, 4 would be returned.

Calculate the “total degree” of a multivariate polynomial.

The total degree is defined as the highest combined degree of any term where the combined degree is the sum of all the term’s variable exponents.

As a convention, the polynomial f(x) = 0 has degree -1.

Removes exponents whose coefficients are 0.

During symbolic evaluation, i.e., when substituting a univariate polynomial for one of the variables, the total degree of the resulting polynomial can be upper bounded. This bound is the total_degree_bound, and can be calculated across all terms. Only the constant zero polynomial P(x,..) = 0 has a negative degree and it is always -1. All other constant polynomials have degree 0.

  • max_degrees: the max degrees for each of the univariate polynomials.
  • total_degree_bound: the max resulting degree from the substitution.

Trait Implementations

The resulting type after applying the + operator.

Performs the + operation. Read more

Performs the += operation. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

Performs the *= operation. Read more

The resulting type after applying the - operator.

Performs the unary - operation. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

The resulting type after applying the - operator.

Performs the - operation. Read more

Method which takes an iterator and generates Self from the elements by “summing up” the items. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

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

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.