Jpp  16.0.0-rc.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JDistance.hh
Go to the documentation of this file.
1 #ifndef __JTOOLS__JDISTANCE__
2 #define __JTOOLS__JDISTANCE__
3 
4 #include <limits>
5 
6 #include "JLang/JClass.hh"
7 
8 /**
9  * \author mdejong
10  */
11 
12 namespace JTOOLS {}
13 namespace JPP { using namespace JTOOLS; }
14 
15 namespace JTOOLS {
16 
17  /**
18  * Template class for distance evaluation.
19  *
20  * This class should be specialised for data types when the distance
21  * between two values is not equal to the arithmetic minus operation.
22  */
23  template<class JAbscissa_t>
24  struct JDistance {
25 
27 
28 
29  /**
30  * Get distance between values.
31  *
32  * The distance should be negative, zero or positive if the first value
33  * is respectively larger, equal or smaller compared to the second value.
34  *
35  * \param first first value
36  * \param second second value
37  * \return distance
38  */
39  inline double operator()(argument_type first, argument_type second) const
40  {
41  return second - first;
42  }
43 
44  static double precision;
45  };
46 
47 
48  /**
49  * Default precision.
50  */
51  template<class JAbscissa_t>
52  double JDistance<JAbscissa_t>::precision = std::numeric_limits<double>::min();
53 }
54 
55 #endif
Template class for distance evaluation.
Definition: JDistance.hh:24
static double precision
Default precision.
Definition: JDistance.hh:44
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
JArgument< T >::argument_type argument_type
Definition: JClass.hh:82
double operator()(argument_type first, argument_type second) const
Get distance between values.
Definition: JDistance.hh:39
JLANG::JClass< JAbscissa_t >::argument_type argument_type
Definition: JDistance.hh:26