source: git/ntl/include/NTL/vec_GF2E.h @ 92c0ac

spielwiese
Last change on this file since 92c0ac was 92c0ac, checked in by Hans Schönemann <hannes@…>, 21 years ago
NTL-5.2 git-svn-id: file:///usr/local/Singular/svn/trunk@6320 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 2.6 KB
Line 
1
2#ifndef NTL_vec_GF2E__H
3#define NTL_vec_GF2E__H
4
5#include <NTL/GF2E.h>
6
7NTL_OPEN_NNS
8
9NTL_vector_decl(GF2E,vec_GF2E)
10
11NTL_io_vector_decl(GF2E,vec_GF2E)
12
13NTL_eq_vector_decl(GF2E,vec_GF2E)
14
15
16void mul(vec_GF2E& x, const vec_GF2E& a, const GF2E& b);
17inline void mul(vec_GF2E& x, const GF2E& a, const vec_GF2E& b)
18   { mul(x, b, a); }
19
20void mul(vec_GF2E& x, const vec_GF2E& a, GF2 b);
21inline void mul(vec_GF2E& x, GF2 a, const vec_GF2E& b)
22   { mul(x, b, a); }
23
24inline void mul(vec_GF2E& x, const vec_GF2E& a, long b)
25   { mul(x, a, to_GF2(b)); }
26inline void mul(vec_GF2E& x, long a, const vec_GF2E& b)
27   { mul(x, b, a); }
28
29
30
31void add(vec_GF2E& x, const vec_GF2E& a, const vec_GF2E& b);
32inline void sub(vec_GF2E& x, const vec_GF2E& a, const vec_GF2E& b)
33  { add(x, a, b); }
34
35inline void negate(vec_GF2E& x, const vec_GF2E& a) { x = a; }
36
37void clear(vec_GF2E& x);
38
39
40void InnerProduct(GF2E& x, const vec_GF2E& a, const vec_GF2E& b);
41void InnerProduct(GF2E& x, const vec_GF2E& a, const vec_GF2E& b,
42                  long offset);
43
44
45long IsZero(const vec_GF2E& a);
46
47vec_GF2E
48operator+(const vec_GF2E& a, const vec_GF2E& b);
49
50vec_GF2E
51operator-(const vec_GF2E& a, const vec_GF2E& b);
52
53vec_GF2E operator-(const vec_GF2E& a);
54GF2E operator*(const vec_GF2E& a, const vec_GF2E& b);
55
56inline vec_GF2E operator*(const vec_GF2E& a, const GF2E& b)
57   { vec_GF2E x; mul(x, a, b); NTL_OPT_RETURN(vec_GF2E, x); }
58
59inline vec_GF2E operator*(const vec_GF2E& a, GF2 b)
60   { vec_GF2E x; mul(x, a, b); NTL_OPT_RETURN(vec_GF2E, x); }
61
62inline vec_GF2E operator*(const vec_GF2E& a, long b)
63   { vec_GF2E x; mul(x, a, b); NTL_OPT_RETURN(vec_GF2E, x); }
64
65inline vec_GF2E operator*(const GF2E& a, const vec_GF2E& b)
66   { vec_GF2E x; mul(x, a, b); NTL_OPT_RETURN(vec_GF2E, x); }
67
68inline vec_GF2E operator*(GF2 a, const vec_GF2E& b)
69   { vec_GF2E x; mul(x, a, b); NTL_OPT_RETURN(vec_GF2E, x); }
70
71inline vec_GF2E operator*(long a, const vec_GF2E& b)
72   { vec_GF2E x; mul(x, a, b); NTL_OPT_RETURN(vec_GF2E, x); }
73
74
75
76// assignment operator notation:
77
78inline vec_GF2E& operator+=(vec_GF2E& x, const vec_GF2E& a)
79{ 
80   add(x, x, a);
81   return x;
82}
83
84inline vec_GF2E& operator-=(vec_GF2E& x, const vec_GF2E& a)
85{ 
86   sub(x, x, a);
87   return x;
88}
89
90inline vec_GF2E& operator*=(vec_GF2E& x, const GF2E& a)
91{ 
92   mul(x, x, a);
93   return x;
94}
95
96inline vec_GF2E& operator*=(vec_GF2E& x, GF2 a)
97{ 
98   mul(x, x, a);
99   return x;
100}
101
102inline vec_GF2E& operator*=(vec_GF2E& x, long a)
103{ 
104   mul(x, x, a);
105   return x;
106}
107
108void VectorCopy(vec_GF2E& x, const vec_GF2E& a, long n);
109inline vec_GF2E VectorCopy(const vec_GF2E& a, long n)
110   { vec_GF2E x; VectorCopy(x, a, n); NTL_OPT_RETURN(vec_GF2E, x); }
111
112
113NTL_CLOSE_NNS
114
115#endif
Note: See TracBrowser for help on using the repository browser.