source: git/ntl/doc/vec_ZZ_p.txt @ 2cfffe

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