36 |
|
* [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005). |
37 |
|
* [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006). |
38 |
|
* [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008). |
39 |
< |
* [4] Vardeman & Gezelter, in progress (2009). |
39 |
> |
* [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). |
40 |
> |
* [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). |
41 |
|
*/ |
42 |
|
|
43 |
|
/** |
73 |
|
inline bool equal(RealType e1, RealType e2) { |
74 |
|
return fabs(e1 - e2) < epsilon; |
75 |
|
} |
75 |
– |
|
76 |
|
|
77 |
|
/** |
78 |
|
* @class Vector Vector.hpp "math/Vector.hpp" |
107 |
|
return *this; |
108 |
|
} |
109 |
|
|
110 |
< |
template<typename T> |
111 |
< |
inline Vector(const T& s){ |
110 |
> |
// template<typename T> |
111 |
> |
// inline Vector(const T& s){ |
112 |
> |
inline Vector(const Real& s) { |
113 |
|
for (unsigned int i = 0; i < Dim; i++) |
114 |
< |
this->data_[i] = s; |
114 |
> |
this->data_[i] = s; |
115 |
|
} |
116 |
|
|
117 |
|
/** Constructs and initializes a Vector from an array */ |
285 |
|
this->data_[i] = v1.data_[i] * v2.data_[i]; |
286 |
|
} |
287 |
|
|
288 |
+ |
/* replaces the elements with the absolute values of those elements */ |
289 |
+ |
inline Vector<Real, Dim>& abs() { |
290 |
+ |
for (unsigned int i = 0; i < Dim; i++) { |
291 |
+ |
this->data_[i] = std::abs(this->data_[i]); |
292 |
+ |
} |
293 |
+ |
return *this; |
294 |
+ |
} |
295 |
+ |
|
296 |
+ |
/* returns the maximum value in this vector */ |
297 |
+ |
inline Real max() { |
298 |
+ |
Real val = this->data_[0]; |
299 |
+ |
for (unsigned int i = 0; i < Dim; i++) { |
300 |
+ |
if (this->data_[i] > val) val = this->data_[i]; |
301 |
+ |
} |
302 |
+ |
return val; |
303 |
+ |
} |
304 |
+ |
|
305 |
|
/** |
306 |
|
* Sets the value of this vector to the scalar division of itself (*this /= s ). |
307 |
|
* @param s the scalar value |