Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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 <cassert>
19
20//ROOT include(s)
21#include "RtypesCore.h"
22
23namespace ROOT
24{
25namespace Math
26{
27
28
29template<typename _val_type = float>
31{
32private:
34
35public:
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
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
60private:
63};
64
65template <typename _val_type>
67
68}//namespace Math
69}//namespace ROOT
70
71
72#include "TDataPointN.icc"
73
74#endif // ROOT_Math_TDataPointN
unsigned int UInt_t
Definition RtypesCore.h:46
static void SetDimension(UInt_t dim)
Definition TDataPointN.h:39
_val_type Distance(const TDataPointN< _val > &rPoint) const
void SetCoordinate(unsigned int iAxis, value_type fValue)
bool Less(TDataPointN &rPoint, unsigned int iAxis) const
static UInt_t kDimension
Definition TDataPointN.h:33
void SetWeight(float fWeight)
Definition TDataPointN.h:58
TDataPointN(const _coord_typ *pData, value_type fWeight=1)
_val_type GetWeight() const
Definition TDataPointN.h:55
static UInt_t Dimension()
Definition TDataPointN.h:38
TDataPointN(const TDataPointN< _val > &)
value_type * m_vCoordinates
Definition TDataPointN.h:61
_val_type GetCoordinate(unsigned int iAxis) const
Namespace for new Math classes and functions.
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.