MCPcopy Create free account
hub / github.com/clMathLibraries/clBLAS / pruneOutliers

Method pruneOutliers

src/client/statisticalTimer.cpp:266–289  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

264}
265
266unsigned int
267StatisticalTimer::pruneOutliers( sTimerID id , double multiple )
268{
269 if( clkTicks.empty( ) )
270 return 0;
271
272 double mean = getMean( id );
273 double stdDev = getStdDev( id );
274
275 clkVector& clks = clkTicks.at( id );
276
277 // Look on p. 379, "The C++ Standard Library"
278 // std::remove_if does not actually erase, it only copies elements, it returns new 'logical' end
279 clkVector::iterator newEnd = std::remove_if( clks.begin( ), clks.end( ), PruneRange< double,unsigned long long >( mean, multiple*stdDev ) );
280
281 clkVector::difference_type dist = std::distance( newEnd, clks.end( ) );
282
283 if( dist != 0 )
284 clks.erase( newEnd, clks.end( ) );
285
286 assert( dist < std::numeric_limits< unsigned int >::max( ) );
287
288 return static_cast< unsigned int >( dist );
289}
290
291unsigned int
292StatisticalTimer::pruneOutliers( double multiple )

Callers 1

mainFunction · 0.80

Calls 2

beginMethod · 0.80
endMethod · 0.80

Tested by

no test coverage detected