@@ -77,7 +77,7 @@ impl<F: Field> FFTree<F> {
77
77
f[ n..] . copy_from_slice ( & leaves) ;
78
78
79
79
// generate internal nodes
80
- // TODO: use array_windows_mut
80
+ // TODO: would be cool to use array_windows_mut
81
81
let mut f_layers = f. get_layers_mut ( ) ;
82
82
for ( i, rational_map) in rational_maps. iter ( ) . enumerate ( ) {
83
83
let ( prev_layer, layer) = {
@@ -95,16 +95,6 @@ impl<F: Field> FFTree<F> {
95
95
Self :: from_tree ( f, rational_maps)
96
96
}
97
97
98
- /// Decomposes evaluation table <P(X) ≀ S> into <P_0(X) ≀ T> and
99
- /// <P_1(X) ≀ T> where T = ψ(S), ψ(X) = u(X)/v(X) and
100
- /// P(s) = (P_0(ψ(s)) + s * P_1(ψ(s))) * v(s)^(d/2 - 1)
101
- // pub fn decompose(&self, evals: &[F], moiety: Moiety) -> (Vec<F>, Vec<F>) {}
102
-
103
- // /// Recombines evaluation tables <P_0(X) ≀ T> and <P_1(X) ≀ T> to produce
104
- // /// <P(X) ≀ S> where ψ(X) = u(X)/v(X), T = ψ(S) and
105
- // /// P(s) = (P_0(ψ(s)) + s * P_1(ψ(s)) * v(s)^(d/2 - 1)
106
- // fn recombine(&self) -> (Vec<F>, Vec<F>) {}
107
-
108
98
fn extend_impl ( & self , evals : & [ F ] , moiety : Moiety ) -> Vec < F > {
109
99
let n = evals. len ( ) ;
110
100
if n == 1 {
@@ -195,6 +185,7 @@ impl<F: Field> FFTree<F> {
195
185
. collect ( )
196
186
}
197
187
188
+ /// Converts from coefficient to evaluation representation of a polynomial
198
189
pub fn enter ( & self , coeffs : & [ F ] ) -> Vec < F > {
199
190
let tree = self . subtree_with_size ( coeffs. len ( ) ) ;
200
191
tree. enter_impl ( coeffs)
@@ -216,7 +207,7 @@ impl<F: Field> FFTree<F> {
216
207
return subtree. degree_impl ( & e0) ;
217
208
}
218
209
219
- // compute <(π-g)/Z_0 ≀ S1>
210
+ // compute ` <(π-g)/Z_0 ≀ S1>`
220
211
// isolate the evaluations of the coefficients on the RHS
221
212
let t1: Vec < F > = zip ( zip ( e1, g1) , & self . z0_inv_s1 )
222
213
. map ( |( ( e1, g1) , z0_inv) | ( e1 - g1) * z0_inv)
@@ -225,7 +216,7 @@ impl<F: Field> FFTree<F> {
225
216
n / 2 + subtree. degree_impl ( & t0)
226
217
}
227
218
228
- /// Evaluates the degree of an evaluation table in O(n log n)
219
+ /// Evaluates the degree of an evaluation table in ` O(n log n)`
229
220
pub fn degree ( & self , evals : & [ F ] ) -> usize {
230
221
let tree = self . subtree_with_size ( evals. len ( ) ) ;
231
222
tree. degree_impl ( evals)
@@ -257,6 +248,7 @@ impl<F: Field> FFTree<F> {
257
248
a
258
249
}
259
250
251
+ /// Converts from evaluation to coefficient representation of a polynomial
260
252
pub fn exit ( & self , evals : & [ F ] ) -> Vec < F > {
261
253
let tree = self . subtree_with_size ( evals. len ( ) ) ;
262
254
tree. exit_impl ( evals)
@@ -282,7 +274,7 @@ impl<F: Field> FFTree<F> {
282
274
Moiety :: S1 => & self . z1_inv_s0 ,
283
275
} ;
284
276
285
- // compute <(π - a*g)/Z ≀ S'>
277
+ // compute ` <(π - a*g)/Z ≀ S'>`
286
278
let h1: Vec < F > = zip ( zip ( e1, g1) , zip ( a1, z_inv) )
287
279
. map ( |( ( e1, g1) , ( a1, z0_inv) ) | ( e1 - g1 * a1) * z0_inv)
288
280
. collect ( ) ;
@@ -293,15 +285,15 @@ impl<F: Field> FFTree<F> {
293
285
294
286
/// Computes <P(X)*Z_0(x)^(-1) mod a ≀ S>
295
287
/// Z_0 is the vanishing polynomial of S_0
296
- /// `a` must be a polynomial of degree at most n/2 having no zeroes in S_0
288
+ /// `a` must be a polynomial of max degree ` n/2` having no zeroes in ` S_0`
297
289
pub fn redc_z0 ( & self , evals : & [ F ] , a : & [ F ] ) -> Vec < F > {
298
290
let tree = self . subtree_with_size ( evals. len ( ) ) ;
299
291
tree. redc_impl ( evals, a, Moiety :: S0 )
300
292
}
301
293
302
- /// Computes <P(X)*Z_1(x)^(-1) mod A ≀ S>
303
- /// Z_1 is the vanishing polynomial of S_1
304
- /// `A` must be a polynomial of degree at most n/2 having no zeroes in S_1
294
+ /// Computes ` <P(X)*Z_1(x)^(-1) mod A ≀ S>`
295
+ /// ` Z_1` is the vanishing polynomial of ` S_1`
296
+ /// `A` must be a polynomial of max degree ` n/2` having no zeroes in ` S_1`
305
297
pub fn redc_z1 ( & self , evals : & [ F ] , a : & [ F ] ) -> Vec < F > {
306
298
let tree = self . subtree_with_size ( evals. len ( ) ) ;
307
299
tree. redc_impl ( evals, a, Moiety :: S1 )
@@ -314,8 +306,8 @@ impl<F: Field> FFTree<F> {
314
306
}
315
307
316
308
/// Computes MOD algorithm
317
- /// `a` must be a polynomial of degree at most n/2 having no zeroes in S_0
318
- /// `c` must be the evaluation table <Z_0^2 mod a ≀ S>
309
+ /// `a` must be a polynomial of max degree ` n/2` having no zeroes in ` S_0`
310
+ /// `c` must be the evaluation table ` <Z_0^2 mod a ≀ S>`
319
311
pub fn modular_reduce ( & self , evals : & [ F ] , a : & [ F ] , c : & [ F ] ) -> Vec < F > {
320
312
let tree = self . subtree_with_size ( evals. len ( ) ) ;
321
313
tree. modular_reduce_impl ( evals, a, c)
@@ -340,8 +332,8 @@ impl<F: Field> FFTree<F> {
340
332
. collect ( )
341
333
}
342
334
343
- /// Returns an evaluation of the vanishing polynomial Z(x) = ∏ (x - a_i)
344
- /// Runtime O(n log^2 n). `vanishi_domain = [a_0, a_1, ..., a_(n - 1)]`
335
+ /// Returns an evaluation of the vanishing polynomial ` Z(x) = ∏ (x - a_i)`
336
+ /// Runtime ` O(n log^2 n)` . `vanishi_domain = [a_0, a_1, ..., a_(n - 1)]`
345
337
/// Section 7.1 https://arxiv.org/pdf/2107.08473.pdf
346
338
pub fn vanish ( & self , vanish_domain : & [ F ] ) -> Vec < F > {
347
339
let tree = self . subtree_with_size ( vanish_domain. len ( ) * 2 ) ;
0 commit comments