/usr/include/root/Math/TDataPointN.icc is in libroot-math-mathcore-dev 5.34.30-0ubuntu8.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | // @(#)root/mathcore:$Id: IFunction.h 24537 2008-06-25 11:01:23Z moneta $
// Authors: C. Gumpert 09/2011
/**********************************************************************
* *
* Copyright (c) 2011 , LCG ROOT MathLib Team *
* *
* *
**********************************************************************/
//
// impelmentation of template functions for TDataPointN class
//
#ifndef TDataPointN_ICC
#define TDataPointN_ICC
namespace ROOT
{
namespace Math
{
//////////////////////////////////////////////////////////////////////
//
// template<unsigned int _k,typename val_type> class TDataPointN
//
//////////////////////////////////////////////////////////////////////
//______________________________________________________________________________
template<typename _val_type>
TDataPointN<_val_type>::TDataPointN():
m_vCoordinates(0),
m_fWeight(1)
{
m_vCoordinates = new _val_type[kDimension];
for(UInt_t k = 0; k < kDimension; ++k)
m_vCoordinates[k] = 0;
}
//______________________________________________________________________________
#ifndef __MAKECINT__
template<typename _val_type>
template<typename _coord_type>
TDataPointN<_val_type>::TDataPointN(const _coord_type* pData,_val_type fWeight):
m_vCoordinates(0),
m_fWeight(fWeight)
{
// fill coordinates
m_vCoordinates = new _val_type[kDimension];
for(unsigned int i = 0; i < kDimension; ++i)
m_vCoordinates[i] = pData[i];
}
#endif
//______________________________________________________________________________
template<typename _val_type>
TDataPointN<_val_type>::~TDataPointN()
{
delete [] m_vCoordinates;
}
//______________________________________________________________________________
#ifndef __MAKECINT__
template<typename _val_type>
template<typename _val>
_val_type TDataPointN<_val_type>::Distance(const TDataPointN<_val>& rPoint) const
{
_val_type fDist2 = 0;
for(unsigned int i = 0; i < kDimension; ++i)
fDist2 += pow(GetCoordinate(i) - rPoint.GetCoordinate(i),2);
return sqrt(fDist2);
}
#endif
//______________________________________________________________________________
template<typename _val_type>
inline _val_type TDataPointN<_val_type>::GetCoordinate(unsigned int iAxis) const
{
assert(iAxis < kDimension);
return m_vCoordinates[iAxis];
}
//______________________________________________________________________________
template<typename _val_type>
inline void TDataPointN<_val_type>::SetCoordinate(unsigned int iAxis,_val_type fValue)
{
assert(iAxis < kDimension);
m_vCoordinates[iAxis] = fValue;
}
//______________________________________________________________________________
template<typename _val_type>
inline bool TDataPointN<_val_type>::Less(TDataPointN<_val_type>& rPoint,unsigned int iAxis) const
{
assert(iAxis < kDimension);
return (m_vCoordinates[iAxis] < rPoint.GetCoordinate(iAxis));
}
}//namespace Math
}//namespace ROOT
#endif //TDataPointN_ICC
|