MCPcopy Create free account
hub / github.com/QuEST-Kit/QuEST / util_getSum

Function util_getSum

quest/src/core/utilities.cpp:374–388  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

372 */
373
374qreal util_getSum(vector<qreal> list) {
375
376 qreal sum = 0;
377 qreal y, t, c=0;
378
379 // Kahan summation
380 for (auto& x : list) {
381 y = x - c;
382 t = sum + y;
383 c = ( t - sum ) - y;
384 sum = t;
385 }
386
387 return sum;
388}
389
390
391

Callers 2

validate_probabilitiesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected