n2p2 - A neural network potential package
|
Vector in 3 dimensional real space. More...
#include <Vec3D.h>
Public Member Functions | |
Vec3D () | |
Constructor, initializes to zero. More... | |
Vec3D (double x, double y, double z) | |
Constructor, with initialization of coordinates. More... | |
Vec3D (Vec3D const &source) | |
Copy constructor. More... | |
Vec3D (Vec3D &&source) | |
Move constructor. More... | |
Vec3D & | operator= (Vec3D const &rhs) |
Overload = operator. More... | |
Vec3D & | operator+= (Vec3D const &v) |
Overload += operator to implement in-place vector addition. More... | |
Vec3D & | operator-= (Vec3D const &v) |
Overload -= operator to implement in-place vector subtraction. More... | |
Vec3D & | operator*= (double const a) |
Overload *= operator to implement multiplication with scalar. More... | |
Vec3D & | operator/= (double const a) |
Overload /= operator to implement division by scalar. More... | |
double | operator* (Vec3D const &v) const |
Overload * operator to implement scalar product. More... | |
Vec3D & | operator*= (Vec3D const (&A)[3]) |
Overload * operator to implement (left) multiplication with a matrix defined as Vec3D A[3]. More... | |
double & | operator[] (std::size_t const index) |
Overload [] operator to return coordinate by index. More... | |
double const & | operator[] (std::size_t const index) const |
Overload [] operator to return coordinate by index (const version). More... | |
bool | operator== (Vec3D const &rhs) const |
Compare if vectors are equal. More... | |
bool | operator!= (Vec3D const &rhs) const |
Compare if vectors are not equal. More... | |
double | norm () const |
Calculate norm of vector. More... | |
double | norm2 () const |
Calculate square of norm of vector. More... | |
double | l1norm () const |
Calculate l1 norm of vector (taxicab metric). More... | |
Vec3D & | normalize () |
Normalize vector, norm equals 1.0 afterwards. More... | |
Vec3D | cross (Vec3D const &v) const |
Cross product, argument vector is second in product. More... | |
Public Attributes | |
double | r [3] |
cartesian coordinates. More... | |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Overload * operator to implement (left) multiplication with a matrix defined as Vec3D A[3].
By convention A[i][j] gives the element of j-th row and i-th column.
Definition at line 232 of file Vec3D.h.
References r.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Calculate square of norm of vector.
Definition at line 299 of file Vec3D.h.
References r.
Referenced by nnp::SymFncCompAngn::calculate(), nnp::SymFncCompAngnWeighted::calculate(), nnp::SymFncExpAngn::calculate(), nnp::SymFncExpAngnWeighted::calculate(), nnp::Structure::calculateNeighborList(), and nnp::KspaceGrid::setup().
|
inline |
|
inline |
Normalize vector, norm equals 1.0 afterwards.
Definition at line 309 of file Vec3D.h.
Referenced by nnp::KspaceGrid::calculatePbcCopies(), nnp::Structure::calculatePbcCopies(), and nnp::Structure::canMinimumImageConventionBeApplied().
Cross product, argument vector is second in product.
Definition at line 319 of file Vec3D.h.
References r.
Referenced by nnp::KspaceGrid::calculatePbcCopies(), nnp::Structure::calculatePbcCopies(), nnp::Structure::canMinimumImageConventionBeApplied(), and nnp::KspaceGrid::setup().
double nnp::Vec3D::r[3] |
cartesian coordinates.
Definition at line 32 of file Vec3D.h.
Referenced by nnp::SymGrpCompAngn::calculate(), nnp::SymGrpCompAngnWeighted::calculate(), nnp::SymGrpCompAngw::calculate(), nnp::SymGrpCompAngwWeighted::calculate(), nnp::SymGrpCompRad::calculate(), nnp::SymGrpCompRadWeighted::calculate(), nnp::SymGrpExpAngn::calculate(), nnp::SymGrpExpAngnWeighted::calculate(), nnp::SymGrpExpAngw::calculate(), nnp::SymGrpExpRad::calculate(), nnp::SymGrpExpRadWeighted::calculate(), cross(), l1norm(), norm(), norm2(), normalize(), operator*(), operator*=(), operator+=(), operator-=(), operator=(), operator==(), operator[](), nnp::Dataset::recvStructure(), nnp::Dataset::sendStructure(), and Vec3D().