OpenMPCD
Functions
OpenMPCD::Utility::MathematicalFunctions Namespace Reference

Defines common mathematical functions. More...

Functions

template<typename T >
OPENMPCD_CUDA_HOST_AND_DEVICEacos (const T x)
 Returns the arc cosine of the argument. More...
 
template<typename T >
OPENMPCD_CUDA_HOST_AND_DEVICEcos (const T x)
 Returns the cosine of the argument. More...
 
template<typename T >
OPENMPCD_CUDA_HOST_AND_DEVICEcospi (const T x)
 Returns the cosine of the product of the argument and \( \pi \). More...
 
template<typename T >
OPENMPCD_CUDA_HOST_AND_DEVICEsin (const T x)
 Returns the sine of the argument. More...
 
template<typename T >
OPENMPCD_CUDA_HOST_AND_DEVICEsinpi (const T x)
 Returns the sine of the product of the argument and \( \pi \). More...
 
template<typename T >
OPENMPCD_CUDA_HOST_AND_DEVICE void sincos (const T x, T *const s, T *const c)
 Computes both the sine and the cosine of the argument. More...
 
template<typename T >
OPENMPCD_CUDA_HOST_AND_DEVICE void sincospi (const T x, T *const s, T *const c)
 Computes both the sine and the cosine of the product of the argument and \( \pi \). More...
 
template<typename T >
OPENMPCD_CUDA_HOST_AND_DEVICEsqrt (const T x)
 Returns the sqaure root of the argument. More...
 

Detailed Description

Defines common mathematical functions.

Function Documentation

◆ acos()

template<typename T >
OPENMPCD_CUDA_HOST_AND_DEVICE T OpenMPCD::Utility::MathematicalFunctions::acos ( const T  x)

Returns the arc cosine of the argument.

Template Parameters
TThe data type to use.
Parameters
[in]xThe argument \( x \), which must be in the range \( \left[1, 1\right] \).
Returns
Returns \( \arccos \left( x \right) \).

◆ cos()

template<typename T >
OPENMPCD_CUDA_HOST_AND_DEVICE T OpenMPCD::Utility::MathematicalFunctions::cos ( const T  x)

Returns the cosine of the argument.

Template Parameters
TThe data type to use.
Parameters
[in]xThe argument \( x \).
Returns
Returns \( \cos \left( x \right) \).

◆ cospi()

template<typename T >
OPENMPCD_CUDA_HOST_AND_DEVICE T OpenMPCD::Utility::MathematicalFunctions::cospi ( const T  x)

Returns the cosine of the product of the argument and \( \pi \).

Template Parameters
TThe data type to use.
Parameters
[in]xThe argument \( x \).
Returns
Returns \( \cos \left( \pi x \right) \).

◆ sin()

template<typename T >
OPENMPCD_CUDA_HOST_AND_DEVICE T OpenMPCD::Utility::MathematicalFunctions::sin ( const T  x)

Returns the sine of the argument.

Template Parameters
TThe data type to use.
Parameters
[in]xThe argument \( x \).
Returns
Returns \( \sin \left( x \right) \).

◆ sincos()

template<typename T >
OPENMPCD_CUDA_HOST_AND_DEVICE void OpenMPCD::Utility::MathematicalFunctions::sincos ( const T  x,
T *const  s,
T *const  c 
)

Computes both the sine and the cosine of the argument.

Exceptions
OpenMPCD::NULLPointerExceptionIf OPENMPCD_DEBUG is defined, throws if s == nullptr or c == nullptr.
Template Parameters
TThe data type to use.
Parameters
[in]xThe argument \( x \).
[out]sWhere to store the sine of the argument, \( \sin \left( x \right) \). Must not be nullptr.
[out]cWhere to store the cosine of the argument, \( \cos \left( x \right) \). Must not be nullptr.

◆ sincospi()

template<typename T >
OPENMPCD_CUDA_HOST_AND_DEVICE void OpenMPCD::Utility::MathematicalFunctions::sincospi ( const T  x,
T *const  s,
T *const  c 
)

Computes both the sine and the cosine of the product of the argument and \( \pi \).

Exceptions
OpenMPCD::NULLPointerExceptionIf OPENMPCD_DEBUG is defined, throws if s == nullptr or c == nullptr.
Template Parameters
TThe data type to use.
Parameters
[in]xThe argument \( x \).
[out]sWhere to store the sine of the product of the argument and \( \pi \), \( \sin \left( x \pi \right) \). Must not be nullptr.
[out]cWhere to store the cosine of the product of the argument and \( \pi \), \( \cos \left( x \pi \right) \). Must not be nullptr.

◆ sinpi()

template<typename T >
OPENMPCD_CUDA_HOST_AND_DEVICE T OpenMPCD::Utility::MathematicalFunctions::sinpi ( const T  x)

Returns the sine of the product of the argument and \( \pi \).

Template Parameters
TThe data type to use.
Parameters
[in]xThe argument \( x \).
Returns
Returns \( \sin \left( \pi x \right) \).

◆ sqrt()

template<typename T >
OPENMPCD_CUDA_HOST_AND_DEVICE T OpenMPCD::Utility::MathematicalFunctions::sqrt ( const T  x)

Returns the sqaure root of the argument.

Template Parameters
TThe data type to use.
Parameters
[in]xThe argument \( x \).
Returns
Returns \( \sqrt{ x } \).