OpenMD 3.1
Molecular Dynamics in the Open
|
Public Types | |
using | ElemType = Real |
using | ElemPoinerType = Real* |
Public Types inherited from OpenMD::Vector< Real, 3 > | |
using | ElemType |
using | ElemPoinerType |
Public Member Functions | |
Vector3 (Real x, Real y, Real z) | |
Constructs and initializes a Vector3 from x, y, z coordinates. | |
Vector3 (Real *array) | |
Constructs and initializes from an array. | |
Vector3 (const Vector< Real, 3 > &v) | |
Vector3< Real > & | operator= (const Vector< Real, 3 > &v) |
Real & | x () |
Returns reference of the first element of Vector3. | |
Real | x () const |
Returns the first element of Vector3. | |
Real & | y () |
Returns reference of the second element of Vector3. | |
Real | y () const |
Returns the second element of Vector3. | |
Real & | z () |
Returns reference of the third element of Vector3. | |
Real | z () const |
Returns the third element of Vector3. | |
Public Member Functions inherited from OpenMD::Vector< Real, 3 > | |
Vector () | |
default constructor | |
Vector (const Vector< Real, Dim > &v) | |
Constructs and initializes a Vector from a vector. | |
Vector (const Real &s) | |
Vector (Real *v) | |
Constructs and initializes a Vector from an array. | |
Vector< Real, Dim > & | operator= (const Vector< Real, Dim > &v) |
copy assignment operator | |
Vector< Real, Dim > & | operator= (const Real *v) |
array assignment operator | |
Real & | operator[] (unsigned int i) |
Returns reference of ith element. | |
const Real & | operator[] (unsigned int i) const |
Returns constant reference of ith element. | |
Real & | operator() (unsigned int i) |
Returns reference of ith element. | |
const Real & | operator() (unsigned int i) const |
Returns constant reference of ith element. | |
void | getArray (Real *array) |
Copy the internal data to an array. | |
Real * | getArrayPointer () |
Returns the pointer of internal array. | |
bool | operator== (const Vector< Real, Dim > &v) |
Tests if this vetor is equal to other vector. | |
bool | operator!= (const Vector< Real, Dim > &v) |
Tests if this vetor is not equal to other vector. | |
void | zero () |
Zeros out the values in this vector in place. | |
void | negate () |
Negates the value of this vector in place. | |
void | negate (const Vector< Real, Dim > &v1) |
Sets the value of this vector to the negation of vector v1. | |
void | add (const Vector< Real, Dim > &v1) |
Sets the value of this vector to the sum of itself and v1 (*this += v1). | |
void | add (const Vector< Real, Dim > &v1, const Vector< Real, Dim > &v2) |
Sets the value of this vector to the sum of v1 and v2 (*this = v1 + v2). | |
void | sub (const Vector< Real, Dim > &v1) |
Sets the value of this vector to the difference of itself and v1 (*this -= v1). | |
void | sub (const Vector< Real, Dim > &v1, const Vector &v2) |
Sets the value of this vector to the difference of vector v1 and v2 (*this = v1 - v2). | |
void | mul (Real s) |
Sets the value of this vector to the scalar multiplication of itself (*this *= s). | |
void | mul (const Vector< Real, Dim > &v1, Real s) |
Sets the value of this vector to the scalar multiplication of vector v1 (*this = s * v1). | |
void | Vmul (const Vector< Real, Dim > &v1, const Vector< Real, Dim > &v2) |
Sets the elements of this vector to the multiplication of elements of two other vectors. | |
Vector< Real, Dim > & | abs () |
Real | max () |
void | div (Real s) |
Sets the value of this vector to the scalar division of itself (*this /= s ). | |
void | div (const Vector< Real, Dim > &v1, Real s) |
Sets the value of this vector to the scalar division of vector v1 (*this = v1 / s ). | |
void | Vdiv (const Vector< Real, Dim > &v1, const Vector< Real, Dim > &v2) |
Sets the elements of this vector to the division of elements of two other vectors. | |
Vector< Real, Dim > & | operator+= (const Vector< Real, Dim > &v1) |
Vector< Real, Dim > & | operator-= (const Vector< Real, Dim > &v1) |
Vector< Real, Dim > & | operator*= (Real s) |
Vector< Real, Dim > & | operator/= (Real s) |
Real | sum () |
Returns the sum of all elements of this vector. | |
Real | componentProduct () |
Returns the product of all elements of this vector. | |
Real | length () |
Returns the length of this vector. | |
Real | lengthSquare () |
Returns the squared length of this vector. | |
void | normalize () |
Normalizes this vector in place. | |
bool | isNormalized () |
Tests if this vector is normalized. | |
unsigned int | size () const |
Additional Inherited Members | |
Protected Attributes inherited from OpenMD::Vector< Real, 3 > | |
Real | data_ [Dim] |
Definition at line 67 of file Vector3.hpp.
using OpenMD::Vector3< Real >::ElemPoinerType = Real* |
Definition at line 70 of file Vector3.hpp.
using OpenMD::Vector3< Real >::ElemType = Real |
Definition at line 69 of file Vector3.hpp.
|
inline |
Definition at line 72 of file Vector3.hpp.
|
inline |
Constructs and initializes a Vector3 from x, y, z coordinates.
Definition at line 75 of file Vector3.hpp.
References OpenMD::Vector3< Real >::x(), OpenMD::Vector3< Real >::y(), and OpenMD::Vector3< Real >::z().
|
inline |
Constructs and initializes from an array.
Definition at line 82 of file Vector3.hpp.
|
inline |
Definition at line 84 of file Vector3.hpp.
|
inline |
Definition at line 86 of file Vector3.hpp.
|
inline |
Returns reference of the first element of Vector3.
Definition at line 96 of file Vector3.hpp.
Referenced by OpenMD::Sticky::calcForce(), OpenMD::cross(), OpenMD::Quaternion< Real >::fromAxisAngle(), OpenMD::Quaternion< Real >::fromShortestArc(), OpenMD::Quaternion< Real >::toAxisAngle(), OpenMD::Vector3< Real >::Vector3(), and OpenMD::Vlinear().
|
inline |
Returns the first element of Vector3.
Definition at line 102 of file Vector3.hpp.
|
inline |
Returns reference of the second element of Vector3.
Definition at line 108 of file Vector3.hpp.
Referenced by OpenMD::Sticky::calcForce(), OpenMD::cross(), OpenMD::Quaternion< Real >::fromAxisAngle(), OpenMD::Quaternion< Real >::fromShortestArc(), OpenMD::Quaternion< Real >::toAxisAngle(), OpenMD::Vector3< Real >::Vector3(), and OpenMD::Vlinear().
|
inline |
Returns the second element of Vector3.
Definition at line 114 of file Vector3.hpp.
|
inline |
Returns reference of the third element of Vector3.
Definition at line 120 of file Vector3.hpp.
Referenced by OpenMD::Sticky::calcForce(), OpenMD::cross(), OpenMD::Quaternion< Real >::fromAxisAngle(), OpenMD::Quaternion< Real >::fromShortestArc(), OpenMD::Quaternion< Real >::toAxisAngle(), OpenMD::Vector3< Real >::Vector3(), and OpenMD::Vlinear().
|
inline |
Returns the third element of Vector3.
Definition at line 126 of file Vector3.hpp.