OpenMD 3.2
Molecular Dynamics in the Open
Loading...
Searching...
No Matches
OpenMD::Vector3< Real > Class Template Reference
Inheritance diagram for OpenMD::Vector3< Real >:

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< Real, Dim > & operator= (const Vector< Real, Dim > &v)
 copy assignment operator
Real & operator[] (unsigned int i)
 Returns reference of ith element.
Real & operator() (unsigned int i)
 Returns reference of ith element.
void getArray (Real *array) const
 Copy the internal data to an array.
const Real * getArrayPointer () const
 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 add (const Vector< Real, Dim > &v1)
 Sets the value of this vector to the sum of itself and v1 (*this += v1).
void sub (const Vector< Real, Dim > &v1)
 Sets the value of this vector to the difference of itself and v1 (*this -= v1).
void mul (Real s)
 Sets the value of this vector to the scalar multiplication of itself (*this *= s).
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 () const
void div (Real s)
 Sets the value of this vector to the scalar division of itself (*this /= 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 () const
 Returns the sum of all elements of this vector.
Real componentProduct () const
 Returns the product of all elements of this vector.
Real length () const
 Returns the length of this vector.
Real lengthSquare () const
 Returns the squared length of this vector.
void normalize ()
 Normalizes this vector in place.
bool isNormalized () const
 Tests if this vector is normalized.
unsigned int size () const

Additional Inherited Members

Protected Attributes inherited from OpenMD::Vector< Real, 3 >
Real data_ [Dim]

Detailed Description

template<typename Real>
class OpenMD::Vector3< Real >

Definition at line 70 of file Vector3.hpp.

Member Typedef Documentation

◆ ElemPoinerType

template<typename Real>
using OpenMD::Vector3< Real >::ElemPoinerType = Real*

Definition at line 73 of file Vector3.hpp.

◆ ElemType

template<typename Real>
using OpenMD::Vector3< Real >::ElemType = Real

Definition at line 72 of file Vector3.hpp.

Constructor & Destructor Documentation

◆ Vector3() [1/4]

template<typename Real>
OpenMD::Vector3< Real >::Vector3 ( )
inline

Definition at line 75 of file Vector3.hpp.

◆ Vector3() [2/4]

template<typename Real>
OpenMD::Vector3< Real >::Vector3 ( Real x,
Real y,
Real z )
inline

Constructs and initializes a Vector3 from x, y, z coordinates.

Definition at line 78 of file Vector3.hpp.

◆ Vector3() [3/4]

template<typename Real>
OpenMD::Vector3< Real >::Vector3 ( Real * array)
inline

Constructs and initializes from an array.

Definition at line 85 of file Vector3.hpp.

◆ Vector3() [4/4]

template<typename Real>
OpenMD::Vector3< Real >::Vector3 ( const Vector< Real, 3 > & v)
inline

Definition at line 87 of file Vector3.hpp.

Member Function Documentation

◆ operator=()

template<typename Real>
Vector3< Real > & OpenMD::Vector3< Real >::operator= ( const Vector< Real, 3 > & v)
inline

Definition at line 89 of file Vector3.hpp.

◆ x() [1/2]

template<typename Real>
Real & OpenMD::Vector3< Real >::x ( )
inline

◆ x() [2/2]

template<typename Real>
Real OpenMD::Vector3< Real >::x ( ) const
inline

Returns the first element of Vector3.

Returns
the first element of Vector3

Definition at line 105 of file Vector3.hpp.

◆ y() [1/2]

template<typename Real>
Real & OpenMD::Vector3< Real >::y ( )
inline

◆ y() [2/2]

template<typename Real>
Real OpenMD::Vector3< Real >::y ( ) const
inline

Returns the second element of Vector3.

Returns
c the second element of Vector3

Definition at line 117 of file Vector3.hpp.

◆ z() [1/2]

template<typename Real>
Real & OpenMD::Vector3< Real >::z ( )
inline

◆ z() [2/2]

template<typename Real>
Real OpenMD::Vector3< Real >::z ( ) const
inline

Returns the third element of Vector3.

Returns
f the third element of Vector3

Definition at line 129 of file Vector3.hpp.


The documentation for this class was generated from the following file: