OpenMPCD
Public Types | Public Member Functions | List of all members
OpenMPCD::Vector2D< T > Class Template Reference

2-dimensional vector. More...

#include <Vector2D.hpp>

Public Types

typedef TypeTraits< T >::RealType RealType
 The real-value type matching T. More...
 

Public Member Functions

OPENMPCD_CUDA_HOST_AND_DEVICE Vector2D ()
 Constructs a vector from the default values of the T type. More...
 
OPENMPCD_CUDA_HOST_AND_DEVICE Vector2D (const T x_, const T y_)
 Constructs a vector from its coordinates. More...
 
OPENMPCD_CUDA_HOST_AND_DEVICEgetX () const
 Returns the x coordinate. More...
 
OPENMPCD_CUDA_HOST_AND_DEVICEgetY () const
 Returns the y coordinate. More...
 
const OPENMPCD_CUDA_HOST_AND_DEVICEdot (const Vector2D &rhs) const
 Returns the scalar product of this vector with the given vector. More...
 
OPENMPCD_CUDA_HOST_AND_DEVICE RealType getMagnitudeSquared () const
 Returns the square of the magnitude of this vector. More...
 
OPENMPCD_CUDA_HOST_AND_DEVICE RealType getMagnitude () const
 Returns the magnitude of this vector. More...
 
OPENMPCD_CUDA_HOST_AND_DEVICEgetCosineOfAngle (const Vector2D &rhs) const
 Returns the cosine of the angle between this vector and the given one. More...
 
OPENMPCD_CUDA_HOST_AND_DEVICEgetAngle (const Vector2D &rhs) const
 Returns the the angle between this vector and the given one. More...
 
OPENMPCD_CUDA_HOST_AND_DEVICE bool operator== (const Vector2D &rhs) const
 Equality operator. More...
 
OPENMPCD_CUDA_HOST_AND_DEVICE bool operator!= (const Vector2D &rhs) const
 Inequality operator. More...
 

Detailed Description

template<typename T>
class OpenMPCD::Vector2D< T >

2-dimensional vector.

Template Parameters
TThe underlying floating-point type.

Definition at line 34 of file Vector2D.hpp.

Member Typedef Documentation

◆ RealType

template<typename T >
typedef TypeTraits<T>::RealType OpenMPCD::Vector2D< T >::RealType

The real-value type matching T.

Definition at line 37 of file Vector2D.hpp.

Constructor & Destructor Documentation

◆ Vector2D() [1/2]

template<typename T >
OPENMPCD_CUDA_HOST_AND_DEVICE OpenMPCD::Vector2D< T >::Vector2D ( )
inline

Constructs a vector from the default values of the T type.

Definition at line 45 of file Vector2D.hpp.

◆ Vector2D() [2/2]

template<typename T >
OPENMPCD_CUDA_HOST_AND_DEVICE OpenMPCD::Vector2D< T >::Vector2D ( const T  x_,
const T  y_ 
)
inline

Constructs a vector from its coordinates.

Parameters
[in]x_The x-coordinate.
[in]y_The y-coordinate.

Definition at line 56 of file Vector2D.hpp.

Member Function Documentation

◆ dot()

template<typename T >
const OPENMPCD_CUDA_HOST_AND_DEVICE T OpenMPCD::Vector2D< T >::dot ( const Vector2D< T > &  rhs) const
inline

Returns the scalar product of this vector with the given vector.

The scalar product is defines such that the left-hand-side's components are complex-conjugated prior to multiplication with the right-hand-side's components.

Parameters
[in]rhsThe right-hand-side.

Definition at line 91 of file Vector2D.hpp.

◆ getAngle()

template<typename T >
OPENMPCD_CUDA_HOST_AND_DEVICE T OpenMPCD::Vector2D< T >::getAngle ( const Vector2D< T > &  rhs) const
inline

Returns the the angle between this vector and the given one.

Parameters
[in]rhsThe right-hand-side vector.

Definition at line 153 of file Vector2D.hpp.

◆ getCosineOfAngle()

template<typename T >
OPENMPCD_CUDA_HOST_AND_DEVICE T OpenMPCD::Vector2D< T >::getCosineOfAngle ( const Vector2D< T > &  rhs) const
inline

Returns the cosine of the angle between this vector and the given one.

Template Parameters
ResultThe result type.
Parameters
[in]rhsThe right-hand-side vector.

Definition at line 124 of file Vector2D.hpp.

◆ getMagnitude()

template<typename T >
OPENMPCD_CUDA_HOST_AND_DEVICE RealType OpenMPCD::Vector2D< T >::getMagnitude ( ) const
inline

Returns the magnitude of this vector.

Definition at line 109 of file Vector2D.hpp.

◆ getMagnitudeSquared()

template<typename T >
OPENMPCD_CUDA_HOST_AND_DEVICE RealType OpenMPCD::Vector2D< T >::getMagnitudeSquared ( ) const
inline

Returns the square of the magnitude of this vector.

Definition at line 100 of file Vector2D.hpp.

◆ getX()

template<typename T >
OPENMPCD_CUDA_HOST_AND_DEVICE T OpenMPCD::Vector2D< T >::getX ( ) const
inline

Returns the x coordinate.

Definition at line 66 of file Vector2D.hpp.

◆ getY()

template<typename T >
OPENMPCD_CUDA_HOST_AND_DEVICE T OpenMPCD::Vector2D< T >::getY ( ) const
inline

Returns the y coordinate.

Definition at line 75 of file Vector2D.hpp.

◆ operator!=()

template<typename T >
OPENMPCD_CUDA_HOST_AND_DEVICE bool OpenMPCD::Vector2D< T >::operator!= ( const Vector2D< T > &  rhs) const
inline

Inequality operator.

Parameters
[in]rhsThe right-hand-side vector.

Definition at line 180 of file Vector2D.hpp.

◆ operator==()

template<typename T >
OPENMPCD_CUDA_HOST_AND_DEVICE bool OpenMPCD::Vector2D< T >::operator== ( const Vector2D< T > &  rhs) const
inline

Equality operator.

Parameters
[in]rhsThe right-hand-side vector.

Definition at line 169 of file Vector2D.hpp.


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