Revision b2d499c7
utility/vector.h | ||
---|---|---|
34 | 34 |
public: |
35 | 35 |
Vector() |
36 | 36 |
{ |
37 |
p_vec = &p_vec_data[0]; |
|
38 | 37 |
memset(p_vec, 0, sizeof(double)*N); |
39 | 38 |
} |
40 | 39 |
|
41 | 40 |
Vector(double a) |
42 | 41 |
{ |
43 |
p_vec = &p_vec_data[0]; |
|
44 | 42 |
memset(p_vec, 0, sizeof(double)*N); |
45 | 43 |
p_vec[0] = a; |
46 | 44 |
} |
47 | 45 |
|
48 | 46 |
Vector(double a, double b) |
49 | 47 |
{ |
50 |
p_vec = &p_vec_data[0]; |
|
51 | 48 |
memset(p_vec, 0, sizeof(double)*N); |
52 | 49 |
p_vec[0] = a; |
53 | 50 |
p_vec[1] = b; |
... | ... | |
55 | 52 |
|
56 | 53 |
Vector(double a, double b, double c) |
57 | 54 |
{ |
58 |
p_vec = &p_vec_data[0]; |
|
59 | 55 |
memset(p_vec, 0, sizeof(double)*N); |
60 | 56 |
p_vec[0] = a; |
61 | 57 |
p_vec[1] = b; |
... | ... | |
64 | 60 |
|
65 | 61 |
Vector(double a, double b, double c, double d) |
66 | 62 |
{ |
67 |
p_vec = &p_vec_data[0]; |
|
68 | 63 |
memset(p_vec, 0, sizeof(double)*N); |
69 | 64 |
p_vec[0] = a; |
70 | 65 |
p_vec[1] = b; |
... | ... | |
74 | 69 |
|
75 | 70 |
Vector(const Vector<N> &v) |
76 | 71 |
{ |
77 |
p_vec = &p_vec_data[0]; |
|
78 |
memset(p_vec, 0, sizeof(double)*N); |
|
79 |
for (int x = 0; x < N; x++ ) |
|
72 |
for (int x = 0; x < N; x++) |
|
80 | 73 |
p_vec[x] = v.p_vec[x]; |
81 | 74 |
} |
82 | 75 |
|
... | ... | |
229 | 222 |
|
230 | 223 |
|
231 | 224 |
private: |
232 |
double* p_vec; |
|
233 |
double p_vec_data[N]; |
|
225 |
double p_vec[N]; |
|
234 | 226 |
}; |
235 | 227 |
|
236 | 228 |
|
Also available in: Unified diff