Skip to content

Commit 3614c62

Browse files
authored
Merge pull request #3076 from o1-labs/dw/doc-mvpoly-monomials
mvpoly/monomials: additional doc with example
2 parents 3222167 + 9a138e9 commit 3614c62

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

mvpoly/src/monomials.rs

+10
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@ use std::{
1616
/// Represents a multivariate polynomial in `N` variables with coefficients in
1717
/// `F`. The polynomial is represented as a sparse polynomial, where each
1818
/// monomial is represented by a vector of `N` exponents.
19+
///
20+
/// For instance, the multivariate polynomial `3x^2 y + 2 x z` will be
21+
/// represented by the HashMap:
22+
/// ```text
23+
/// [2, 1, 0] -> 3
24+
/// | | |
25+
/// x y z
26+
/// | | |
27+
/// [1, 0, 1] -> 2
28+
/// ```
1929
// We could use u8 instead of usize for the exponents
2030
// FIXME: the maximum degree D is encoded in the type to match the type
2131
// prime::Dense

0 commit comments

Comments
 (0)