1 | |
---|
2 | /**************************************************************************\ |
---|
3 | |
---|
4 | MODULE: vec_ZZ |
---|
5 | |
---|
6 | SUMMARY: |
---|
7 | |
---|
8 | Defines the class vec_ZZ. |
---|
9 | |
---|
10 | \**************************************************************************/ |
---|
11 | |
---|
12 | NTL_vector_decl(ZZ,vec_ZZ) |
---|
13 | |
---|
14 | NTL_eq_vector_decl(ZZ,vec_ZZ) |
---|
15 | // == and != |
---|
16 | |
---|
17 | NTL_io_vector_decl(ZZ,vec_ZZ) |
---|
18 | // I/O operators |
---|
19 | |
---|
20 | void mul(vec_ZZ& x, const vec_ZZ& a, const ZZ& b); |
---|
21 | void mul(vec_ZZ& x, const vec_ZZ& a, long b); |
---|
22 | |
---|
23 | void mul(vec_ZZ& x, const ZZ& a, const vec_ZZ& b); |
---|
24 | void mul(vec_ZZ& x, long a, const vec_ZZ& b); |
---|
25 | // x = a * b |
---|
26 | |
---|
27 | void add(vec_ZZ& x, const vec_ZZ& a, const vec_ZZ& b); |
---|
28 | // x = a + b |
---|
29 | |
---|
30 | void sub(vec_ZZ& x, const vec_ZZ& a, const vec_ZZ& b); |
---|
31 | // x = a - b |
---|
32 | |
---|
33 | void clear(vec_ZZ& x); |
---|
34 | // x = 0 (length unchanged) |
---|
35 | |
---|
36 | void negate(vec_ZZ& x, const vec_ZZ& a); |
---|
37 | // x = -a |
---|
38 | |
---|
39 | long IsZero(const vec_ZZ& a); |
---|
40 | // test if a is the zero vector |
---|
41 | |
---|
42 | void InnerProduct(ZZ& x, const vec_ZZ& a, const vec_ZZ& b); |
---|
43 | // x = inner product of a and b, padded with zeros to make the lengths |
---|
44 | // even. |
---|
45 | |
---|
46 | void VectorCopy(vec_ZZ& x, const vec_ZZ& a, long n); |
---|
47 | vec_ZZ VectorCopy(const vec_ZZ& a, long n); |
---|
48 | // x = a copy of a of length exactly n. |
---|
49 | // The input is truncated or padded with zeroes, as necessary. |
---|
50 | |
---|
51 | |
---|
52 | // operator notation: |
---|
53 | |
---|
54 | vec_ZZ operator+(const vec_ZZ& a, const vec_ZZ& b); |
---|
55 | vec_ZZ operator-(const vec_ZZ& a, const vec_ZZ& b); |
---|
56 | |
---|
57 | vec_ZZ operator-(const vec_ZZ& a); |
---|
58 | |
---|
59 | |
---|
60 | // vector/scalar multiplication: |
---|
61 | |
---|
62 | vec_ZZ operator*(const vec_ZZ& a, const ZZ& b); |
---|
63 | vec_ZZ operator*(const vec_ZZ& a, long b); |
---|
64 | |
---|
65 | vec_ZZ operator*(const ZZ& a, const vec_ZZ& b); |
---|
66 | vec_ZZ operator*(long a, const vec_ZZ& b); |
---|
67 | |
---|
68 | // inner product: |
---|
69 | |
---|
70 | ZZ operator*(const vec_ZZ& a, const vec_ZZ& b); |
---|
71 | |
---|
72 | |
---|
73 | |
---|
74 | // assignment operator notation: |
---|
75 | |
---|
76 | vec_ZZ& operator+=(vec_ZZ& x, const vec_ZZ& a); |
---|
77 | vec_ZZ& operator-=(vec_ZZ& x, const vec_ZZ& a); |
---|
78 | |
---|
79 | vec_ZZ& operator*=(vec_ZZ& x, const ZZ& a); |
---|
80 | vec_ZZ& operator*=(vec_ZZ& x, long a); |
---|
81 | |
---|
82 | |
---|