Skip to content

Commit

Permalink
Implementing evaluate domain #11
Browse files Browse the repository at this point in the history
  • Loading branch information
elielnfinic committed Mar 20, 2024
1 parent 5cc35e4 commit d08a5d3
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion baby-stark/src/polynomial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use baby_stark_math_lib::linear_multiiplication::vector_scalar_multiplication;
use core::num;
use std::cmp::max;

use crate::field::{self, vector_multiplication_field_scalar, FieldElement};
use crate::field::{self, vector_multiplication_field_scalar, Field, FieldElement};

pub fn multi_poly_and_scalar(poly : Polynomial, scalar : i128) -> Polynomial{
Polynomial{
Expand Down Expand Up @@ -190,4 +190,16 @@ impl Polynomial {
}
return value;
}

pub fn evaluate_domain(self, domain : Vec<FieldElement>) -> Vec<FieldElement>{
let mut res_field_elts : Vec<FieldElement> = vec![];

for element in domain.iter() {
res_field_elts.push(self.evaluate(&element));
}

res_field_elts
}


}

0 comments on commit d08a5d3

Please sign in to comment.