1 | |
---|
2 | #ifndef NTL_vec_ZZ_pE__H |
---|
3 | #define NTL_vec_ZZ_pE__H |
---|
4 | |
---|
5 | #include <NTL/ZZ_pE.h> |
---|
6 | |
---|
7 | NTL_OPEN_NNS |
---|
8 | |
---|
9 | |
---|
10 | NTL_vector_decl(ZZ_pE,vec_ZZ_pE) |
---|
11 | |
---|
12 | NTL_io_vector_decl(ZZ_pE,vec_ZZ_pE) |
---|
13 | |
---|
14 | NTL_eq_vector_decl(ZZ_pE,vec_ZZ_pE) |
---|
15 | |
---|
16 | void mul(vec_ZZ_pE& x, const vec_ZZ_pE& a, const ZZ_pE& b); |
---|
17 | inline void mul(vec_ZZ_pE& x, const ZZ_pE& a, const vec_ZZ_pE& b) |
---|
18 | { mul(x, b, a); } |
---|
19 | |
---|
20 | void mul(vec_ZZ_pE& x, const vec_ZZ_pE& a, const ZZ_p& b); |
---|
21 | inline void mul(vec_ZZ_pE& x, const ZZ_p& a, const vec_ZZ_pE& b) |
---|
22 | { mul(x, b, a); } |
---|
23 | |
---|
24 | void mul(vec_ZZ_pE& x, const vec_ZZ_pE& a, long b); |
---|
25 | inline void mul(vec_ZZ_pE& x, long a, const vec_ZZ_pE& b) |
---|
26 | { mul(x, b, a); } |
---|
27 | |
---|
28 | void add(vec_ZZ_pE& x, const vec_ZZ_pE& a, const vec_ZZ_pE& b); |
---|
29 | void sub(vec_ZZ_pE& x, const vec_ZZ_pE& a, const vec_ZZ_pE& b); |
---|
30 | |
---|
31 | void negate(vec_ZZ_pE& x, const vec_ZZ_pE& a); |
---|
32 | |
---|
33 | void clear(vec_ZZ_pE& x); |
---|
34 | |
---|
35 | |
---|
36 | void InnerProduct(ZZ_pE& x, const vec_ZZ_pE& a, const vec_ZZ_pE& b); |
---|
37 | void InnerProduct(ZZ_pE& x, const vec_ZZ_pE& a, const vec_ZZ_pE& b, |
---|
38 | long offset); |
---|
39 | |
---|
40 | |
---|
41 | long IsZero(const vec_ZZ_pE& a); |
---|
42 | |
---|
43 | void VectorCopy(vec_ZZ_pE& x, const vec_ZZ_pE& a, long n); |
---|
44 | inline vec_ZZ_pE VectorCopy(const vec_ZZ_pE& a, long n) |
---|
45 | { vec_ZZ_pE x; VectorCopy(x, a, n); NTL_OPT_RETURN(vec_ZZ_pE, x); } |
---|
46 | |
---|
47 | |
---|
48 | |
---|
49 | vec_ZZ_pE operator+(const vec_ZZ_pE& a, const vec_ZZ_pE& b); |
---|
50 | vec_ZZ_pE operator-(const vec_ZZ_pE& a, const vec_ZZ_pE& b); |
---|
51 | vec_ZZ_pE operator-(const vec_ZZ_pE& a); |
---|
52 | |
---|
53 | inline vec_ZZ_pE operator*(const vec_ZZ_pE& a, const ZZ_pE& b) |
---|
54 | { vec_ZZ_pE x; mul(x, a, b); NTL_OPT_RETURN(vec_ZZ_pE, x); } |
---|
55 | |
---|
56 | inline vec_ZZ_pE operator*(const vec_ZZ_pE& a, const ZZ_p& b) |
---|
57 | { vec_ZZ_pE x; mul(x, a, b); NTL_OPT_RETURN(vec_ZZ_pE, x); } |
---|
58 | |
---|
59 | inline vec_ZZ_pE operator*(const vec_ZZ_pE& a, long b) |
---|
60 | { vec_ZZ_pE x; mul(x, a, b); NTL_OPT_RETURN(vec_ZZ_pE, x); } |
---|
61 | |
---|
62 | inline vec_ZZ_pE operator*(const ZZ_pE& a, const vec_ZZ_pE& b) |
---|
63 | { vec_ZZ_pE x; mul(x, a, b); NTL_OPT_RETURN(vec_ZZ_pE, x); } |
---|
64 | |
---|
65 | inline vec_ZZ_pE operator*(const ZZ_p& a, const vec_ZZ_pE& b) |
---|
66 | { vec_ZZ_pE x; mul(x, a, b); NTL_OPT_RETURN(vec_ZZ_pE, x); } |
---|
67 | |
---|
68 | inline vec_ZZ_pE operator*(long a, const vec_ZZ_pE& b) |
---|
69 | { vec_ZZ_pE x; mul(x, a, b); NTL_OPT_RETURN(vec_ZZ_pE, x); } |
---|
70 | |
---|
71 | |
---|
72 | |
---|
73 | ZZ_pE operator*(const vec_ZZ_pE& a, const vec_ZZ_pE& b); |
---|
74 | |
---|
75 | |
---|
76 | |
---|
77 | // assignment operator notation: |
---|
78 | |
---|
79 | inline vec_ZZ_pE& operator+=(vec_ZZ_pE& x, const vec_ZZ_pE& a) |
---|
80 | { |
---|
81 | add(x, x, a); |
---|
82 | return x; |
---|
83 | } |
---|
84 | |
---|
85 | inline vec_ZZ_pE& operator-=(vec_ZZ_pE& x, const vec_ZZ_pE& a) |
---|
86 | { |
---|
87 | sub(x, x, a); |
---|
88 | return x; |
---|
89 | } |
---|
90 | |
---|
91 | inline vec_ZZ_pE& operator*=(vec_ZZ_pE& x, const ZZ_pE& a) |
---|
92 | { |
---|
93 | mul(x, x, a); |
---|
94 | return x; |
---|
95 | } |
---|
96 | |
---|
97 | inline vec_ZZ_pE& operator*=(vec_ZZ_pE& x, const ZZ_p& a) |
---|
98 | { |
---|
99 | mul(x, x, a); |
---|
100 | return x; |
---|
101 | } |
---|
102 | |
---|
103 | inline vec_ZZ_pE& operator*=(vec_ZZ_pE& x, long a) |
---|
104 | { |
---|
105 | mul(x, x, a); |
---|
106 | return x; |
---|
107 | } |
---|
108 | |
---|
109 | NTL_CLOSE_NNS |
---|
110 | |
---|
111 | #endif |
---|