Logo ROOT   6.12/07
Reference Guide
TDataPointN.h
Go to the documentation of this file.
1 // @(#)root/mathcore:$Id$
2 // Authors: C. Gumpert 09/2011
3 /**********************************************************************
4  * *
5  * Copyright (c) 2011 , LCG ROOT MathLib Team *
6  * *
7  * *
8  **********************************************************************/
9 //
10 // Header file for TDataPointN class
11 //
12 
13 
14 #ifndef ROOT_Math_TDataPointN
15 #define ROOT_Math_TDataPointN
16 
17 //STL include(s)
18 #include <assert.h>
19 
20 //ROOT include(s)
21 #include "Rtypes.h"
22 
23 namespace ROOT
24 {
25 namespace Math
26 {
27 
28 
29 template<typename _val_type = float>
31 {
32 private:
34 
35 public:
36  typedef _val_type value_type;
37 
38  static UInt_t Dimension() {return kDimension;}
39  static void SetDimension(UInt_t dim) {assert(dim>0);kDimension=dim;}
40 
41  TDataPointN();
42 #ifndef __MAKECINT__
43  template<typename _coord_typ>
44  TDataPointN(const _coord_typ* pData,value_type fWeight = 1);
45  template<typename _val>
47 #endif
48  virtual ~TDataPointN();
49 
50 #ifndef __MAKECINT__
51  template<typename _val>
52  _val_type Distance(const TDataPointN<_val>& rPoint) const;
53 #endif
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;}
59 
60 private:
61  value_type* m_vCoordinates;
62  value_type m_fWeight;
63 };
64 
67 
68 }//namespace Math
69 }//namespace ROOT
70 
71 
72 #include "TDataPointN.icc"
73 
74 #endif // ROOT_Math_TDataPointN
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21
_val_type Distance(const TDataPointN< _val > &rPoint) const
Definition: TDataPointN.icc:65
static UInt_t kDimension
Definition: TDataPointN.h:33
_val_type GetCoordinate(unsigned int iAxis) const
Definition: TDataPointN.icc:77
void SetWeight(float fWeight)
Definition: TDataPointN.h:58
bool Less(TDataPointN &rPoint, unsigned int iAxis) const
Definition: TDataPointN.icc:93
PyObject * fValue
unsigned int UInt_t
Definition: RtypesCore.h:42
static void SetDimension(UInt_t dim)
Definition: TDataPointN.h:39
void SetCoordinate(unsigned int iAxis, value_type fValue)
Definition: TDataPointN.icc:85
Namespace for new Math classes and functions.
static UInt_t Dimension()
Definition: TDataPointN.h:38
value_type * m_vCoordinates
Definition: TDataPointN.h:61
_val_type GetWeight() const
Definition: TDataPointN.h:55