CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Attributes
Matriplex::Matriplex< T, D1, D2, N > Class Template Reference

#include <Matriplex.h>

Public Types

typedef T value_type
 

Public Member Functions

T fArray [kTotSize__attribute__ ((aligned(64)))
 
void add (const Matriplex &v)
 
TAt (idx_t n, idx_t i, idx_t j)
 
const TconstAt (idx_t n, idx_t i, idx_t j) const
 
void copy (idx_t n, idx_t in)
 
void copyIn (idx_t n, const T *arr)
 
void copyIn (idx_t n, const Matriplex &m, idx_t in)
 
void copyOut (idx_t n, T *arr) const
 
void copySlot (idx_t n, const Matriplex &m)
 
 Matriplex ()
 
 Matriplex (T v)
 
Toperator() (idx_t n, idx_t i, idx_t j)
 
const Toperator() (idx_t n, idx_t i, idx_t j) const
 
Matriplexoperator= (const Matriplex &m)
 
T operator[] (idx_t xx) const
 
Toperator[] (idx_t xx)
 
idx_t plexSize () const
 
void scale (T scale)
 
void setVal (T v)
 
void slurpIn (const T *arr, int vi[N], const int N_proc=N)
 

Static Public Attributes

static constexpr int kCols = D2
 return no. of matrix columns More...
 
static constexpr int kRows = D1
 return no. of matrix rows More...
 
static constexpr int kSize = D1 * D2
 return no of elements: rows*columns More...
 
static constexpr int kTotSize = N * kSize
 size of the whole matriplex More...
 

Detailed Description

template<typename T, idx_t D1, idx_t D2, idx_t N>
class Matriplex::Matriplex< T, D1, D2, N >

Definition at line 11 of file Matriplex.h.

Member Typedef Documentation

◆ value_type

template<typename T, idx_t D1, idx_t D2, idx_t N>
typedef T Matriplex::Matriplex< T, D1, D2, N >::value_type

Definition at line 13 of file Matriplex.h.

Constructor & Destructor Documentation

◆ Matriplex() [1/2]

template<typename T, idx_t D1, idx_t D2, idx_t N>
Matriplex::Matriplex< T, D1, D2, N >::Matriplex ( )
inline

Definition at line 26 of file Matriplex.h.

26 {}

◆ Matriplex() [2/2]

template<typename T, idx_t D1, idx_t D2, idx_t N>
Matriplex::Matriplex< T, D1, D2, N >::Matriplex ( T  v)
inline

Definition at line 27 of file Matriplex.h.

Member Function Documentation

◆ __attribute__()

template<typename T, idx_t D1, idx_t D2, idx_t N>
T fArray [kTotSize] Matriplex::Matriplex< T, D1, D2, N >::__attribute__ ( (aligned(64))  )

◆ add()

template<typename T, idx_t D1, idx_t D2, idx_t N>
void Matriplex::Matriplex< T, D1, D2, N >::add ( const Matriplex< T, D1, D2, N > &  v)
inline

Definition at line 37 of file Matriplex.h.

Referenced by mkfit::MkFinder::bkFitFitTracks(), mkfit::MkFinder::bkFitFitTracksBH(), and counter.Counter::register().

37  {
38  for (idx_t i = 0; i < kTotSize; ++i) {
39  fArray[i] += v.fArray[i];
40  }
41  }
static constexpr int kTotSize
size of the whole matriplex
Definition: Matriplex.h:22

◆ At()

template<typename T, idx_t D1, idx_t D2, idx_t N>
T& Matriplex::Matriplex< T, D1, D2, N >::At ( idx_t  n,
idx_t  i,
idx_t  j 
)
inline

◆ constAt()

template<typename T, idx_t D1, idx_t D2, idx_t N>
const T& Matriplex::Matriplex< T, D1, D2, N >::constAt ( idx_t  n,
idx_t  i,
idx_t  j 
) const
inline

◆ copy()

template<typename T, idx_t D1, idx_t D2, idx_t N>
void Matriplex::Matriplex< T, D1, D2, N >::copy ( idx_t  n,
idx_t  in 
)
inline

Definition at line 82 of file Matriplex.h.

82  {
83  for (idx_t i = n; i < kTotSize; i += N, in += N) {
84  fArray[i] = fArray[in];
85  }
86  }
static constexpr int kTotSize
size of the whole matriplex
Definition: Matriplex.h:22
#define N
Definition: blowfish.cc:9

◆ copyIn() [1/2]

template<typename T, idx_t D1, idx_t D2, idx_t N>
void Matriplex::Matriplex< T, D1, D2, N >::copyIn ( idx_t  n,
const T arr 
)
inline

◆ copyIn() [2/2]

template<typename T, idx_t D1, idx_t D2, idx_t N>
void Matriplex::Matriplex< T, D1, D2, N >::copyIn ( idx_t  n,
const Matriplex< T, D1, D2, N > &  m,
idx_t  in 
)
inline

Definition at line 76 of file Matriplex.h.

76  {
77  for (idx_t i = n; i < kTotSize; i += N, in += N) {
78  fArray[i] = m[in];
79  }
80  }
static constexpr int kTotSize
size of the whole matriplex
Definition: Matriplex.h:22
#define N
Definition: blowfish.cc:9

◆ copyOut()

template<typename T, idx_t D1, idx_t D2, idx_t N>
void Matriplex::Matriplex< T, D1, D2, N >::copyOut ( idx_t  n,
T arr 
) const
inline

Definition at line 180 of file Matriplex.h.

Referenced by mkfit::MkFinder::bkFitOutputTracks(), mkfit::MkFinder::copy_out(), mkfit::MkFinder::copyOutParErr(), mkfit::MkFitter::outputFittedTracksAndHitIdx(), and mkfit::MkFitter::outputTracks().

180  {
181  for (idx_t i = n; i < kTotSize; i += N) {
182  *(arr++) = fArray[i];
183  }
184  }
static constexpr int kTotSize
size of the whole matriplex
Definition: Matriplex.h:22
#define N
Definition: blowfish.cc:9

◆ copySlot()

template<typename T, idx_t D1, idx_t D2, idx_t N>
void Matriplex::Matriplex< T, D1, D2, N >::copySlot ( idx_t  n,
const Matriplex< T, D1, D2, N > &  m 
)
inline

Definition at line 64 of file Matriplex.h.

Referenced by mkfit::propagateHelixToRMPlex().

64  {
65  for (idx_t i = n; i < kTotSize; i += N) {
66  fArray[i] = m.fArray[i];
67  }
68  }
static constexpr int kTotSize
size of the whole matriplex
Definition: Matriplex.h:22
#define N
Definition: blowfish.cc:9

◆ operator()() [1/2]

template<typename T, idx_t D1, idx_t D2, idx_t N>
T& Matriplex::Matriplex< T, D1, D2, N >::operator() ( idx_t  n,
idx_t  i,
idx_t  j 
)
inline

Definition at line 56 of file Matriplex.h.

56 { return fArray[(i * D2 + j) * N + n]; }
Divides< B, C > D2
Definition: Factorize.h:137
#define N
Definition: blowfish.cc:9

◆ operator()() [2/2]

template<typename T, idx_t D1, idx_t D2, idx_t N>
const T& Matriplex::Matriplex< T, D1, D2, N >::operator() ( idx_t  n,
idx_t  i,
idx_t  j 
) const
inline

Definition at line 57 of file Matriplex.h.

57 { return fArray[(i * D2 + j) * N + n]; }
Divides< B, C > D2
Definition: Factorize.h:137
#define N
Definition: blowfish.cc:9

◆ operator=()

template<typename T, idx_t D1, idx_t D2, idx_t N>
Matriplex& Matriplex::Matriplex< T, D1, D2, N >::operator= ( const Matriplex< T, D1, D2, N > &  m)
inline

Definition at line 59 of file Matriplex.h.

59  {
60  memcpy(fArray, m.fArray, sizeof(T) * kTotSize);
61  return *this;
62  }
static constexpr int kTotSize
size of the whole matriplex
Definition: Matriplex.h:22
long double T

◆ operator[]() [1/2]

template<typename T, idx_t D1, idx_t D2, idx_t N>
T Matriplex::Matriplex< T, D1, D2, N >::operator[] ( idx_t  xx) const
inline

Definition at line 49 of file Matriplex.h.

49 { return fArray[xx]; }

◆ operator[]() [2/2]

template<typename T, idx_t D1, idx_t D2, idx_t N>
T& Matriplex::Matriplex< T, D1, D2, N >::operator[] ( idx_t  xx)
inline

Definition at line 50 of file Matriplex.h.

50 { return fArray[xx]; }

◆ plexSize()

template<typename T, idx_t D1, idx_t D2, idx_t N>
idx_t Matriplex::Matriplex< T, D1, D2, N >::plexSize ( ) const
inline

Definition at line 29 of file Matriplex.h.

29 { return N; }
#define N
Definition: blowfish.cc:9

◆ scale()

template<typename T, idx_t D1, idx_t D2, idx_t N>
void Matriplex::Matriplex< T, D1, D2, N >::scale ( T  scale)
inline

Definition at line 43 of file Matriplex.h.

43  {
44  for (idx_t i = 0; i < kTotSize; ++i) {
45  fArray[i] *= scale;
46  }
47  }
static constexpr int kTotSize
size of the whole matriplex
Definition: Matriplex.h:22
void scale(T scale)
Definition: Matriplex.h:43

◆ setVal()

template<typename T, idx_t D1, idx_t D2, idx_t N>
void Matriplex::Matriplex< T, D1, D2, N >::setVal ( T  v)
inline

Definition at line 31 of file Matriplex.h.

Referenced by mkfit::MkFinder::bkFitFitTracks(), mkfit::MkFinder::bkFitInputTracks(), mkfit::helixAtRFromIterativeCCS(), mkfit::helixAtRFromIterativeCCSFullJac(), and mkfit::helixAtZ().

31  {
32  for (idx_t i = 0; i < kTotSize; ++i) {
33  fArray[i] = v;
34  }
35  }
static constexpr int kTotSize
size of the whole matriplex
Definition: Matriplex.h:22

◆ slurpIn()

template<typename T, idx_t D1, idx_t D2, idx_t N>
void Matriplex::Matriplex< T, D1, D2, N >::slurpIn ( const T arr,
int  vi[N],
const int  N_proc = N 
)
inline

Definition at line 161 of file Matriplex.h.

161  {
162  // Separate N_proc == N case (gains about 7% in fit test).
163  if (N_proc == N) {
164  for (int i = 0; i < kSize; ++i) {
165  for (int j = 0; j < N; ++j) {
166  fArray[i * N + j] = *(arr + i + vi[j]);
167  }
168  }
169  } else {
170  for (int i = 0; i < kSize; ++i) {
171  for (int j = 0; j < N_proc; ++j) {
172  fArray[i * N + j] = *(arr + i + vi[j]);
173  }
174  }
175  }
176  }
#define N
Definition: blowfish.cc:9
static constexpr int kSize
return no of elements: rows*columns
Definition: Matriplex.h:20

Member Data Documentation

◆ kCols

template<typename T, idx_t D1, idx_t D2, idx_t N>
constexpr int Matriplex::Matriplex< T, D1, D2, N >::kCols = D2
static

return no. of matrix columns

Definition at line 18 of file Matriplex.h.

◆ kRows

template<typename T, idx_t D1, idx_t D2, idx_t N>
constexpr int Matriplex::Matriplex< T, D1, D2, N >::kRows = D1
static

return no. of matrix rows

Definition at line 16 of file Matriplex.h.

◆ kSize

template<typename T, idx_t D1, idx_t D2, idx_t N>
constexpr int Matriplex::Matriplex< T, D1, D2, N >::kSize = D1 * D2
static

return no of elements: rows*columns

Definition at line 20 of file Matriplex.h.

◆ kTotSize

template<typename T, idx_t D1, idx_t D2, idx_t N>
constexpr int Matriplex::Matriplex< T, D1, D2, N >::kTotSize = N * kSize
static

size of the whole matriplex

Definition at line 22 of file Matriplex.h.