MCPcopy Create free account
hub / github.com/clMathLibraries/clFFT / PruneRange

Class PruneRange

src/statTimer/statisticalTimer.GPU.cpp:82–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80// Currently, RangeType is expected to be a floating point type, and ValType an integer type
81template< typename T, typename R >
82struct 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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected