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

Method getVariance

src/statTimer/statisticalTimer.CPU.cpp:264–283  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

262}
263
264cl_double
265CpuStatTimer::getVariance( size_t id ) const
266{
267 if( clkTicks.empty( ) )
268 return 0;
269
270 cl_double mean = getMean( id );
271
272 size_t N = clkTicks.at( id ).size( );
273 cl_double sum = 0;
274
275 for( cl_uint i = 0; i < N; ++i )
276 {
277 cl_double diff = clkTicks.at( id ).at( i ) - mean;
278 diff *= diff;
279 sum += diff;
280 }
281
282 return sum / N;
283}
284
285cl_double
286CpuStatTimer::getStdDev( size_t id ) const

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.80

Tested by

no test coverage detected