source: git/ntl/doc/vec_GF2E.txt @ 16055bd

fieker-DuValspielwiese
Last change on this file since 16055bd was e6caf81, checked in by Hans Schönemann <hannes@…>, 20 years ago
*hannes: 5.3.2 git-svn-id: file:///usr/local/Singular/svn/trunk@7472 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 2.9 KB
Line 
1
2/**************************************************************************\
3
4MODULE: vec_GF2E
5
6SUMMARY:
7
8Provides vectors over GF2E, along with some related operations.
9
10\**************************************************************************/
11
12#include <NTL/GF2E.h>
13#include <NTL/vector.h>
14
15NTL_vector_decl(GF2E,vec_GF2E)
16
17NTL_io_vector_decl(GF2E,vec_GF2E)
18// I/O operators are defined
19
20NTL_eq_vector_decl(GF2E,vec_GF2E)
21// operators == and != are defined
22
23void mul(vec_GF2E& x, const vec_GF2E& a, const GF2E& b);
24void mul(vec_GF2E& x, const vec_GF2E& a, GF2 b);
25void mul(vec_GF2E& x, const vec_GF2E& a, long b);
26
27void mul(vec_GF2E& x, const GF2E& a, const vec_GF2E& b);
28void mul(vec_GF2E& x, GF2 a, const vec_GF2E& b);
29void mul(vec_GF2E& x, long a, const vec_GF2E& b);
30// x = a * b
31
32void add(vec_GF2E& x, const vec_GF2E& a, const vec_GF2E& b);
33// x = a + b
34
35void sub(vec_GF2E& x, const vec_GF2E& a, const vec_GF2E& b);
36// x = a - b = x + a
37
38void negate(vec_GF2E& x, const vec_GF2E& a);
39// x = - a = a
40
41void clear(vec_GF2E& x);
42// x = 0 (length unchanged)
43
44long IsZero(const vec_GF2E& a);
45// test if a is the zero vector
46
47
48
49void InnerProduct(GF2E& x, const vec_GF2E& a, const vec_GF2E& b);
50// x = sum_{i=0}^{n-1} a[i]*b[i], where n = min(a.length(), b.length())
51
52void InnerProduct(GF2E& x, const vec_GF2E& a, const vec_GF2E& b,
53                  long offset);
54// x = sum_{i=offset}^{n-1} a[i]*b[i-offset], where n = min(a.length(),
55// b.length()+offset)
56
57void VectorCopy(vec_GF2E& x, const vec_GF2E& a, long n);
58vec_GF2E VectorCopy(const vec_GF2E& a, long n);
59// x = a copy of a of length exactly n.
60// The input is truncated or padded with zeroes, as necessary.
61
62
63
64// operator notation:
65
66vec_GF2E
67operator+(const vec_GF2E& a, const vec_GF2E& b);
68
69vec_GF2E
70operator-(const vec_GF2E& a, const vec_GF2E& b);
71
72vec_GF2E operator-(const vec_GF2E& a);
73
74
75// vector/scalar multiplication:
76
77vec_GF2E operator*(const vec_GF2E& a, const GF2E& b);
78vec_GF2E operator*(const vec_GF2E& a, GF2 b);
79vec_GF2E operator*(const vec_GF2E& a, long b);
80
81vec_GF2E operator*(const GF2E& a, const vec_GF2E& b);
82vec_GF2E operator*(GF2 a, const vec_GF2E& b);
83vec_GF2E operator*(long a, const vec_GF2E& b);
84
85// inner product:
86
87GF2E operator*(const vec_GF2E& a, const vec_GF2E& b);
88
89
90// assignment operator notation:
91
92vec_GF2E& operator+=(vec_GF2E& x, const vec_GF2E& a);
93vec_GF2E& operator-=(vec_GF2E& x, const vec_GF2E& a);
94
95vec_GF2E& operator*=(vec_GF2E& x, const GF2E& a);
96vec_GF2E& operator*=(vec_GF2E& x, GF2 a);
97vec_GF2E& operator*=(vec_GF2E& x, long a);
98
99
100
101// Implementation note: the BlockConstruct routine has been customized
102// for GF2E so that when a vec_GF2E is grown, space for the needed
103// elements is allocated in one contiguous chunk.  This saves on calls to
104// malloc and free, and should also yield better locality of reference.
105// One consequence of this is that swapping an element of a vec_GF2E
106// with another GF2E can not be implemented by pointer swap, and will in
107// this case be done by copy.
Note: See TracBrowser for help on using the repository browser.