14 #ifndef ROOT_TDataPoint_ICC
15 #define ROOT_TDataPoint_ICC
17 #ifndef ROOT_Math_TDataPoint
18 #error "Do not use TDataPoint.icc directly. #include \"TDataPoint.h\" instead."
19 #endif // ROOT_Math_TDataPoint
45 template<
unsigned int K,
typename _val_type>
46 TDataPoint<K,_val_type>::TDataPoint():
54 assert(kDimension > 0);
56 for(UInt_t k = 0; k < K; ++k)
57 m_vCoordinates[k] = 0;
62 template<
unsigned int K,
typename _val_type>
63 template<
typename _coord_type>
64 TDataPoint<K,_val_type>::TDataPoint(
const _coord_type* pData,_val_type fWeight):
73 assert(kDimension > 0);
75 for(
unsigned int i = 0; i < kDimension; ++i)
76 m_vCoordinates[i] = pData[i];
80 template<
unsigned int K,
typename _val_type>
81 template<
typename _val>
82 _val_type TDataPoint<K,_val_type>::Distance(
const TDataPoint<K,_val>& rPoint)
const
91 for(
unsigned int i = 0; i < kDimension; ++i)
92 fDist2 += pow(GetCoordinate(i) - rPoint.GetCoordinate(i),2);
99 template<
unsigned int K,
typename _val_type>
100 inline _val_type TDataPoint<K,_val_type>::GetCoordinate(
unsigned int iAxis)
const
106 assert(iAxis < kDimension);
107 return m_vCoordinates[iAxis];
111 template<
unsigned int K,
typename _val_type>
112 inline void TDataPoint<K,_val_type>::SetCoordinate(
unsigned int iAxis,_val_type fValue)
119 assert(iAxis < kDimension);
120 m_vCoordinates[iAxis] = fValue;
124 template<
unsigned int K,
typename _val_type>
125 inline Bool_t TDataPoint<K,_val_type>::Less(TDataPoint<K,_val_type>& rPoint,
unsigned int iAxis)
const
134 assert(iAxis < kDimension);
135 return (m_vCoordinates[iAxis] < rPoint.GetCoordinate(iAxis));
142 #endif //ROOT_TDataPoint_ICC