1 | |
---|
2 | /**************************************************************************\ |
---|
3 | |
---|
4 | MODULE: vec_RR |
---|
5 | |
---|
6 | SUMMARY: |
---|
7 | |
---|
8 | Defines the class vec_RR. |
---|
9 | |
---|
10 | \**************************************************************************/ |
---|
11 | |
---|
12 | NTL_vector_decl(RR,vec_RR) |
---|
13 | |
---|
14 | NTL_eq_vector_decl(RR,vec_RR) |
---|
15 | // == and != |
---|
16 | |
---|
17 | NTL_io_vector_decl(RR,vec_RR) |
---|
18 | // I/O operators |
---|
19 | |
---|
20 | void mul(vec_RR& x, const vec_RR& a, const RR& b); |
---|
21 | void mul(vec_RR& x, const vec_RR& a, double b); |
---|
22 | |
---|
23 | void mul(vec_RR& x, const RR& a, const vec_RR& b); |
---|
24 | void mul(vec_RR& x, double a, const vec_RR& b); |
---|
25 | // x = a * b |
---|
26 | |
---|
27 | |
---|
28 | void add(vec_RR& x, const vec_RR& a, const vec_RR& b); |
---|
29 | // x = a + b |
---|
30 | |
---|
31 | void sub(vec_RR& x, const vec_RR& a, const vec_RR& b); |
---|
32 | // x = a - b |
---|
33 | |
---|
34 | void clear(vec_RR& x); |
---|
35 | // x = 0 (length unchanged) |
---|
36 | |
---|
37 | void negate(vec_RR& x, const vec_RR& a); |
---|
38 | // x = -a |
---|
39 | |
---|
40 | long IsZero(const vec_RR& a); |
---|
41 | // test if a is the zero vector |
---|
42 | |
---|
43 | |
---|
44 | void InnerProduct(RR& x, const vec_RR& a, const vec_RR& b); |
---|
45 | // x = inner product of a and b, padded with zeros to make the lengths |
---|
46 | // even. |
---|
47 | |
---|
48 | void VectorCopy(vec_RR& x, const vec_RR& a, long n); |
---|
49 | vec_RR VectorCopy(const vec_RR& a, long n); |
---|
50 | // x = a copy of a of length exactly n. |
---|
51 | // The input is truncated or padded with zeroes, as necessary. |
---|
52 | |
---|
53 | |
---|
54 | // operator notation: |
---|
55 | |
---|
56 | vec_RR operator+(const vec_RR& a, const vec_RR& b); |
---|
57 | vec_RR operator-(const vec_RR& a, const vec_RR& b); |
---|
58 | |
---|
59 | vec_RR operator-(const vec_RR& a); |
---|
60 | |
---|
61 | |
---|
62 | // vector/scalar multiplication: |
---|
63 | |
---|
64 | vec_RR operator*(const vec_RR& a, const RR& b); |
---|
65 | vec_RR operator*(const vec_RR& a, double b); |
---|
66 | |
---|
67 | vec_RR operator*(const RR& a, const vec_RR& b); |
---|
68 | vec_RR operator*(double a, const vec_RR& b); |
---|
69 | |
---|
70 | // inner product: |
---|
71 | |
---|
72 | RR operator*(const vec_RR& a, const vec_RR& b); |
---|
73 | |
---|
74 | |
---|
75 | // assignment operator notation: |
---|
76 | |
---|
77 | vec_RR& operator+=(vec_RR& x, const vec_RR& a); |
---|
78 | vec_RR& operator-=(vec_RR& x, const vec_RR& a); |
---|
79 | |
---|
80 | vec_RR& operator*=(vec_RR& x, const RR& a); |
---|
81 | vec_RR& operator*=(vec_RR& x, double a); |
---|
82 | |
---|
83 | |
---|