File indexing completed on 2024-10-17 22:59:04
0001 #ifndef RecoTracker_MkFitCore_src_Matrix_h
0002 #define RecoTracker_MkFitCore_src_Matrix_h
0003
0004 #include "RecoTracker/MkFitCore/interface/Config.h"
0005 #include "RecoTracker/MkFitCore/interface/MatrixSTypes.h"
0006
0007 namespace mkfit {
0008
0009 inline float hipo(float x, float y) { return std::sqrt(x * x + y * y); }
0010
0011 inline float hipo_sqr(float x, float y) { return x * x + y * y; }
0012
0013 inline void sincos4(const float x, float& sin, float& cos) {
0014
0015
0016
0017 const float x2 = x * x;
0018 cos = 1.f - 0.5f * x2 + 0.04166667f * x2 * x2;
0019 sin = x - 0.16666667f * x * x2;
0020 }
0021 }
0022
0023
0024
0025
0026
0027
0028 #define MPLEX_VDT
0029
0030
0031
0032 #include "Matriplex/MatriplexSym.h"
0033
0034 #ifndef MPT_SIZE
0035 #if defined(__AVX512F__)
0036 #define MPT_SIZE 16
0037 #elif defined(__AVX__) || defined(__AVX2__)
0038 #define MPT_SIZE 8
0039 #elif defined(__SSE3__)
0040 #define MPT_SIZE 4
0041 #else
0042 #define MPT_SIZE 8
0043 #endif
0044 #endif
0045
0046 namespace mkfit {
0047
0048 constexpr Matriplex::idx_t NN = MPT_SIZE;
0049
0050 constexpr Matriplex::idx_t LL = 6;
0051 constexpr Matriplex::idx_t HH = 3;
0052
0053 typedef Matriplex::Matriplex<float, LL, LL, NN> MPlexLL;
0054 typedef Matriplex::Matriplex<float, LL, 1, NN> MPlexLV;
0055 typedef Matriplex::MatriplexSym<float, LL, NN> MPlexLS;
0056
0057 typedef Matriplex::Matriplex<float, HH, HH, NN> MPlexHH;
0058 typedef Matriplex::Matriplex<float, HH, 1, NN> MPlexHV;
0059 typedef Matriplex::MatriplexSym<float, HH, NN> MPlexHS;
0060
0061 typedef Matriplex::Matriplex<float, 5, 1, NN> MPlex5V;
0062 typedef Matriplex::MatriplexSym<float, 5, NN> MPlex5S;
0063
0064 typedef Matriplex::Matriplex<float, 5, 5, NN> MPlex55;
0065 typedef Matriplex::Matriplex<float, 5, 6, NN> MPlex56;
0066 typedef Matriplex::Matriplex<float, 6, 5, NN> MPlex65;
0067
0068 typedef Matriplex::Matriplex<float, 2, 2, NN> MPlex22;
0069 typedef Matriplex::Matriplex<float, 2, 1, NN> MPlex2V;
0070 typedef Matriplex::MatriplexSym<float, 2, NN> MPlex2S;
0071
0072 typedef Matriplex::Matriplex<float, LL, HH, NN> MPlexLH;
0073 typedef Matriplex::Matriplex<float, HH, LL, NN> MPlexHL;
0074
0075 typedef Matriplex::Matriplex<float, 5, 2, NN> MPlex52;
0076 typedef Matriplex::Matriplex<float, LL, 2, NN> MPlexL2;
0077 typedef Matriplex::Matriplex<float, HH, 2, NN> MPlexH2;
0078 typedef Matriplex::Matriplex<float, 2, HH, NN> MPlex2H;
0079
0080 typedef Matriplex::Matriplex<float, 1, 1, NN> MPlexQF;
0081 typedef Matriplex::Matriplex<int, 1, 1, NN> MPlexQI;
0082 typedef Matriplex::Matriplex<unsigned int, 1, 1, NN> MPlexQUI;
0083 typedef Matriplex::Matriplex<short, 1, 1, NN> MPlexQH;
0084 typedef Matriplex::Matriplex<unsigned short, 1, 1, NN> MPlexQUH;
0085
0086 typedef Matriplex::Matriplex<bool, 1, 1, NN> MPlexQB;
0087
0088 }
0089
0090 #endif