HepMC3 event record library
|
Specialisation of Feature for integral types.
It is a valid operator to compare an int to a float, but the generic version of these operators in the base class will first cast input float to an int, then compare that. In some cases the comparison will be incorrect because of rounding the float. e.g. int x=5; float y=5.5; bool result = x<y; would be wrong because y first gets converted to int 5.
To solve this, we provide specialised comparison operators for integral type and double. Note that the opposite specialisation in which the Feature_type is floating_point is not necessary
#include <Feature.h>
Public Types | |
using | Evaluator_type |
evaluator type | |
using | EvaluatorPtr |
shared pointer for evaluator type | |
Public Member Functions | |
Feature (Evaluator_type functor) | |
Feature. | |
Feature (const Feature ©) | |
Feature. | |
Feature< Feature_type > | abs () const |
abs function | |
Filter | operator> (double value) const |
greater operator | |
Filter | operator< (double value) const |
less operator | |
Filter | operator== (double value) const |
equal operator | |
Filter | operator>= (double value) const |
greater or equal operator | |
Filter | operator<= (double value) const |
less or equal operator | |
Filter | operator!= (double value) const |
not equal operator | |
Feature (Evaluator_type functor) | |
Feature. | |
Feature (const Feature ©) | |
Copy. | |
Feature< Feature_type > | abs () const |
Abs function. | |
Feature_type | operator() (ConstGenParticlePtr input) const |
access the underlying feature value | |
Filter | operator> (Feature_type value) const |
greater than operator | |
Filter | operator< (Feature_type value) const |
less than operator | |
Filter | operator>= (Feature_type value) const |
greater than or equals operator | |
Filter | operator<= (Feature_type value) const |
less than or equals operator | |
virtual Filter | operator== (Feature_type value) const |
equality operator | |
virtual Filter | operator!= (Feature_type value) const |
inequality operator | |
Protected Attributes | |
EvaluatorPtr | m_internal |
internal copy of func for evaluation on the heap so will persist in resulting Filters even if parent Feature object was destroyed | |
using Evaluator_type |
using EvaluatorPtr |
|
inline |
Definition at line 229 of file Feature.h.
References GenericFeature< Feature_type >::GenericFeature().
|
inline |
Definition at line 231 of file Feature.h.
References Feature(), and GenericFeature< Feature_type >::GenericFeature().
|
inline |
|
inline |
|
inline |
abs function
Definition at line 234 of file Feature.h.
References Feature< Feature_type, Dummy >::Feature(), Feature(), and m_internal.
|
inline |
|
inlinevirtual |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinevirtual |
|
inline |
|
inline |
|
inline |
|
inline |
|
protected |