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

Class PruneRange

src/benchmarks/clsparse-bench/src/statisticalTimer.cpp:49–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47// Currently, RangeType is expected to be a floating point type, and ValType an integer type
48template< typename RangeType, typename ValType >
49struct PruneRange
50{
51 RangeType lower, upper;
52
53 PruneRange( RangeType mean, RangeType stdev ): lower( mean-stdev ), upper( mean+stdev ) {}
54
55 bool operator( )( ValType val )
56 {
57 // These comparisons can be susceptible to signed/unsigned casting problems
58 // This is why we cast ValType to RangeType, because RangeType should always be floating and signed
59 if( static_cast< RangeType >( val ) < lower )
60 return true;
61 else if( static_cast< RangeType >( val ) > upper )
62 return true;
63
64 return false;
65 }
66};
67
68StatisticalTimer&

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected