1 |
gezelter |
507 |
/* |
2 |
gezelter |
246 |
* Copyright (c) 2005 The University of Notre Dame. All Rights Reserved. |
3 |
tim |
70 |
* |
4 |
gezelter |
246 |
* The University of Notre Dame grants you ("Licensee") a |
5 |
|
|
* non-exclusive, royalty free, license to use, modify and |
6 |
|
|
* redistribute this software in source and binary code form, provided |
7 |
|
|
* that the following conditions are met: |
8 |
|
|
* |
9 |
|
|
* 1. Acknowledgement of the program authors must be made in any |
10 |
|
|
* publication of scientific results based in part on use of the |
11 |
|
|
* program. An acceptable form of acknowledgement is citation of |
12 |
|
|
* the article in which the program was described (Matthew |
13 |
|
|
* A. Meineke, Charles F. Vardeman II, Teng Lin, Christopher |
14 |
|
|
* J. Fennell and J. Daniel Gezelter, "OOPSE: An Object-Oriented |
15 |
|
|
* Parallel Simulation Engine for Molecular Dynamics," |
16 |
|
|
* J. Comput. Chem. 26, pp. 252-271 (2005)) |
17 |
|
|
* |
18 |
|
|
* 2. Redistributions of source code must retain the above copyright |
19 |
|
|
* notice, this list of conditions and the following disclaimer. |
20 |
|
|
* |
21 |
|
|
* 3. Redistributions in binary form must reproduce the above copyright |
22 |
|
|
* notice, this list of conditions and the following disclaimer in the |
23 |
|
|
* documentation and/or other materials provided with the |
24 |
|
|
* distribution. |
25 |
|
|
* |
26 |
|
|
* This software is provided "AS IS," without a warranty of any |
27 |
|
|
* kind. All express or implied conditions, representations and |
28 |
|
|
* warranties, including any implied warranty of merchantability, |
29 |
|
|
* fitness for a particular purpose or non-infringement, are hereby |
30 |
|
|
* excluded. The University of Notre Dame and its licensors shall not |
31 |
|
|
* be liable for any damages suffered by licensee as a result of |
32 |
|
|
* using, modifying or distributing the software or its |
33 |
|
|
* derivatives. In no event will the University of Notre Dame or its |
34 |
|
|
* licensors be liable for any lost revenue, profit or data, or for |
35 |
|
|
* direct, indirect, special, consequential, incidental or punitive |
36 |
|
|
* damages, however caused and regardless of the theory of liability, |
37 |
|
|
* arising out of the use of or inability to use software, even if the |
38 |
|
|
* University of Notre Dame has been advised of the possibility of |
39 |
|
|
* such damages. |
40 |
tim |
70 |
*/ |
41 |
gezelter |
246 |
|
42 |
tim |
70 |
/** |
43 |
|
|
* @file Vector.hpp |
44 |
|
|
* @author Teng Lin |
45 |
|
|
* @date 09/14/2004 |
46 |
|
|
* @version 1.0 |
47 |
|
|
*/ |
48 |
|
|
|
49 |
|
|
#ifndef MATH_VECTOR_HPP |
50 |
|
|
#define MATH_VECTOR_HPP |
51 |
|
|
|
52 |
|
|
#include <cassert> |
53 |
|
|
#include <cmath> |
54 |
tim |
71 |
#include <iostream> |
55 |
tim |
253 |
#include <math.h> |
56 |
tim |
963 |
#include "config.h" |
57 |
tim |
70 |
namespace oopse { |
58 |
|
|
|
59 |
tim |
963 |
static const RealType epsilon = 0.000001; |
60 |
tim |
76 |
|
61 |
gezelter |
507 |
template<typename T> |
62 |
|
|
inline bool equal(T e1, T e2) { |
63 |
|
|
return e1 == e2; |
64 |
|
|
} |
65 |
tim |
76 |
|
66 |
tim |
963 |
//template<> |
67 |
|
|
//inline bool equal(float e1, float e2) { |
68 |
|
|
// return fabs(e1 - e2) < epsilon; |
69 |
|
|
//} |
70 |
tim |
76 |
|
71 |
gezelter |
507 |
template<> |
72 |
tim |
963 |
inline bool equal(RealType e1, RealType e2) { |
73 |
gezelter |
507 |
return fabs(e1 - e2) < epsilon; |
74 |
|
|
} |
75 |
tim |
110 |
|
76 |
tim |
76 |
|
77 |
gezelter |
507 |
/** |
78 |
|
|
* @class Vector Vector.hpp "math/Vector.hpp" |
79 |
|
|
* @brief Fix length vector class |
80 |
|
|
*/ |
81 |
|
|
template<typename Real, unsigned int Dim> |
82 |
|
|
class Vector{ |
83 |
|
|
public: |
84 |
tim |
70 |
|
85 |
gezelter |
507 |
typedef Real ElemType; |
86 |
|
|
typedef Real* ElemPoinerType; |
87 |
tim |
137 |
|
88 |
gezelter |
507 |
/** default constructor */ |
89 |
|
|
inline Vector(){ |
90 |
|
|
for (unsigned int i = 0; i < Dim; i++) |
91 |
|
|
this->data_[i] = 0; |
92 |
|
|
} |
93 |
tim |
70 |
|
94 |
gezelter |
507 |
/** Constructs and initializes a Vector from a vector */ |
95 |
|
|
inline Vector(const Vector<Real, Dim>& v) { |
96 |
|
|
*this = v; |
97 |
|
|
} |
98 |
tim |
70 |
|
99 |
gezelter |
507 |
/** copy assignment operator */ |
100 |
|
|
inline Vector<Real, Dim>& operator=(const Vector<Real, Dim>& v) { |
101 |
|
|
if (this == &v) |
102 |
|
|
return *this; |
103 |
tim |
70 |
|
104 |
gezelter |
507 |
for (unsigned int i = 0; i < Dim; i++) |
105 |
|
|
this->data_[i] = v[i]; |
106 |
tim |
70 |
|
107 |
gezelter |
507 |
return *this; |
108 |
|
|
} |
109 |
tim |
101 |
|
110 |
gezelter |
507 |
template<typename T> |
111 |
|
|
inline Vector(const T& s){ |
112 |
|
|
for (unsigned int i = 0; i < Dim; i++) |
113 |
|
|
this->data_[i] = s; |
114 |
|
|
} |
115 |
tim |
70 |
|
116 |
gezelter |
507 |
/** Constructs and initializes a Vector from an array */ |
117 |
|
|
inline Vector( Real* v) { |
118 |
|
|
for (unsigned int i = 0; i < Dim; i++) |
119 |
|
|
this->data_[i] = v[i]; |
120 |
|
|
} |
121 |
tim |
70 |
|
122 |
gezelter |
507 |
/** |
123 |
|
|
* Returns reference of ith element. |
124 |
|
|
* @return reference of ith element |
125 |
|
|
* @param i index |
126 |
|
|
*/ |
127 |
|
|
inline Real& operator[](unsigned int i) { |
128 |
|
|
assert( i < Dim); |
129 |
|
|
return this->data_[i]; |
130 |
|
|
} |
131 |
tim |
70 |
|
132 |
gezelter |
507 |
/** |
133 |
|
|
* Returns reference of ith element. |
134 |
|
|
* @return reference of ith element |
135 |
|
|
* @param i index |
136 |
|
|
*/ |
137 |
|
|
inline Real& operator()(unsigned int i) { |
138 |
|
|
assert( i < Dim); |
139 |
|
|
return this->data_[i]; |
140 |
|
|
} |
141 |
tim |
70 |
|
142 |
gezelter |
507 |
/** |
143 |
|
|
* Returns constant reference of ith element. |
144 |
|
|
* @return reference of ith element |
145 |
|
|
* @param i index |
146 |
|
|
*/ |
147 |
|
|
inline const Real& operator[](unsigned int i) const { |
148 |
|
|
assert( i < Dim); |
149 |
|
|
return this->data_[i]; |
150 |
|
|
} |
151 |
tim |
70 |
|
152 |
gezelter |
507 |
/** |
153 |
|
|
* Returns constant reference of ith element. |
154 |
|
|
* @return reference of ith element |
155 |
|
|
* @param i index |
156 |
|
|
*/ |
157 |
|
|
inline const Real& operator()(unsigned int i) const { |
158 |
|
|
assert( i < Dim); |
159 |
|
|
return this->data_[i]; |
160 |
|
|
} |
161 |
tim |
70 |
|
162 |
gezelter |
507 |
/** Copy the internal data to an array*/ |
163 |
|
|
void getArray(Real* array) { |
164 |
|
|
for (unsigned int i = 0; i < Dim; i ++) { |
165 |
|
|
array[i] = this->data_[i]; |
166 |
|
|
} |
167 |
|
|
} |
168 |
tim |
151 |
|
169 |
gezelter |
507 |
/** Returns the pointer of internal array */ |
170 |
|
|
Real* getArrayPointer() { |
171 |
|
|
return this->data_; |
172 |
|
|
} |
173 |
tim |
137 |
|
174 |
gezelter |
507 |
/** |
175 |
|
|
* Tests if this vetor is equal to other vector |
176 |
|
|
* @return true if equal, otherwise return false |
177 |
|
|
* @param v vector to be compared |
178 |
|
|
*/ |
179 |
|
|
inline bool operator ==(const Vector<Real, Dim>& v) { |
180 |
tim |
76 |
|
181 |
gezelter |
507 |
for (unsigned int i = 0; i < Dim; i ++) { |
182 |
|
|
if (!equal(this->data_[i], v[i])) { |
183 |
|
|
return false; |
184 |
|
|
} |
185 |
|
|
} |
186 |
tim |
76 |
|
187 |
gezelter |
507 |
return true; |
188 |
|
|
} |
189 |
tim |
76 |
|
190 |
gezelter |
507 |
/** |
191 |
|
|
* Tests if this vetor is not equal to other vector |
192 |
|
|
* @return true if equal, otherwise return false |
193 |
|
|
* @param v vector to be compared |
194 |
|
|
*/ |
195 |
|
|
inline bool operator !=(const Vector<Real, Dim>& v) { |
196 |
|
|
return !(*this == v); |
197 |
|
|
} |
198 |
tim |
76 |
|
199 |
gezelter |
507 |
/** Negates the value of this vector in place. */ |
200 |
|
|
inline void negate() { |
201 |
|
|
for (unsigned int i = 0; i < Dim; i++) |
202 |
|
|
this->data_[i] = -this->data_[i]; |
203 |
|
|
} |
204 |
tim |
70 |
|
205 |
gezelter |
507 |
/** |
206 |
|
|
* Sets the value of this vector to the negation of vector v1. |
207 |
|
|
* @param v1 the source vector |
208 |
|
|
*/ |
209 |
|
|
inline void negate(const Vector<Real, Dim>& v1) { |
210 |
|
|
for (unsigned int i = 0; i < Dim; i++) |
211 |
|
|
this->data_[i] = -v1.data_[i]; |
212 |
tim |
70 |
|
213 |
gezelter |
507 |
} |
214 |
tim |
70 |
|
215 |
gezelter |
507 |
/** |
216 |
|
|
* Sets the value of this vector to the sum of itself and v1 (*this += v1). |
217 |
|
|
* @param v1 the other vector |
218 |
|
|
*/ |
219 |
|
|
inline void add( const Vector<Real, Dim>& v1 ) { |
220 |
|
|
for (unsigned int i = 0; i < Dim; i++) |
221 |
|
|
this->data_[i] += v1.data_[i]; |
222 |
tim |
70 |
} |
223 |
|
|
|
224 |
|
|
/** |
225 |
gezelter |
507 |
* Sets the value of this vector to the sum of v1 and v2 (*this = v1 + v2). |
226 |
tim |
70 |
* @param v1 the first vector |
227 |
|
|
* @param v2 the second vector |
228 |
gezelter |
507 |
*/ |
229 |
|
|
inline void add( const Vector<Real, Dim>& v1, const Vector<Real, Dim>& v2 ) { |
230 |
|
|
for (unsigned int i = 0; i < Dim; i++) |
231 |
|
|
this->data_[i] = v1.data_[i] + v2.data_[i]; |
232 |
tim |
70 |
} |
233 |
|
|
|
234 |
|
|
/** |
235 |
gezelter |
507 |
* Sets the value of this vector to the difference of itself and v1 (*this -= v1). |
236 |
|
|
* @param v1 the other vector |
237 |
|
|
*/ |
238 |
|
|
inline void sub( const Vector<Real, Dim>& v1 ) { |
239 |
|
|
for (unsigned int i = 0; i < Dim; i++) |
240 |
|
|
this->data_[i] -= v1.data_[i]; |
241 |
|
|
} |
242 |
|
|
|
243 |
|
|
/** |
244 |
|
|
* Sets the value of this vector to the difference of vector v1 and v2 (*this = v1 - v2). |
245 |
tim |
70 |
* @param v1 the first vector |
246 |
|
|
* @param v2 the second vector |
247 |
gezelter |
507 |
*/ |
248 |
|
|
inline void sub( const Vector<Real, Dim>& v1, const Vector &v2 ){ |
249 |
|
|
for (unsigned int i = 0; i < Dim; i++) |
250 |
|
|
this->data_[i] = v1.data_[i] - v2.data_[i]; |
251 |
tim |
70 |
} |
252 |
gezelter |
507 |
|
253 |
tim |
70 |
/** |
254 |
gezelter |
507 |
* Sets the value of this vector to the scalar multiplication of itself (*this *= s). |
255 |
tim |
70 |
* @param s the scalar value |
256 |
gezelter |
507 |
*/ |
257 |
|
|
inline void mul( Real s ) { |
258 |
|
|
for (unsigned int i = 0; i < Dim; i++) |
259 |
|
|
this->data_[i] *= s; |
260 |
tim |
70 |
} |
261 |
gezelter |
507 |
|
262 |
tim |
70 |
/** |
263 |
gezelter |
507 |
* Sets the value of this vector to the scalar multiplication of vector v1 |
264 |
|
|
* (*this = s * v1). |
265 |
|
|
* @param v1 the vector |
266 |
tim |
70 |
* @param s the scalar value |
267 |
gezelter |
507 |
*/ |
268 |
|
|
inline void mul( const Vector<Real, Dim>& v1, Real s) { |
269 |
|
|
for (unsigned int i = 0; i < Dim; i++) |
270 |
|
|
this->data_[i] = s * v1.data_[i]; |
271 |
tim |
70 |
} |
272 |
|
|
|
273 |
|
|
/** |
274 |
gezelter |
507 |
* Sets the value of this vector to the scalar division of itself (*this /= s ). |
275 |
|
|
* @param s the scalar value |
276 |
|
|
*/ |
277 |
|
|
inline void div( Real s) { |
278 |
|
|
for (unsigned int i = 0; i < Dim; i++) |
279 |
|
|
this->data_[i] /= s; |
280 |
|
|
} |
281 |
|
|
|
282 |
|
|
/** |
283 |
|
|
* Sets the value of this vector to the scalar division of vector v1 (*this = v1 / s ). |
284 |
tim |
70 |
* @param v1 the source vector |
285 |
|
|
* @param s the scalar value |
286 |
gezelter |
507 |
*/ |
287 |
|
|
inline void div( const Vector<Real, Dim>& v1, Real s ) { |
288 |
|
|
for (unsigned int i = 0; i < Dim; i++) |
289 |
|
|
this->data_[i] = v1.data_[i] / s; |
290 |
tim |
70 |
} |
291 |
|
|
|
292 |
gezelter |
507 |
/** @see #add */ |
293 |
|
|
inline Vector<Real, Dim>& operator +=( const Vector<Real, Dim>& v1 ) { |
294 |
|
|
add(v1); |
295 |
|
|
return *this; |
296 |
|
|
} |
297 |
tim |
93 |
|
298 |
gezelter |
507 |
/** @see #sub */ |
299 |
|
|
inline Vector<Real, Dim>& operator -=( const Vector<Real, Dim>& v1 ) { |
300 |
|
|
sub(v1); |
301 |
|
|
return *this; |
302 |
tim |
70 |
} |
303 |
|
|
|
304 |
gezelter |
507 |
/** @see #mul */ |
305 |
|
|
inline Vector<Real, Dim>& operator *=( Real s) { |
306 |
|
|
mul(s); |
307 |
|
|
return *this; |
308 |
tim |
70 |
} |
309 |
|
|
|
310 |
gezelter |
507 |
/** @see #div */ |
311 |
|
|
inline Vector<Real, Dim>& operator /=( Real s ) { |
312 |
|
|
div(s); |
313 |
|
|
return *this; |
314 |
|
|
} |
315 |
|
|
|
316 |
tim |
70 |
/** |
317 |
gezelter |
507 |
* Returns the length of this vector. |
318 |
|
|
* @return the length of this vector |
319 |
tim |
70 |
*/ |
320 |
gezelter |
507 |
inline Real length() { |
321 |
|
|
return sqrt(lengthSquare()); |
322 |
tim |
70 |
} |
323 |
gezelter |
507 |
|
324 |
|
|
/** |
325 |
|
|
* Returns the squared length of this vector. |
326 |
|
|
* @return the squared length of this vector |
327 |
|
|
*/ |
328 |
|
|
inline Real lengthSquare() { |
329 |
|
|
return dot(*this, *this); |
330 |
|
|
} |
331 |
|
|
|
332 |
|
|
/** Normalizes this vector in place */ |
333 |
|
|
inline void normalize() { |
334 |
|
|
Real len; |
335 |
tim |
70 |
|
336 |
gezelter |
507 |
len = length(); |
337 |
|
|
|
338 |
|
|
//if (len < oopse:epsilon) |
339 |
|
|
// throw(); |
340 |
|
|
|
341 |
|
|
*this /= len; |
342 |
|
|
} |
343 |
|
|
|
344 |
tim |
70 |
/** |
345 |
gezelter |
507 |
* Tests if this vector is normalized |
346 |
|
|
* @return true if this vector is normalized, otherwise return false |
347 |
tim |
70 |
*/ |
348 |
gezelter |
507 |
inline bool isNormalized() { |
349 |
tim |
963 |
return equal(lengthSquare(), (RealType)1); |
350 |
gezelter |
507 |
} |
351 |
tim |
886 |
|
352 |
|
|
unsigned int size() {return Dim;} |
353 |
gezelter |
507 |
protected: |
354 |
|
|
Real data_[Dim]; |
355 |
|
|
|
356 |
|
|
}; |
357 |
tim |
93 |
|
358 |
gezelter |
507 |
/** unary minus*/ |
359 |
|
|
template<typename Real, unsigned int Dim> |
360 |
|
|
inline Vector<Real, Dim> operator -(const Vector<Real, Dim>& v1){ |
361 |
|
|
Vector<Real, Dim> tmp(v1); |
362 |
|
|
tmp.negate(); |
363 |
|
|
return tmp; |
364 |
|
|
} |
365 |
|
|
|
366 |
|
|
/** |
367 |
|
|
* Return the sum of two vectors (v1 - v2). |
368 |
|
|
* @return the sum of two vectors |
369 |
|
|
* @param v1 the first vector |
370 |
|
|
* @param v2 the second vector |
371 |
|
|
*/ |
372 |
|
|
template<typename Real, unsigned int Dim> |
373 |
|
|
inline Vector<Real, Dim> operator +(const Vector<Real, Dim>& v1, const Vector<Real, Dim>& v2) { |
374 |
|
|
Vector<Real, Dim> result; |
375 |
tim |
110 |
|
376 |
gezelter |
507 |
result.add(v1, v2); |
377 |
|
|
return result; |
378 |
|
|
} |
379 |
tim |
110 |
|
380 |
gezelter |
507 |
/** |
381 |
|
|
* Return the difference of two vectors (v1 - v2). |
382 |
|
|
* @return the difference of two vectors |
383 |
|
|
* @param v1 the first vector |
384 |
|
|
* @param v2 the second vector |
385 |
|
|
*/ |
386 |
|
|
template<typename Real, unsigned int Dim> |
387 |
|
|
Vector<Real, Dim> operator -(const Vector<Real, Dim>& v1, const Vector<Real, Dim>& v2) { |
388 |
|
|
Vector<Real, Dim> result; |
389 |
|
|
result.sub(v1, v2); |
390 |
|
|
return result; |
391 |
|
|
} |
392 |
|
|
|
393 |
|
|
/** |
394 |
|
|
* Returns the vaule of scalar multiplication of this vector v1 (v1 * r). |
395 |
|
|
* @return the vaule of scalar multiplication of this vector |
396 |
|
|
* @param v1 the source vector |
397 |
|
|
* @param s the scalar value |
398 |
|
|
*/ |
399 |
|
|
template<typename Real, unsigned int Dim> |
400 |
|
|
Vector<Real, Dim> operator * ( const Vector<Real, Dim>& v1, Real s) { |
401 |
|
|
Vector<Real, Dim> result; |
402 |
|
|
result.mul(v1,s); |
403 |
|
|
return result; |
404 |
|
|
} |
405 |
|
|
|
406 |
|
|
/** |
407 |
|
|
* Returns the vaule of scalar multiplication of this vector v1 (v1 * r). |
408 |
|
|
* @return the vaule of scalar multiplication of this vector |
409 |
|
|
* @param s the scalar value |
410 |
|
|
* @param v1 the source vector |
411 |
|
|
*/ |
412 |
|
|
template<typename Real, unsigned int Dim> |
413 |
|
|
Vector<Real, Dim> operator * ( Real s, const Vector<Real, Dim>& v1 ) { |
414 |
|
|
Vector<Real, Dim> result; |
415 |
|
|
result.mul(v1, s); |
416 |
|
|
return result; |
417 |
|
|
} |
418 |
tim |
110 |
|
419 |
gezelter |
507 |
/** |
420 |
|
|
* Returns the value of division of a vector by a scalar. |
421 |
|
|
* @return the vaule of scalar division of this vector |
422 |
|
|
* @param v1 the source vector |
423 |
|
|
* @param s the scalar value |
424 |
|
|
*/ |
425 |
|
|
template<typename Real, unsigned int Dim> |
426 |
|
|
Vector<Real, Dim> operator / ( const Vector<Real, Dim>& v1, Real s) { |
427 |
|
|
Vector<Real, Dim> result; |
428 |
|
|
result.div( v1,s); |
429 |
|
|
return result; |
430 |
|
|
} |
431 |
|
|
|
432 |
|
|
/** |
433 |
|
|
* Returns the dot product of two Vectors |
434 |
|
|
* @param v1 first vector |
435 |
|
|
* @param v2 second vector |
436 |
|
|
* @return the dot product of v1 and v2 |
437 |
|
|
*/ |
438 |
|
|
template<typename Real, unsigned int Dim> |
439 |
|
|
inline Real dot( const Vector<Real, Dim>& v1, const Vector<Real, Dim>& v2 ) { |
440 |
|
|
Real tmp; |
441 |
|
|
tmp = 0; |
442 |
|
|
|
443 |
|
|
for (unsigned int i = 0; i < Dim; i++) |
444 |
|
|
tmp += v1[i] * v2[i]; |
445 |
|
|
|
446 |
|
|
return tmp; |
447 |
|
|
} |
448 |
|
|
|
449 |
|
|
/** |
450 |
|
|
* Returns the distance between two Vectors |
451 |
|
|
* @param v1 first vector |
452 |
|
|
* @param v2 second vector |
453 |
|
|
* @return the distance between v1 and v2 |
454 |
|
|
*/ |
455 |
|
|
template<typename Real, unsigned int Dim> |
456 |
|
|
inline Real distance( const Vector<Real, Dim>& v1, const Vector<Real, Dim>& v2 ) { |
457 |
|
|
Vector<Real, Dim> tempVector = v1 - v2; |
458 |
|
|
return tempVector.length(); |
459 |
|
|
} |
460 |
|
|
|
461 |
|
|
/** |
462 |
|
|
* Returns the squared distance between two Vectors |
463 |
|
|
* @param v1 first vector |
464 |
|
|
* @param v2 second vector |
465 |
|
|
* @return the squared distance between v1 and v2 |
466 |
|
|
*/ |
467 |
|
|
template<typename Real, unsigned int Dim> |
468 |
|
|
inline Real distanceSquare( const Vector<Real, Dim>& v1, const Vector<Real, Dim>& v2 ) { |
469 |
|
|
Vector<Real, Dim> tempVector = v1 - v2; |
470 |
|
|
return tempVector.lengthSquare(); |
471 |
|
|
} |
472 |
|
|
|
473 |
|
|
/** |
474 |
|
|
* Write to an output stream |
475 |
|
|
*/ |
476 |
|
|
template<typename Real, unsigned int Dim> |
477 |
|
|
std::ostream &operator<< ( std::ostream& o, const Vector<Real, Dim>& v) { |
478 |
|
|
|
479 |
|
|
o << "[ "; |
480 |
|
|
|
481 |
|
|
for (unsigned int i = 0 ; i< Dim; i++) { |
482 |
|
|
o << v[i]; |
483 |
|
|
|
484 |
|
|
if (i != Dim -1) { |
485 |
|
|
o<< ", "; |
486 |
|
|
} |
487 |
tim |
70 |
} |
488 |
gezelter |
507 |
|
489 |
|
|
o << " ]"; |
490 |
|
|
return o; |
491 |
|
|
} |
492 |
tim |
70 |
|
493 |
|
|
} |
494 |
|
|
#endif |