From b68be576152f7d7414a845fdd085fa29061b3cbe Mon Sep 17 00:00:00 2001 From: wborgeaud Date: Thu, 22 Jul 2021 13:33:57 +0200 Subject: [PATCH] Simplify interpolation test --- src/gates/interpolation.rs | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/src/gates/interpolation.rs b/src/gates/interpolation.rs index 17d34e3a..d51685e7 100644 --- a/src/gates/interpolation.rs +++ b/src/gates/interpolation.rs @@ -313,31 +313,15 @@ mod tests { points: Vec, eval_point: FF, ) -> Vec { - let mut v = vec![F::ZERO; num_points * 5 + (coeffs.len() + 3) * D]; + let mut v = Vec::new(); + v.extend_from_slice(&points); for j in 0..num_points { - v[j] = points[j]; - } - for j in 0..num_points { - for i in 0..D { - v[num_points + D * j + i] = >::to_basefield_array( - &coeffs.eval(points[j].into()), - )[i]; - } - } - for i in 0..D { - v[num_points * 5 + i] = - >::to_basefield_array(&eval_point)[i]; - } - for i in 0..D { - v[num_points * 5 + D + i] = - >::to_basefield_array(&coeffs.eval(eval_point))[i]; + v.extend(coeffs.eval(points[j].into()).0); } + v.extend(eval_point.0); + v.extend(coeffs.eval(eval_point).0); for i in 0..coeffs.len() { - for (j, input) in - (0..D).zip(num_points * 5 + (2 + i) * D..num_points * 5 + (3 + i) * D) - { - v[input] = >::to_basefield_array(&coeffs.coeffs[i])[j]; - } + v.extend(coeffs.coeffs[i].0); } v.iter().map(|&x| x.into()).collect::>() }