Skip to content

Commit

Permalink
feat: added fn drop_next_variable in SplitEqPoly
Browse files Browse the repository at this point in the history
  • Loading branch information
shreyas-londhe committed Jan 23, 2025
1 parent b8d6f0a commit a79c2d0
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions jolt-core/src/poly/split_eq_poly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,21 @@ impl<F: JoltField> SplitEqPolynomial<F> {
DensePolynomial::new(merged)
}
}

/// Drop the first variable from E1 or E2 table for Gruen's optimization
/// Before n/2: E1⁽ⁱ⁺¹⁾[x'] = eq(w[i+2:n/2], x')
/// After n/2: E2⁽ⁱ⁺¹⁾[x'] = eq(w[i+2:n], x')
pub fn drop_next_variable(&mut self) {
if self.E1_len > 1 {
// Still in first phase (before n/2)
self.E1 = EqPolynomial::evals(&self.E1[1..self.E1_len]);
self.E1_len -= 1;
} else {
// In second phase (after n/2)
self.E2 = EqPolynomial::evals(&self.E2[1..self.E2_len]);
self.E2_len -= 1;
}
}
}

#[cfg(test)]
Expand Down

0 comments on commit a79c2d0

Please sign in to comment.