-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest_bivariate.cpp
More file actions
82 lines (45 loc) · 1.32 KB
/
Copy pathtest_bivariate.cpp
File metadata and controls
82 lines (45 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#include "bivariate_lin_seq.h"
#include <NTL/BasicThreadPool.h>
#include <NTL/lzz_pX.h>
NTL_CLIENT
int main(){
// set this to be the prime you want to work over
zz_p::init(13);
SetNumThreads(4);
// D should be less than the char of the field due to interpolation
long D = 8000;
// this are "bivariate" polynomials
Vec<Vec<long>> num;
Vec<Vec<long>> den;
Vec<long> tmp;
/**** NUMERATOR ********************************/
// encode num: 1-x
tmp.append(1); tmp.append(-1);
num.append(tmp);
tmp = Vec<long>();
/**** DENOMINATOR *******************************/
// encode den: (1+x)^2 + (-x)y + y^2
// (1+x)^2
tmp.append(1); tmp.append(2); tmp.append(1);
den.append(tmp);
tmp = Vec<long>();
// (-x)
tmp.append(0); tmp.append(-1);
den.append(tmp);
tmp = Vec<long>();
// 1
tmp.append(1);
den.append(tmp);
cout << "num: " << num << endl;
cout << "den: " << den << endl;
// this creates the object
bivariate_lin_seq bls{num,den,2,2};
long a = 5;
long b = 5;
long L = 1;
cout << "a: " << a << endl;
cout << "b: " << b << endl;
cout << "L: " << L << endl;
Vec<ZZ> enZZ, edZZ;
bls.get_entry_sq_ZZ(enZZ,edZZ,a,b,L,10,3);
}