Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat(poly): Add Dense and Sparse Multilinear Polynomials #726

Merged
merged 21 commits into from
Jan 23, 2024

Conversation

PatStiles
Copy link
Collaborator

Dense Multilinear Polynomial

Description

Extends the polyomial module by adding a Dense representation of a multilinear polynomial in lagrange basis.

Type of change

Please delete options that are not relevant.

  • New feature

Checklist

  • Unit tests added
  • Add benchmarks

@PatStiles PatStiles requested review from schouhy, ajgara and a team as code owners December 20, 2023 16:25
@PatStiles PatStiles changed the title Fea(poly): Dense multilinear polynomial Feat(poly): Dense multilinear polynomial Dec 20, 2023
@PatStiles PatStiles changed the title Feat(poly): Dense multilinear polynomial Feat(poly): Add Dense and Sparse Multilieaner Polynomails Dec 23, 2023
@PatStiles PatStiles changed the title Feat(poly): Add Dense and Sparse Multilieaner Polynomails Feat(poly): Add Dense and Sparse Multilinear Polynomials Dec 23, 2023
@PatStiles PatStiles force-pushed the feat/multilinear_poly branch 2 times, most recently from 0cbce62 to 9c7c4a2 Compare January 10, 2024 00:26
@codecov-commenter
Copy link

codecov-commenter commented Jan 10, 2024

Codecov Report

Attention: 34 lines in your changes are missing coverage. Please review.

Comparison is base (1acc827) 95.36% compared to head (fff25f4) 95.31%.

Files Patch % Lines
math/src/polynomial/dense_multilinear_poly.rs 89.61% 27 Missing ⚠️
math/src/polynomial/error.rs 0.00% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #726      +/-   ##
==========================================
- Coverage   95.36%   95.31%   -0.06%     
==========================================
  Files         140      143       +3     
  Lines       31393    31753     +360     
==========================================
+ Hits        29938    30264     +326     
- Misses       1455     1489      +34     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

diegokingston
diegokingston previously approved these changes Jan 11, 2024
}

/// Evaluates `self` at the point `p` in O(n) time.
#[allow(dead_code)]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Allow dead code in a public function shouldn't be needed

math/src/polynomial/dense_multilinear_poly.rs Outdated Show resolved Hide resolved
Comment on lines 113 to 107
//TODO; remove asserts
pub fn extend(&mut self, other: &DenseMultilinearPolynomial<F>) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add docs with ///

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add panic section

assert_eq!(self.evals.len(), self.len);
}

pub fn merge(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add docs with ///

MauroToscano
MauroToscano previously approved these changes Jan 18, 2024
diegokingston
diegokingston previously approved these changes Jan 22, 2024
MauroToscano
MauroToscano previously approved these changes Jan 23, 2024
math/src/polynomial/dense_multilinear_poly.rs Outdated Show resolved Hide resolved
math/src/polynomial/dense_multilinear_poly.rs Outdated Show resolved Hide resolved
MauroToscano
MauroToscano previously approved these changes Jan 23, 2024
diegokingston
diegokingston previously approved these changes Jan 23, 2024
}
}

fn get_bits(n: usize, num_bits: usize) -> Vec<bool> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to have some docs about this function

entropidelic
entropidelic previously approved these changes Jan 23, 2024
@entropidelic entropidelic added this pull request to the merge queue Jan 23, 2024
Merged via the queue into lambdaclass:main with commit 87915f0 Jan 23, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants