| 80 | // Currently, RangeType is expected to be a floating point type, and ValType an integer type |
| 81 | template< typename T, typename R > |
| 82 | struct PruneRange: public std::binary_function< T, R, bool > |
| 83 | { |
| 84 | R lower, upper; |
| 85 | |
| 86 | PruneRange( R mean, R stdev ): lower( mean-stdev ), upper( mean+stdev ) {} |
| 87 | |
| 88 | bool operator( )( T val ) |
| 89 | { |
| 90 | // These comparisons can be susceptible to signed/unsigned casting problems |
| 91 | // This is why we cast ValType to RangeType, because RangeType should always be floating and signed |
| 92 | if( static_cast< R >( val ) < lower ) |
| 93 | return true; |
| 94 | else if( static_cast< R >( val ) > upper ) |
| 95 | return true; |
| 96 | |
| 97 | return false; |
| 98 | } |
| 99 | }; |
| 100 | |
| 101 | // Template specialization for StatData datatypes |
nothing calls this directly
no outgoing calls
no test coverage detected