Jpp  debug
the software that should make you happy
Public Member Functions | Public Attributes | List of all members
JTOOLS::JCollection< JElement_t, JDistance_t >::JComparator Struct Reference

Auxiliary class for ordering of objects in the collection by their abscissa values. More...

#include <JCollection.hh>

Public Member Functions

bool operator() (const JElement_t &first, const JElement_t &second) const
 Comparison of elements. More...
 
bool operator() (const JElement_t &element, typename JClass< abscissa_type >::argument_type x) const
 Comparison of element and abscissa value. More...
 

Public Attributes

JDistance_t getDistance
 Function object for distance evaluation. More...
 

Detailed Description

template<class JElement_t, class JDistance_t = JDistance<typename JElement_t::abscissa_type>>
struct JTOOLS::JCollection< JElement_t, JDistance_t >::JComparator

Auxiliary class for ordering of objects in the collection by their abscissa values.

Definition at line 105 of file JCollection.hh.

Member Function Documentation

◆ operator()() [1/2]

template<class JElement_t , class JDistance_t = JDistance<typename JElement_t::abscissa_type>>
bool JTOOLS::JCollection< JElement_t, JDistance_t >::JComparator::operator() ( const JElement_t &  first,
const JElement_t &  second 
) const
inline

Comparison of elements.

Parameters
firstfirst element
secondsecond element
Returns
true if first element less than second element; else false

Definition at line 113 of file JCollection.hh.

115  {
116  return this->getDistance(first.getX(), second.getX()) > 0.0;
117  }
JDistance_t getDistance
Function object for distance evaluation.
Definition: JCollection.hh:136

◆ operator()() [2/2]

template<class JElement_t , class JDistance_t = JDistance<typename JElement_t::abscissa_type>>
bool JTOOLS::JCollection< JElement_t, JDistance_t >::JComparator::operator() ( const JElement_t &  element,
typename JClass< abscissa_type >::argument_type  x 
) const
inline

Comparison of element and abscissa value.

Parameters
elementelement
xabscissa value
Returns
true if element less than abscissa value; else false

Definition at line 127 of file JCollection.hh.

128  {
129  return this->getDistance(element.getX(), x) > 0.0;
130  }

Member Data Documentation

◆ getDistance

template<class JElement_t , class JDistance_t = JDistance<typename JElement_t::abscissa_type>>
JDistance_t JTOOLS::JCollection< JElement_t, JDistance_t >::JComparator::getDistance

Function object for distance evaluation.

Definition at line 136 of file JCollection.hh.


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