Skip to content

Commit

Permalink
If the poly has 1 evaluation, we should fix the window=1 (arkworks-rs…
Browse files Browse the repository at this point in the history
  • Loading branch information
mmagician authored Nov 3, 2023
1 parent 3082750 commit 27d0c52
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions poly/src/evaluations/multivariate/multilinear/sparse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,16 @@ impl<F: Field> MultilinearExtension<F> for SparseMultilinearExtension<F> {
let dim = partial_point.len();
assert!(dim <= self.num_vars, "invalid partial point dimension");

let window = ark_std::log2(self.evaluations.len()) as usize;
let mut window = ark_std::log2(self.evaluations.len()) as usize;
if window == 0 {
window = 1;
}
let mut point = partial_point;
let mut last = treemap_to_hashmap(&self.evaluations);

// batch evaluation
while !point.is_empty() {
let focus_length = if window > 0 && point.len() > window {
let focus_length = if point.len() > window {
window
} else {
point.len()
Expand Down

0 comments on commit 27d0c52

Please sign in to comment.