ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
vc_aos.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/vc_aos_approximately_equal.hpp"
13#include "algebra/impl/vc_aos_getter.hpp"
14#include "algebra/impl/vc_aos_matrix.hpp"
15#include "algebra/impl/vc_aos_types.hpp"
16#include "algebra/impl/vc_aos_vector.hpp"
17#include "detray/algebra/common/boolean.hpp"
18#include "detray/algebra/generic/generic.hpp"
19
20// System include(s).
21#include <cassert>
22#include <type_traits>
23
24namespace detray {
25
28template <concepts::value V>
29struct vc_aos {
31 using value_type = V;
32
34 template <concepts::element T>
35 using simd = T;
36
38 using boolean = bool;
42 using index_type = algebra::vc_aos::index_type;
44 using transform3D = algebra::vc_aos::transform3<value_type>;
46 using point2D = algebra::vc_aos::point2<value_type>;
48 using point3D = algebra::vc_aos::point3<value_type>;
50 using vector2D = algebra::vc_aos::vector2<value_type>;
52 using vector3D = algebra::vc_aos::vector3<value_type>;
53
55 template <std::size_t ROWS, std::size_t COLS>
56 using matrix = algebra::vc_aos::matrix_type<value_type, ROWS, COLS>;
57};
58
59
60namespace getter {
61
64
65using algebra::vc_aos::storage::block;
66using algebra::vc_aos::storage::element;
67using algebra::vc_aos::storage::set_block;
68using algebra::vc_aos::storage::vector;
69
71
72} // namespace getter
73
74namespace vector {
75
78
79// Vc array specific
80using algebra::vc_aos::math::cross;
81using algebra::vc_aos::math::dot;
82using algebra::vc_aos::math::eta;
83using algebra::vc_aos::math::norm;
84using algebra::vc_aos::math::normalize;
85using algebra::vc_aos::math::perp;
86using algebra::vc_aos::math::phi;
87using algebra::vc_aos::math::theta;
88
90
91} // namespace vector
92
93// Use special algorithms for 4 dimensional matrices
94namespace algebra::generic {
95
96// Determinant algorithms
98template <concepts::scalar T, auto ROWS, auto COLS>
99struct determinant_selector<4, vc_aos::matrix_type<T, ROWS, COLS>,
100 vc_aos::element_getter> {
103 using type =
105};
106
107// Inversion algorithms
109template <concepts::scalar T, auto ROWS, auto COLS>
110struct inversion_selector<4, vc_aos::matrix_type<T, ROWS, COLS>,
111 vc_aos::element_getter> {
115};
116
117} // namespace algebra::generic
118
119namespace matrix {
120
123
124using algebra::vc_aos::math::determinant;
125using algebra::vc_aos::math::identity;
126using algebra::vc_aos::math::inverse;
127using algebra::vc_aos::math::set_identity;
128using algebra::vc_aos::math::set_zero;
129using algebra::vc_aos::math::transpose;
130using algebra::vc_aos::math::zero;
131
132using algebra::generic::math::cholesky_decomposition;
133using algebra::generic::math::column_wise_cross;
134using algebra::generic::math::column_wise_multiply;
135using algebra::generic::math::cross_matrix;
136using algebra::generic::math::outer_product;
137using algebra::generic::math::set_inplace_product_left;
138using algebra::generic::math::set_inplace_product_left_transpose;
139using algebra::generic::math::set_inplace_product_right;
140using algebra::generic::math::set_inplace_product_right_transpose;
141using algebra::generic::math::set_product;
142using algebra::generic::math::set_product_left_transpose;
143using algebra::generic::math::set_product_right_transpose;
144using algebra::generic::math::transposed_product;
145
147
148} // namespace matrix
149
150} // namespace detray
Detray include(s).
Definition array_operators.hpp:18
matrix::determinant::hard_coded< vc_aos::matrix_type< T, ROWS, COLS > > type
Closed-form determinant implementation selected for 4x4 matrices.
Definition vc_aos.hpp:103
Get the type of determinant algorithm according to matrix dimension.
Definition algorithm_selector.hpp:24
matrix::inverse::hard_coded< vc_aos::matrix_type< T, ROWS, COLS > > type
Closed-form inverse implementation selected for 4x4 matrices.
Definition vc_aos.hpp:114
Get the type of inversion algorithm according to matrix dimension.
Definition algorithm_selector.hpp:45
"Determinant getter", assuming a N X N matrix
Definition hard_coded.hpp:23
"inverse getter", assuming a N X N matrix
Definition hard_coded.hpp:24
Define the plugin types.
Definition vc_aos.hpp:29
algebra::vc_aos::matrix_type< value_type, ROWS, COLS > matrix
Fixed-size matrix type with the requested dimensions.
Definition vc_aos.hpp:56
algebra::vc_aos::point2< value_type > point2D
Two-dimensional point type.
Definition vc_aos.hpp:46
algebra::vc_aos::point3< value_type > point3D
Three-dimensional point type.
Definition vc_aos.hpp:48
bool boolean
Boolean value type for predicates in this backend.
Definition vc_aos.hpp:38
algebra::vc_aos::vector3< value_type > vector3D
Three-dimensional vector type.
Definition vc_aos.hpp:52
value_type scalar
Scalar element type.
Definition vc_aos.hpp:40
algebra::vc_aos::index_type index_type
Index type used to access fixed-size arrays and matrices.
Definition vc_aos.hpp:42
algebra::vc_aos::vector2< value_type > vector2D
Two-dimensional vector type.
Definition vc_aos.hpp:50
V value_type
Define scalar type.
Definition vc_aos.hpp:31
algebra::vc_aos::transform3< value_type > transform3D
Three-dimensional rigid transform type.
Definition vc_aos.hpp:44
T simd
SIMD scalar wrapper used by this scalar backend.
Definition vc_aos.hpp:35