Logo ROOT  
Reference Guide
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Loading...
Searching...
No Matches
TDataPointN.icc
Go to the documentation of this file.
1// @(#)root/mathcore:$Id: IFunction.h 24537 2008-06-25 11:01:23Z moneta $
2// Authors: C. Gumpert 09/2011
3/**********************************************************************
4 * *
5 * Copyright (c) 2011 , LCG ROOT MathLib Team *
6 * *
7 * *
8 **********************************************************************/
9//
10// implementation of template functions for TDataPointN class
11//
12
13#ifndef TDataPointN_ICC
14#define TDataPointN_ICC
15
16namespace ROOT
17{
18namespace Math
19{
20
21
22//////////////////////////////////////////////////////////////////////
23//
24// template<unsigned int _k,typename val_type> class TDataPointN
25//
26//////////////////////////////////////////////////////////////////////
27
28//______________________________________________________________________________
29template<typename _val_type>
31 m_vCoordinates(nullptr),
32 m_fWeight(1)
33{
35 for(UInt_t k = 0; k < kDimension; ++k)
36 m_vCoordinates[k] = 0;
37}
38
39//______________________________________________________________________________
40#ifndef __MAKECINT__
41template<typename _val_type>
42template<typename _coord_type>
44 m_vCoordinates(0),
45 m_fWeight(fWeight)
46{
47 // fill coordinates
49 for(unsigned int i = 0; i < kDimension; ++i)
50 m_vCoordinates[i] = pData[i];
51}
52#endif
53
54//______________________________________________________________________________
55template<typename _val_type>
57{
58 delete [] m_vCoordinates;
59}
60
61//______________________________________________________________________________
62#ifndef __MAKECINT__
63template<typename _val_type>
64template<typename _val>
66{
67 _val_type fDist2 = 0;
68 for(unsigned int i = 0; i < kDimension; ++i)
69 fDist2 += pow(GetCoordinate(i) - rPoint.GetCoordinate(i),2);
70
71 return sqrt(fDist2);
72}
73#endif
74
75//______________________________________________________________________________
76template<typename _val_type>
78{
80 return m_vCoordinates[iAxis];
81}
82
83//______________________________________________________________________________
84template<typename _val_type>
86{
88 m_vCoordinates[iAxis] = fValue;
89}
90
91//______________________________________________________________________________
92template<typename _val_type>
94{
96 return (m_vCoordinates[iAxis] < rPoint.GetCoordinate(iAxis));
97}
98
99}//namespace Math
100}//namespace ROOT
101
102#endif //TDataPointN_ICC
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
constexpr Int_t kDimension
_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
value_type * m_vCoordinates
Definition TDataPointN.h:61
_val_type GetCoordinate(unsigned int iAxis) const
Namespace for new Math classes and functions.
VecExpr< UnaryOp< Sqrt< T >, VecExpr< A, T, D >, T >, T, D > sqrt(const VecExpr< A, T, D > &rhs)
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...