-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvec_ZZ.txt
77 lines (44 loc) · 1.75 KB
/
vec_ZZ.txt
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/**************************************************************************\
MODULE: vec_ZZ
SUMMARY:
Defines the class vec_ZZ.
\**************************************************************************/
typedef Vec<ZZ> vec_ZZ; // backward compatibility
void mul(vec_ZZ& x, const vec_ZZ& a, const ZZ& b);
void mul(vec_ZZ& x, const vec_ZZ& a, long b);
void mul(vec_ZZ& x, const ZZ& a, const vec_ZZ& b);
void mul(vec_ZZ& x, long a, const vec_ZZ& b);
// x = a * b
void add(vec_ZZ& x, const vec_ZZ& a, const vec_ZZ& b);
// x = a + b
void sub(vec_ZZ& x, const vec_ZZ& a, const vec_ZZ& b);
// x = a - b
void clear(vec_ZZ& x);
// x = 0 (length unchanged)
void negate(vec_ZZ& x, const vec_ZZ& a);
// x = -a
long IsZero(const vec_ZZ& a);
// test if a is the zero vector
void InnerProduct(ZZ& x, const vec_ZZ& a, const vec_ZZ& b);
// x = inner product of a and b, padded with zeros to make the lengths
// even.
void VectorCopy(vec_ZZ& x, const vec_ZZ& a, long n);
vec_ZZ VectorCopy(const vec_ZZ& a, long n);
// x = a copy of a of length exactly n.
// The input is truncated or padded with zeroes, as necessary.
// operator notation:
vec_ZZ operator+(const vec_ZZ& a, const vec_ZZ& b);
vec_ZZ operator-(const vec_ZZ& a, const vec_ZZ& b);
vec_ZZ operator-(const vec_ZZ& a);
// vector/scalar multiplication:
vec_ZZ operator*(const vec_ZZ& a, const ZZ& b);
vec_ZZ operator*(const vec_ZZ& a, long b);
vec_ZZ operator*(const ZZ& a, const vec_ZZ& b);
vec_ZZ operator*(long a, const vec_ZZ& b);
// inner product:
ZZ operator*(const vec_ZZ& a, const vec_ZZ& b);
// assignment operator notation:
vec_ZZ& operator+=(vec_ZZ& x, const vec_ZZ& a);
vec_ZZ& operator-=(vec_ZZ& x, const vec_ZZ& a);
vec_ZZ& operator*=(vec_ZZ& x, const ZZ& a);
vec_ZZ& operator*=(vec_ZZ& x, long a);