Sha256: b7298287b4cd14926d1e87bd54748d5b9688a5a039c059fcd11ec407e2aa708c
Contents?: true
Size: 731 Bytes
Versions: 4
Compression:
Stored size: 731 Bytes
Contents
#ifndef RANDOM_SET_H #define RANDOM_SET_H #include "rice/Object.hpp" #include "rice/Array.hpp" using namespace Rice; #include <boost/random/mersenne_twister.hpp> #include <boost/random/uniform_int_distribution.hpp> #include <boost/unordered_set.hpp> #include <vector> #include <sys/time.h> class RandomSet { public: RandomSet(); void add(int element, double priority = 0.0); void remove(int element); Array sample(int limit); bool includes(int element); Array subtract(RandomSet &other, size_t limit); Array to_a(); size_t size(); boost::unordered_set<int> element_set; protected: std::vector<int> elements; boost::random::mt19937 rng; std::vector<int>::iterator iterator_to(int element); }; #endif
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
diff_set-0.0.4 | ext/diff_set/random_set.h |
diff_set-0.0.3 | ext/diff_set/random_set.h |
diff_set-0.0.2 | ext/diff_set/random_set.h |
diff_set-0.0.1-x86_64-darwin-13 | ext/diff_set/random_set.h |