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

Add implement interpolate_domain function #20

Merged
merged 3 commits into from
Mar 21, 2024

Conversation

FimboIsso
Copy link
Contributor

Lagrange interpolation

Copy link
Contributor

@elielnfinic elielnfinic left a comment

Choose a reason for hiding this comment

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

Please apply changes

baby-stark/src/polynomial.rs Outdated Show resolved Hide resolved
assert_eq(domain.len() == values.len(),"number of elements in domain does not match number of values -- cannot interpolate");
assert(!domain.is_empty(),"cannot interpolate between zero points");
let field = domain[0].clone();
let mut x = Polynomial {coefficients : vec![filed.zero(), field.one()]};
Copy link
Contributor

Choose a reason for hiding this comment

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

filed : fix typo

assert(!domain.is_empty(),"cannot interpolate between zero points");
let field = domain[0].clone();
let mut x = Polynomial {coefficients : vec![filed.zero(), field.one()]};
let mut acc = Polynomial { coefficients : Vec::new() };
Copy link
Contributor

Choose a reason for hiding this comment

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

Mettre un Vec de FieldElement

let mut x = Polynomial {coefficients : vec![filed.zero(), field.one()]};
let mut acc = Polynomial { coefficients : Vec::new() };
for i in 0..domain.len(){
let mut prod = Polynomial {coefficients :vec![values[i].clone()]};
Copy link
Contributor

Choose a reason for hiding this comment

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

Not true

@elielnfinic elielnfinic merged commit dc7da4e into StarknetCongo:main Mar 21, 2024
1 check 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.

2 participants