1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- #ifndef __HEAPSAMPLER_HPP__
- #define __HEAPSAMPLER_HPP__
- #include <vector>
- #include "mpcio.hpp"
- #include "coroutine.hpp"
- #include "heap.hpp"
- class HeapSampler {
-
- size_t k;
-
- size_t m;
-
-
- MinHeap heap;
-
- RegAS randtag;
-
- void make_randtag(MPCTIO &tio, yield_t &yield);
- public:
-
-
- HeapSampler(MPCTIO &tio, yield_t &yield, size_t k);
-
- void ingest(MPCTIO &tio, yield_t &yield, RegAS elt);
-
-
-
- std::vector<RegAS> close(MPCTIO &tio, yield_t &yield);
- };
- void heapsampler_test(MPCIO &mpcio, const PRACOptions &opts, char **args);
- void weighted_coin_test(MPCIO &mpcio, const PRACOptions &opts, char **args);
- #endif
|