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

Class PruneRange

src/clsparseTimer/clsparseTimer-device.cpp:90–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88// Currently, RangeType is expected to be a floating point type, and ValType an integer type
89template< typename T, typename R >
90struct PruneRange: public std::binary_function < T, R, bool >
91{
92 R lower, upper;
93
94 PruneRange( R mean, R stdev ): lower( mean - stdev ), upper( mean + stdev )
95 {
96 }
97
98 bool operator( )( T val )
99 {
100 // These comparisons can be susceptible to signed/unsigned casting problems
101 // This is why we cast ValType to RangeType, because RangeType should always be floating and signed
102 if( static_cast<R>( val ) < lower )
103 return true;
104 else if( static_cast<R>( val ) > upper )
105 return true;
106
107 return false;
108 }
109};
110
111// Template specialization for StatData datatypes

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected