Let us walk on the 3-isogeny graph
Loading...
Searching...
No Matches
poly.h
Go to the documentation of this file.
1#ifndef POLY_H
2#define POLY_H
3
4#if defined AVX2
5 #include "../common/fp/avx2/fp-avx2.h"
6#elif defined GMP
8#elif defined KARATSUBA
10#else
11 #include "../common/fp/mulx/fp.h"
12#endif
13#include "../common/namespace.h"
14
15#define poly_mul COMMON(poly_mul)
16void poly_mul(fp *c,const fp *a,long long alen,const fp *b,long long blen);
17
18#define poly_mul_low COMMON(poly_mul_low)
19/* assumes !alen or !blen or clen <= alen+blen-1 */
20void poly_mul_low(fp *c,long long clen,const fp *a,long long alen,const fp *b,long long blen);
21
22#define poly_mul_high COMMON(poly_mul_high)
23/* assumes !alen or !blen or cstart <= alen+blen-1 */
24void poly_mul_high(fp *c,long long cstart,const fp *a,long long alen,const fp *b,long long blen);
25
26#define poly_mul_mid COMMON(poly_mul_mid)
27/* assumes !alen or !blen or: 0 <= cstart; 0 <= clen; cstart+clen <= alen+blen-1 */
28void poly_mul_mid(fp *c,long long cstart,long long clen,const fp *a,long long alen,const fp *b,long long blen);
29
30#define poly_mul_selfreciprocal COMMON(poly_mul_selfreciprocal)
31/* input (and output) polynomials are self-reciprocal */
32void poly_mul_selfreciprocal(fp *c,const fp *a,long long alen,const fp *b,long long blen);
33
34/* input: T[0...3n-1] has n 3-coeff polys */
35/* output: T[0...2n] has 1 (2n+1)-coeff poly */
36/* namely the product of the original polys */
37#define poly_multiprod2 COMMON(poly_multiprod2)
38void poly_multiprod2(fp *T,long long n);
39
40#define poly_multiprod2_selfreciprocal COMMON(poly_multiprod2_selfreciprocal)
41/* poly_multiprod2 with polys guaranteed to be self-reciprocal */
42void poly_multiprod2_selfreciprocal(fp *T,long long n);
43
44/* XXX: should integrate this into multieval_precompute */
45/* input: P[0...2n-1] has n 2-coeff polys */
46/* output: number of coeffs in product tree (minus n) */
47/* tree itself (without P) is stored in T */
48/* for n>=2, product is stored in final n+1 coeffs of T */
49#define poly_tree1 COMMON(poly_tree1)
50long long poly_tree1(fp *T,const fp *P,long long n);
51
52#define poly_tree1size COMMON(poly_tree1size)
53long long poly_tree1size(long long n);
54
55/* input: polynomial f with flen>0 coeffs */
56/* output: n scaled values v[0],...,v[n-1] of f */
57/* evaluation points: roots of the n 2-coeff polys in P */
58/* another input: T from poly_tree1 */
59/* scaling: v[i] is value multiplied by a function of (P,i) */
60/* namely a product of powers of leading coefficients from P */
61#define poly_multieval COMMON(poly_multieval)
62void poly_multieval(fp *v,long long n,const fp *f,long long flen,const fp *P,const fp *T);
63
64#define poly_multieval_precompute COMMON(poly_multieval_precompute)
65void poly_multieval_precompute(fp *precomp,long long n,long long flen,const fp *P,const fp *T);
66
67#define poly_multieval_precomputesize COMMON(poly_multieval_precomputesize)
68long long poly_multieval_precomputesize(long long n,long long flen);
69
70#define poly_multieval_postcompute COMMON(poly_multieval_postcompute)
71void poly_multieval_postcompute(fp *v,long long n,const fp *f,long long flen,const fp *P,const fp *T,const fp *precomp);
72
73#endif
uint64_t fp[NUMBER_OF_WORDS]
Definition fp-gmp.h:22
#define poly_mul_high
Definition poly.h:22
#define poly_multieval
Definition poly.h:61
#define poly_multieval_postcompute
Definition poly.h:70
#define poly_tree1
Definition poly.h:49
#define poly_mul
Definition poly.h:15
#define poly_mul_selfreciprocal
Definition poly.h:30
#define poly_multiprod2_selfreciprocal
Definition poly.h:40
#define poly_tree1size
Definition poly.h:52
#define poly_multieval_precomputesize
Definition poly.h:67
#define poly_mul_mid
Definition poly.h:26
#define poly_multiprod2
Definition poly.h:37
#define poly_mul_low
Definition poly.h:18
#define poly_multieval_precompute
Definition poly.h:64
f a
Definition to_model.m:12