ROOT logo
// @(#)root/mathcore:$Id$
// Authors: C. Gumpert    09/2011
/**********************************************************************
 *                                                                    *
 * Copyright (c) 2011 , LCG ROOT MathLib Team                         *
 *                                                                    *
 *                                                                    *
 **********************************************************************/
//
// Header file for TDataPointclass 
// 

#ifndef ROOT_Math_TDataPoint
#define ROOT_Math_TDataPoint

//ROOT include(s)
#include "Rtypes.h"


namespace ROOT
{
namespace Math
{


template<unsigned int K,typename _val_type = float>
class TDataPoint
{
public:
   typedef _val_type value_type;
   enum {
      kDimension = K //the dimensionality of this data point
   };
   static UInt_t Dimension() {return kDimension;}
   TDataPoint();
#ifndef __MAKECINT__      
   template<typename _coord_typ>
   TDataPoint(const _coord_typ* pData,_val_type fWeight = 1);
#endif      
   //virtual ~TDataPoint() {}
#ifndef __MAKECINT__
   template<typename _val>
   value_type   Distance(const TDataPoint<K,_val>& rPoint) const;
#endif      
   value_type   GetCoordinate(unsigned int iAxis) const;
   value_type   GetWeight() const {return m_fWeight;}
   Bool_t       Less(TDataPoint& rPoint,unsigned int iAxis) const;
   void         SetCoordinate(unsigned int iAxis,_val_type fValue);
   void         SetWeight(float fWeight) {m_fWeight = fWeight;}
       
private:       
   value_type   m_vCoordinates[K]; //coordinates
   value_type   m_fWeight;          //weight at this point
};

// some typedef definitions
typedef TDataPoint<1,Float_t>  TDataPoint1F;
typedef TDataPoint<2,Float_t>  TDataPoint2F;
typedef TDataPoint<3,Float_t>  TDataPoint3F;
typedef TDataPoint<1,Double_t> TDataPoint1D;
typedef TDataPoint<2,Double_t> TDataPoint2D;
typedef TDataPoint<3,Double_t> TDataPoint3D;

}//namespace Math
}//namespace ROOT

#include "Math/TDataPoint.icc"


#endif // ROOT_Math_TDataPoint
 TDataPoint.h:1
 TDataPoint.h:2
 TDataPoint.h:3
 TDataPoint.h:4
 TDataPoint.h:5
 TDataPoint.h:6
 TDataPoint.h:7
 TDataPoint.h:8
 TDataPoint.h:9
 TDataPoint.h:10
 TDataPoint.h:11
 TDataPoint.h:12
 TDataPoint.h:13
 TDataPoint.h:14
 TDataPoint.h:15
 TDataPoint.h:16
 TDataPoint.h:17
 TDataPoint.h:18
 TDataPoint.h:19
 TDataPoint.h:20
 TDataPoint.h:21
 TDataPoint.h:22
 TDataPoint.h:23
 TDataPoint.h:24
 TDataPoint.h:25
 TDataPoint.h:26
 TDataPoint.h:27
 TDataPoint.h:28
 TDataPoint.h:29
 TDataPoint.h:30
 TDataPoint.h:31
 TDataPoint.h:32
 TDataPoint.h:33
 TDataPoint.h:34
 TDataPoint.h:35
 TDataPoint.h:36
 TDataPoint.h:37
 TDataPoint.h:38
 TDataPoint.h:39
 TDataPoint.h:40
 TDataPoint.h:41
 TDataPoint.h:42
 TDataPoint.h:43
 TDataPoint.h:44
 TDataPoint.h:45
 TDataPoint.h:46
 TDataPoint.h:47
 TDataPoint.h:48
 TDataPoint.h:49
 TDataPoint.h:50
 TDataPoint.h:51
 TDataPoint.h:52
 TDataPoint.h:53
 TDataPoint.h:54
 TDataPoint.h:55
 TDataPoint.h:56
 TDataPoint.h:57
 TDataPoint.h:58
 TDataPoint.h:59
 TDataPoint.h:60
 TDataPoint.h:61
 TDataPoint.h:62
 TDataPoint.h:63
 TDataPoint.h:64
 TDataPoint.h:65
 TDataPoint.h:66
 TDataPoint.h:67
 TDataPoint.h:68
 TDataPoint.h:69
 TDataPoint.h:70