CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ProjectMatrix.h
Go to the documentation of this file.
1 #ifndef DataFormat_Math_ProjectMatrix_H
2 #define DataFormat_Math_ProjectMatrix_H
3 
4 #define SMATRIX_USE_CONSTEXPR
5 #include "Math/SMatrix.h"
6 
7 
8 
9 template<typename T, unsigned int N, unsigned int D>
11  typedef ROOT::Math::SMatrix<T,D,D,ROOT::Math::MatRepSym<T,D> > SMatDD;
12  typedef ROOT::Math::SMatrix<T,N,N > SMatNN;
13  typedef ROOT::Math::SMatrix<T,N,D > SMatND;
14 
15  // no constructor
16 
17  // H*S
18  SMatND project(SMatDD const & s) {
19  SMatND r;
20  for (unsigned int i=0; i<D; i++)
21  for (unsigned int j=0; j<D; j++)
22  r(index[i],j) = s(i,j);
23  return r;
24  }
25 
26  // K*H
27  SMatNN project(SMatND const & k) {
28  SMatNN s;
29  for (unsigned int i=0; i<N; i++)
30  for (unsigned int j=0; j<D; j++)
31  s(i,index[j]) = k(i,j);
32  return s;
33  }
34 
35  // S-K*H
36  void projectAndSubtractFrom(SMatNN & __restrict__ s, SMatND const & __restrict__ k) {
37  for (unsigned int i=0; i<N; i++)
38  for (unsigned int j=0; j<D; j++)
39  s(i,index[j]) -= k(i,j);
40  }
41 
42  // only H(i,index(i))=1.
43  unsigned int index[D];
44 
45 };
46 
47 
48 #endif
int i
Definition: DBlmapReader.cc:9
SMatND project(SMatDD const &s)
Definition: ProjectMatrix.h:18
ROOT::Math::SMatrix< T, N, N > SMatNN
Definition: ProjectMatrix.h:12
int j
Definition: DBlmapReader.cc:9
SMatNN project(SMatND const &k)
Definition: ProjectMatrix.h:27
void projectAndSubtractFrom(SMatNN &__restrict__ s, SMatND const &__restrict__ k)
Definition: ProjectMatrix.h:36
int k[5][pyjets_maxn]
#define N
Definition: blowfish.cc:9
ROOT::Math::SMatrix< T, D, D, ROOT::Math::MatRepSym< T, D > > SMatDD
Definition: ProjectMatrix.h:11
unsigned int index[D]
Definition: ProjectMatrix.h:43
ROOT::Math::SMatrix< T, N, D > SMatND
Definition: ProjectMatrix.h:13
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:150