00001
00002 #ifndef LHCBMATH_MATRIXMANIP_H
00003 #define LHCBMATH_MATRIXMANIP_H 1
00004
00005
00006
00007 #include "Math/SMatrix.h"
00008
00016 namespace Gaudi
00017 {
00018
00019 namespace Math {
00020
00021 using namespace ROOT::Math;
00022
00033 template <typename M>
00034 SMatrix<typename M::value_type, M::kRows, M::kRows,
00035 MatRepSym<typename M::value_type, M::kRows> > Symmetrize(const M& rhs) {
00036
00037 SMatrix<typename M::value_type, M::kRows, M::kRows,
00038 MatRepSym<typename M::value_type, M::kRows> > result;
00039
00040 for ( unsigned int i = 0; i < M::kRows; ++i ) {
00041 for ( unsigned int j = 0; j < M::kRows; ++j ) {
00042 if (i<=j) result(i,j) = rhs(i,j);
00043 }
00044 }
00045 return result;
00046 }
00047
00048 }
00049 }
00050
00051 #endif // LHCB_MATRIXMANIP_H