Jpp 19.3.0-rc.2
the software that should make you happy
Loading...
Searching...
No Matches
JTOOLS::JDistance< JAbscissa_t > Struct Template Reference

Template class for distance evaluation. More...

#include <JDistance.hh>

Public Types

typedef JLANG::JClass< JAbscissa_t >::argument_type argument_type
 

Public Member Functions

double operator() (argument_type first, argument_type second) const
 Get distance between values.
 

Static Public Attributes

static double precision = std::numeric_limits<double>::min()
 Default precision.
 

Detailed Description

template<class JAbscissa_t>
struct JTOOLS::JDistance< JAbscissa_t >

Template class for distance evaluation.

This class should be specialised for data types when the distance between two values is not equal to the arithmetic minus operation.

Definition at line 24 of file JDistance.hh.

Member Typedef Documentation

◆ argument_type

template<class JAbscissa_t >
JLANG::JClass<JAbscissa_t>::argument_type JTOOLS::JDistance< JAbscissa_t >::argument_type

Definition at line 26 of file JDistance.hh.

Member Function Documentation

◆ operator()()

template<class JAbscissa_t >
double JTOOLS::JDistance< JAbscissa_t >::operator() ( argument_type first,
argument_type second ) const
inline

Get distance between values.

The distance should be negative, zero or positive if the first value is respectively larger, equal or smaller compared to the second value.

Parameters
firstfirst value
secondsecond value
Returns
distance

Definition at line 39 of file JDistance.hh.

40 {
41 return second - first;
42 }

Member Data Documentation

◆ precision

template<class JAbscissa_t >
double JTOOLS::JDistance< JAbscissa_t >::precision = std::numeric_limits<double>::min()
static

Default precision.

Definition at line 44 of file JDistance.hh.


The documentation for this struct was generated from the following file: