Evaluation of polynomial without creating the polynomial as the variable is already known. Returns `(updates[0]-x)*(updates[1]-x)*(updates[2]-x)*...(updates[n]-x)`
(updates: &[F], x: &F)
| 100 | /// Evaluation of polynomial without creating the polynomial as the variable is already known. |
| 101 | /// Returns `(updates[0]-x)*(updates[1]-x)*(updates[2]-x)*...(updates[n]-x)` |
| 102 | pub fn eval_direct(updates: &[F], x: &F) -> F { |
| 103 | updates.iter().fold(F::one(), |a, y| (*y - *x) * a) |
| 104 | // TODO: Figure out the why the following line is about 5 times slower than the sequential one above |
| 105 | // cfg_iter!(updates).map(|y| *y - *x).product() |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | impl<F> Poly_v_A<F> |