CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
GsfMatrixTools Namespace Reference

Functions

template<unsigned int N>
double trace (const ROOT::Math::SMatrix< double, N, N > &matrix)
 
template<typename T , unsigned int N>
double trace (ROOT::Math::SMatrix< T, N, N, ROOT::Math::MatRepSym< T, N > > const &a, ROOT::Math::SMatrix< T, N, N, ROOT::Math::MatRepSym< T, N > > const &b)
 

Function Documentation

template<unsigned int N>
double GsfMatrixTools::trace ( const ROOT::Math::SMatrix< double, N, N > &  matrix)

Definition at line 16 of file GsfMatrixTools.h.

References i, makeMuonMisalignmentScenario::matrix, N, and query::result.

Referenced by Genexception::dump(), main(), edm::pythonToCppException(), and pythonToCppException().

16  {
17  double result(0.);
18  for ( unsigned int i=0; i<N; i++ ) result += matrix(i,i);
19  return result;
20  }
int i
Definition: DBlmapReader.cc:9
tuple result
Definition: query.py:137
#define N
Definition: blowfish.cc:9
template<typename T , unsigned int N>
double GsfMatrixTools::trace ( ROOT::Math::SMatrix< T, N, N, ROOT::Math::MatRepSym< T, N > > const &  a,
ROOT::Math::SMatrix< T, N, N, ROOT::Math::MatRepSym< T, N > > const &  b 
)

Definition at line 27 of file GsfMatrixTools.h.

References a, b, i, and N.

28  {
29  typedef typename ROOT::Math::SMatrix<T,N,N,ROOT::Math::MatRepSym<T,N> >::const_iterator CI;
30  CI i1 = a.begin();
31  CI e1 = a.end();
32  CI i2 = b.begin();
33  // CI e2 = b.end();
34 
35  T res =0;
36  // sum of the lower triangle;
37  for (;i1!=e1; i1++, i2++)
38  res += (*i1)*(*i2);
39  res *=2.;
40  // remove the duplicated diagonal...
41  for (unsigned int i=0;i<N;i++)
42  res -= a(i,i)*b(i,i);
43  return res;
44  }
int i
Definition: DBlmapReader.cc:9
#define N
Definition: blowfish.cc:9
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
long double T