14 #ifndef ROOT_Math_TDataPointN
15 #define ROOT_Math_TDataPointN
29 template<
typename _val_type =
float>
33 static UInt_t kDimension;
36 typedef _val_type value_type;
38 static UInt_t Dimension() {
return kDimension;}
39 static void SetDimension(UInt_t dim) {assert(dim>0);kDimension=dim;}
43 template<
typename _coord_typ>
44 TDataPointN(
const _coord_typ* pData,value_type fWeight = 1);
45 template<
typename _val>
46 TDataPointN(
const TDataPointN<_val>&);
48 virtual ~TDataPointN();
51 template<
typename _val>
52 _val_type Distance(
const TDataPointN<_val>& rPoint)
const;
54 _val_type GetCoordinate(
unsigned int iAxis)
const;
55 _val_type GetWeight()
const {
return m_fWeight;}
56 bool Less(TDataPointN& rPoint,
unsigned int iAxis)
const;
57 void SetCoordinate(
unsigned int iAxis,value_type fValue);
58 void SetWeight(
float fWeight) {m_fWeight = fWeight;}
61 value_type* m_vCoordinates;
65 template<> UInt_t TDataPointN<Float_t>::kDimension = 0;
66 template<> UInt_t TDataPointN<Double_t>::kDimension = 0;
74 #endif // ROOT_Math_TDataPointN