implement merging for top-k.

I am not (entirely) sure that this is mathematically correct, but
I am (more and more) getting the feeling that it... might be.

In any case - this was the last step and now it should work
in cluster settings.
This commit is contained in:
Bernhard Amann 2013-04-24 06:17:51 -07:00
parent 6f863d2259
commit 2f48008c42
7 changed files with 173 additions and 8 deletions

View file

@ -22,3 +22,10 @@ hook observe_hook(r: Reducer, val: double, obs: Observation, rv: ResultVal)
}
hook compose_resultvals_hook(result: ResultVal, rv1: ResultVal, rv2: ResultVal)
{
result$topk = topk_init(500);
topk_merge(result$topk, rv1$topk);
topk_merge(result$topk, rv2$topk);
}