|
||||
File indexing completed on 2025-01-18 09:10:45
0001 // This file is part of the ACTS project. 0002 // 0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project 0004 // 0005 // This Source Code Form is subject to the terms of the Mozilla Public 0006 // License, v. 2.0. If a copy of the MPL was not distributed with this 0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/. 0008 0009 #pragma once 0010 0011 // for GNU: ignore this specific warning, otherwise just include Eigen/Dense 0012 #if defined(__GNUC__) && !defined(__clang__) && !defined(__INTEL_COMPILER) 0013 #pragma GCC diagnostic push 0014 #pragma GCC diagnostic ignored "-Wmisleading-indentation" 0015 #if __GNUC__ >= 12 0016 #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" 0017 #endif 0018 #include <Eigen/Core> 0019 #include <Eigen/Geometry> 0020 #pragma GCC diagnostic pop 0021 #else 0022 #include <Eigen/Core> 0023 #include <Eigen/Geometry> 0024 #endif 0025 0026 namespace Acts { 0027 0028 /// @defgroup acts-algebra-types Vector/matrix types with a common scalar type 0029 /// 0030 /// These are the default vector/matrix types that should be used throughout the 0031 /// codebase. They all use the common Acts scalar type but support variable size 0032 /// either at compile- or runtime. 0033 /// 0034 /// Eigen does not have a distinct type for symmetric matrices. A typedef for 0035 /// fixed-size matrices is still defined to simplify definition (one template 0036 /// size vs two template size for generic matrices) and to clarify semantic 0037 /// meaning in interfaces. It also ensures that the matrix is square. However, 0038 /// the user is responsible for ensuring that the values are symmetric. 0039 /// 0040 /// Without a distinct type for symmetric matrices, there is no way to provide 0041 /// any conditions e.g. square size, for the dynamic-sized case. Consequently, 0042 /// no dynamic-sized symmetric matrix type is defined. Use the 0043 /// `ActsDynamicMatrix` instead. 0044 0045 template <unsigned int kSize> 0046 using ActsVector = Eigen::Matrix<double, kSize, 1>; 0047 0048 template <unsigned int kRows, unsigned int kCols> 0049 using ActsMatrix = Eigen::Matrix<double, kRows, kCols>; 0050 0051 template <unsigned int kSize> 0052 using ActsSquareMatrix = Eigen::Matrix<double, kSize, kSize>; 0053 0054 using ActsDynamicVector = Eigen::Matrix<double, Eigen::Dynamic, 1>; 0055 0056 using ActsDynamicMatrix = Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic>; 0057 0058 /// @defgroup coordinates-types Fixed-size vector/matrix types for coordinates 0059 /// 0060 /// These predefined types should always be used when handling coordinate 0061 /// vectors in different coordinate systems, i.e. on surfaces (2d), spatial 0062 /// position (3d), or space-time (4d). 0063 /// 0064 0065 // coordinate vectors 0066 using Vector2 = ActsVector<2>; 0067 using Vector3 = ActsVector<3>; 0068 using Vector4 = ActsVector<4>; 0069 0070 // square matrices e.g. for coordinate covariance matrices 0071 using SquareMatrix2 = ActsSquareMatrix<2>; 0072 using SquareMatrix3 = ActsSquareMatrix<3>; 0073 using SquareMatrix4 = ActsSquareMatrix<4>; 0074 0075 // pure translation transformations 0076 using Translation2 = Eigen::Translation<double, 2>; 0077 using Translation3 = Eigen::Translation<double, 3>; 0078 0079 // linear (rotation) matrices 0080 using RotationMatrix2 = SquareMatrix2; 0081 using RotationMatrix3 = SquareMatrix3; 0082 0083 // pure rotation defined by a rotation angle around a rotation axis 0084 using AngleAxis3 = Eigen::AngleAxis<double>; 0085 0086 // combined affine transformations. types are chosen for better data alignment: 0087 // - 2d affine compact stored as 2x3 matrix 0088 // - 3d affine stored as 4x4 matrix 0089 using Transform2 = Eigen::Transform<double, 2, Eigen::AffineCompact>; 0090 using Transform3 = Eigen::Transform<double, 3, Eigen::Affine>; 0091 0092 constexpr double s_transformEquivalentTolerance = 1e-9; 0093 0094 } // namespace Acts
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |