1 #ifndef GsfMatrixTools_h_
2 #define GsfMatrixTools_h_
4 #define SMATRIX_USE_CONSTEXPR
6 #include "Math/SVector.h"
7 #include "Math/SMatrix.h"
9 namespace GsfMatrixTools {
17 template <
unsigned int N>
18 double trace (
const ROOT::Math::SMatrix<double, N, N>&
matrix) {
20 for (
unsigned int i=0;
i<
N;
i++ ) result +=
matrix(
i,
i);
28 template<
typename T,
unsigned int N>
29 double trace(ROOT::Math::SMatrix<
T,
N,
N,ROOT::Math::MatRepSym<T,N> >
const &
a,
30 ROOT::Math::SMatrix<
T,
N,
N,ROOT::Math::MatRepSym<T,N> >
const &
b) {
31 typedef typename ROOT::Math::SMatrix<T,N,N,ROOT::Math::MatRepSym<T,N> >::const_iterator CI;
39 for (;i1!=
e1; i1++, i2++)
43 for (
unsigned int i=0;
i<
N;
i++)