-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGF2XVec.txt
63 lines (42 loc) · 1.6 KB
/
GF2XVec.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
/**************************************************************************\
MODULE: GF2XVec
SUMMARY:
The class GF2XVec implements vectors of fixed-length GF2X's. You can
allocate a vector of GF2X's of a specified length, where the maximum
size of each GF2X is also specified. These parameters can be specified
either with a constructor, or with SetSize. It is an error to
try to re-size a vector of non-xero , or store a GF2X that doesn't fit.
The space can be released with "kill", and then you are free to call SetSize
again. If you want more flexible---but less efficient---vectors, use
vec_GF2X.
\**************************************************************************/
#include <NTL/GF2X.h>
class GF2XVec {
public:
GF2XVec();
GF2XVec& operator=(const GF2XVec&);
// first kill()'s destination (unless source and destination are
// identical)
GF2XVec(const GF2XVec&);
~GF2XVec();
GF2XVec(long n, long d);
// sets length to n and max size of each element to d,
// where the size d measures the number of words
void SetSize(long n, long d);
// sets length to n and max size of each element to d,
// where the size d measures the number of words
long length() const;
// length of vector
long BaseSize() const;
// max size of each element
void kill();
// release space
GF2X* elts();
const GF2X* elts() const;
// pointer to first element
GF2X& operator[](long i);
const GF2X& operator[](long i) const;
// indexing operator; starts at 0; no range checking
};
void swap(GF2XVec& x, GF2XVec& y);
// swaps x and y by swapping pointers