ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
fastor.hpp
1// This file is part of the ACTS project.
2//
3// Copyright (C) 2016 CERN for the benefit of the ACTS project
4//
5// This Source Code Form is subject to the terms of the Mozilla Public
6// License, v. 2.0. If a copy of the MPL was not distributed with this
7// file, You can obtain one at https://mozilla.org/MPL/2.0/.
8
9#pragma once
10
11// Project include(s).
12#include "algebra/impl/fastor_getter.hpp"
13#include "algebra/impl/fastor_matrix.hpp"
14#include "algebra/impl/fastor_types.hpp"
15#include "algebra/impl/fastor_vector.hpp"
16#include "detray/algebra/common/boolean.hpp"
17#include "detray/algebra/generic/generic.hpp"
18
19// Fastor include(s).
20#ifdef _MSC_VER
21#pragma warning(disable : 4244 4701 4702)
22#endif // MSVC
23#include <Fastor/Fastor.h>
24#ifdef _MSC_VER
25#pragma warning(default : 4244 4701 4702)
26#endif // MSVC
27
28namespace detray {
29
34template <std::size_t N, concepts::scalar S>
35constexpr bool operator==(const Fastor::Tensor<S, N>& lhs,
36 const Fastor::Tensor<S, N>& rhs) {
37 return Fastor::isequal(lhs, rhs, 0.f);
38}
39
42template <concepts::value V>
43struct fastor {
45 using value_type = V;
46
48 template <concepts::element T>
49 using simd = T;
50
52 using boolean = bool;
56 using index_type = algebra::fastor::index_type;
58 using transform3D = algebra::fastor::transform3<value_type>;
60 using point2D = algebra::fastor::point2<value_type>;
62 using point3D = algebra::fastor::point3<value_type>;
64 using vector2D = algebra::fastor::vector2<value_type>;
66 using vector3D = algebra::fastor::vector3<value_type>;
67
69 template <std::size_t ROWS, std::size_t COLS>
71 using matrix = algebra::fastor::matrix_type<value_type, ROWS, COLS>;
72};
73
74
75namespace getter {
76
79
80using algebra::fastor::storage::block;
81using algebra::fastor::storage::element;
82using algebra::fastor::storage::set_block;
83using algebra::fastor::storage::vector;
84
86
87} // namespace getter
88
89namespace vector {
90
93
94using algebra::fastor::math::cross;
95using algebra::fastor::math::dot;
96using algebra::fastor::math::eta;
97using algebra::fastor::math::norm;
98using algebra::fastor::math::normalize;
99using algebra::fastor::math::perp;
100using algebra::fastor::math::phi;
101using algebra::fastor::math::theta;
102
104
105} // namespace vector
106
107namespace matrix {
108
111
112using algebra::fastor::math::column_wise_cross;
113using algebra::fastor::math::column_wise_multiply;
114using algebra::fastor::math::determinant;
115using algebra::fastor::math::identity;
116using algebra::fastor::math::inverse;
117using algebra::fastor::math::outer_product;
118using algebra::fastor::math::set_identity;
119using algebra::fastor::math::set_zero;
120using algebra::fastor::math::transpose;
121using algebra::fastor::math::zero;
122
123using algebra::generic::math::cholesky_decomposition;
124using algebra::generic::math::cross_matrix;
125using algebra::generic::math::set_inplace_product_left;
126using algebra::generic::math::set_inplace_product_left_transpose;
127using algebra::generic::math::set_inplace_product_right;
128using algebra::generic::math::set_inplace_product_right_transpose;
129using algebra::generic::math::set_product;
130using algebra::generic::math::set_product_left_transpose;
131using algebra::generic::math::set_product_right_transpose;
132using algebra::generic::math::transposed_product;
133
135
136} // namespace matrix
137
138} // namespace detray
Detray include(s).
Definition array_operators.hpp:18
constexpr bool operator==(const Fastor::Tensor< S, N > &lhs, const Fastor::Tensor< S, N > &rhs)
Compare two Fastor vectors component-wise for exact equality.
Definition fastor.hpp:35
Define the plugin types.
Definition fastor.hpp:43
algebra::fastor::matrix_type< value_type, ROWS, COLS > matrix
Fixed-size matrix type with the requested dimensions.
Definition fastor.hpp:71
V value_type
Define scalar type.
Definition fastor.hpp:45
algebra::fastor::point3< value_type > point3D
Three-dimensional point type.
Definition fastor.hpp:62
algebra::fastor::vector2< value_type > vector2D
Two-dimensional vector type.
Definition fastor.hpp:64
bool boolean
Boolean type used for element-wise predicates.
Definition fastor.hpp:52
algebra::fastor::point2< value_type > point2D
Two-dimensional point type.
Definition fastor.hpp:60
algebra::fastor::index_type index_type
Index type used for matrix and vector access.
Definition fastor.hpp:56
algebra::fastor::vector3< value_type > vector3D
Three-dimensional vector type.
Definition fastor.hpp:66
T simd
Backend vectorized representation of an element type.
Definition fastor.hpp:49
value_type scalar
Scalar type represented by this backend.
Definition fastor.hpp:54
algebra::fastor::transform3< value_type > transform3D
Three-dimensional transform type.
Definition fastor.hpp:58