class representing a data point
This class can be used for describing data points in a high-dimensional space. The (positive) dimension is specified by the first template parameter. The second template parameter can be used to tweak the precision of the stored coordinates. By default all coordinates are stored with 4 byte float precision. In addition to the coordinates a weight can be assigned to each data point allowing the representation of fields in high dimensions. Basic functionality for accessing/modifying the coordinates/weight are provided as well as a comparison method and the basic euclidean metric.
Definition at line 36 of file TDataPoint.h.
Public Types | |
enum | { kDimension = K } |
typedef _val_type | value_type |
Public Member Functions | |
TDataPoint () | |
standard constructor sets the weight to 1 and initialises all coordinates with 0 | |
template<typename _coord_typ > | |
TDataPoint (const _coord_typ *pData, _val_type fWeight=1) | |
constructor initialising the data point from an array | |
template<typename _val > | |
value_type | Distance (const TDataPoint< K, _val > &rPoint) const |
euclidean distance | |
value_type | GetCoordinate (unsigned int iAxis) const |
returns the coordinate at the given axis | |
value_type | GetWeight () const |
Bool_t | Less (TDataPoint &rPoint, unsigned int iAxis) const |
compares two points at a given axis | |
void | SetCoordinate (unsigned int iAxis, _val_type fValue) |
sets the coordinate along one axis | |
void | SetWeight (float fWeight) |
Static Public Member Functions | |
static UInt_t | Dimension () |
Private Attributes | |
value_type | m_fWeight = 1 |
weight at this point | |
value_type | m_vCoordinates [K] |
coordinates | |
#include <Math/TDataPoint.h>
typedef _val_type ROOT::Math::TDataPoint< K, _val_type >::value_type |
Definition at line 38 of file TDataPoint.h.
Enumerator | |
---|---|
kDimension |
Definition at line 39 of file TDataPoint.h.
|
inline |
standard constructor sets the weight to 1 and initialises all coordinates with 0
Definition at line 45 of file TDataPoint.h.
|
inline |
constructor initialising the data point from an array
Input: pData - array with kDimension coordinates fWeight - weight (default = 1)
Definition at line 59 of file TDataPoint.h.
|
inlinestatic |
Definition at line 42 of file TDataPoint.h.
|
inline |
euclidean distance
returns the euclidean distance to the given data point
Input: rPoint - data point of same dimensionality
Definition at line 74 of file TDataPoint.h.
|
inline |
returns the coordinate at the given axis
Input: iAxis - axis in the range of [0...kDimension-1]
Definition at line 86 of file TDataPoint.h.
|
inline |
Definition at line 91 of file TDataPoint.h.
|
inline |
compares two points at a given axis
returns: this_point.at(iAxis) < rPoint.at(iAxis)
Input: rPoint - second point to compare to (of same dimensionality) iAxis - axis in the range of [0...kDimension-1]
Definition at line 98 of file TDataPoint.h.
|
inline |
sets the coordinate along one axis
Input: iAxis - axis in the range of [0...kDimension-1] fValue - new coordinate
Definition at line 107 of file TDataPoint.h.
|
inline |
Definition at line 112 of file TDataPoint.h.
|
private |
weight at this point
Definition at line 116 of file TDataPoint.h.
|
private |
coordinates
Definition at line 115 of file TDataPoint.h.