1 #ifndef GsfMatrixTools_h_
2 #define GsfMatrixTools_h_
4 #include "Math/SVector.h"
5 #include "Math/SMatrix.h"
7 namespace GsfMatrixTools {
15 template <
unsigned int N>
16 double trace (
const ROOT::Math::SMatrix<double, N, N>&
matrix) {
18 for (
unsigned int i=0;
i<
N;
i++ ) result +=
matrix(
i,
i);
26 template<
typename T,
unsigned int N>
27 double trace(ROOT::Math::SMatrix<
T,
N,
N,ROOT::Math::MatRepSym<T,N> >
const &
a,
28 ROOT::Math::SMatrix<
T,
N,
N,ROOT::Math::MatRepSym<T,N> >
const &
b) {
29 typedef typename ROOT::Math::SMatrix<T,N,N,ROOT::Math::MatRepSym<T,N> >::const_iterator CI;
37 for (;i1!=e1; i1++, i2++)
41 for (
unsigned int i=0;
i<
N;
i++)