12#include "detray/algebra/common/math.hpp"
13#include "detray/definitions/detail/qualifiers.hpp"
17#pragma warning(push, 0)
19#ifdef __NVCC_DIAG_PRAGMA_SUPPORT__
20#pragma nv_diagnostic push
21#pragma nv_diag_suppress 20012
27#ifdef __NVCC_DIAG_PRAGMA_SUPPORT__
28#pragma nv_diagnostic pop
31namespace detray::algebra::eigen::math {
34template <
typename derived_type>
35DETRAY_HOST_DEVICE
constexpr auto phi(
36 const Eigen::MatrixBase<derived_type> &v) {
37 return algebra::math::atan2(v[1], v[0]);
41template <
typename derived_type>
42DETRAY_HOST_DEVICE
constexpr auto perp(
43 const Eigen::MatrixBase<derived_type> &v) {
48template <
typename derived_type>
49DETRAY_HOST_DEVICE
constexpr auto theta(
50 const Eigen::MatrixBase<derived_type> &v) {
51 return algebra::math::atan2(perp(v), v[2]);
57template <
typename derived_type>
58DETRAY_HOST_DEVICE
constexpr auto norm(
59 const Eigen::MatrixBase<derived_type> &v) {
67template <
typename derived_type>
68 requires(Eigen::MatrixBase<derived_type>::RowsAtCompileTime >= 3)
69DETRAY_HOST_DEVICE
constexpr auto eta(
70 const Eigen::MatrixBase<derived_type> &v)
noexcept {
71 return algebra::math::atanh(v[2] / v.norm());
79template <
typename derived_type>
80DETRAY_HOST_DEVICE
constexpr auto normalize(
81 const Eigen::MatrixBase<derived_type> &v) {
82 return v.normalized();
94template <
typename derived_type_lhs,
typename derived_type_rhs>
95DETRAY_HOST_DEVICE
constexpr auto dot(
96 const Eigen::MatrixBase<derived_type_lhs> &a,
97 const Eigen::MatrixBase<derived_type_rhs> &b) {
110template <
typename derived_type_lhs,
typename derived_type_rhs>
111DETRAY_HOST_DEVICE
constexpr auto cross(
112 const Eigen::MatrixBase<derived_type_lhs> &a,
113 const Eigen::MatrixBase<derived_type_rhs> &b) {
constexpr decltype(auto) sqrt(T &&vec)
Definition vc_soa_math.hpp:78
constexpr decltype(auto) fma(T &&x, T &&y, T &&z)
Evaluate the fused multiply-add x * y + z lane by lane.
Definition vc_soa_math.hpp:168