ParM
parm
A molecular dynamics library
|
A 3D physics vector, with methods for adding, subtracting, dot product, etc. More...
#include <vec.hpp>
Public Member Functions | |
Vector3 () | |
Vector3 (const T a, const T b, const T c) | |
Vector3 (const NumVector< T, 3 > rhs) | |
Vector3 (const NVector< T, 3 > rhs) | |
const T | getx () const |
const T | gety () const |
const T | getz () const |
double | getxd () const |
Return x as a double. Useful with some versions of Python and long doubles. More... | |
double | getyd () const |
double | getzd () const |
void | setx (const T a) |
void | sety (const T b) |
void | setz (const T c) |
void | setxd (const double a) |
Set x with a double. Useful with some versions of Python and long doubles. More... | |
void | setyd (const double b) |
void | setzd (const double c) |
void | set (const T a, const T b, const T c) |
Vector3 | operator- () const |
Vector3 | operator+ (const Vector3 &rhs) const |
Vector3 | operator- (const Vector3 &rhs) const |
T | operator* (const Vector3 &rhs) const |
template<class U > | |
Vector3 | operator* (const U rhs) const |
template<class U > | |
Vector3 | operator/ (const U rhs) const |
Vector3 | cross (const Vector3 &rhs) const |
Cross product, \(\vec r \times \vec s \). More... | |
Vector3 | norm () const |
Vector3 & | operator-= (const Vector3 &rhs) |
Vector3 & | operator+= (const Vector3 &rhs) |
template<class U > | |
Vector3 & | operator*= (const U rhs) |
template<class U > | |
Vector3 & | operator/= (const U rhs) |
~Vector3 () | |
template<class U > | |
Vector3< T > & | operator*= (const U rhs) |
template<class U > | |
Vector3< T > & | operator/= (const U rhs) |
![]() | |
NumVector () | |
NumVector (const NVector< T, N > &rhs) | |
NumVector (const T rhs[N]) | |
T | dot (const NumVector &other) const |
Inner product. More... | |
T | sq () const |
T | mag () const |
The square of the vector, \(\vec r^2 \). More... | |
T | distance (const NumVector &rhs) const |
The magnitude of the vector, \( \left| \vec r \right| \). More... | |
NumVector | perpto (const NumVector &other) const |
void | normalize () |
Normalize in place. More... | |
NumVector | norm () const |
Return the normalized version. More... | |
~NumVector () | |
![]() | |
NVector () | |
NVector (const NVector &rhs) | |
template<class U > | |
NVector (const NVector< U, N > &rhs) | |
NVector (const T locs[N]) | |
const T & | get (const unsigned int n) const |
void | set (const unsigned int n, const T a) |
unsigned int | len () const |
NVector & | operator+= (const NVector &rhs) |
NVector & | operator-= (const NVector &rhs) |
template<class U > | |
NVector & | operator*= (const U rhs) |
template<class U > | |
NVector & | operator/= (const U rhs) |
NVector | operator- () const |
NVector | operator+ (const NVector &rhs) const |
NVector | operator- (const NVector &rhs) const |
T & | operator[] (const unsigned int i) |
const T & | operator[] (const unsigned int i) const |
template<class U > | |
NVector | operator* (const U rhs) const |
Multiplication by a scalar. More... | |
template<class U > | |
NVector | operator/ (const U rhs) const |
Division by a scalar. More... | |
T * | begin () |
T * | end () |
~NVector () | |
template<class U > | |
NVector< T, N > & | operator*= (const U rhs) |
template<class U > | |
NVector< T, N > & | operator/= (const U rhs) |
Static Public Member Functions | |
static T | angle (const Vector3 &dx1, const Vector3 &dx2) |
The angle between two vectors, assuming they start at the same point (i.e. the origin). More... | |
static T | angle (const Vector3 &x1, const Vector3 &x2, const Vector3 &x3) |
The angle between three points. More... | |
static T | Dihedral (const Vector3 &dx1, const Vector3 &dx2, const Vector3 &dx3) |
The Dihedral angle between three vectors: More... | |
static T | Dihedral (const Vector3 &x1, const Vector3 &x2, const Vector3 &x3, const Vector3 &x4) |
The Dihedral angle between four points. More... | |
Friends | |
template<class U > | |
ostream & | operator<< (ostream &out, const Vector3< U > v) |
Additional Inherited Members | |
![]() | |
typedef T * | iterator |
![]() | |
T | vals [N] |
A 3D physics vector, with methods for adding, subtracting, dot product, etc.
This is aliased as Vec when compiled with NDIM=3.
T | a numerical type, as as float or double. |
|
inlinestatic |
The angle between two vectors, assuming they start at the same point (i.e. the origin).
Equal to \(\theta = \arccos \left(\frac{\vec x_1 \cdot \vec x_2}{\left| \vec x_1 \right| \left| \vec x_2 \right|}\right) \)
dx1 | \(\vec x_1 \) |
dx2 | \(\vec x_2 \) |
|
inlinestatic |
The angle between three points.
Equivalent to angle(x1 - x2, x3 - x2)
.
x1 | The first point. |
x2 | The middle point, around which we are finding the angle. |
x3 | The third point. |
Cross product, \(\vec r \times \vec s \).
|
inlinestatic |
The Dihedral angle between three vectors:
\( \phi=\operatorname{arctan2}\left( \vec{r}_{1}\cdot\left(\vec{r}_{2}\times \vec{r}_{3}\right)\left|\vec{r}_{2}\right|, \left(\vec{r}_{1}\times\vec{r}_{2}\right)\cdot \left(\vec{r}_{2}\times\vec{r}_{3}\right) \right) \)
dx1 | \(\vec r_1\) |
dx2 | \(\vec r_2\) |
dx3 | \(\vec r_3\) |
|
inline |
|
inline |
Return x as a double. Useful with some versions of Python and long doubles.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Set x with a double. Useful with some versions of Python and long doubles.
|
inline |
|
inline |
|
inline |
|
inline |
|
friend |