Skylark (Sketching Library)
0.1
|
00001 #ifndef SKYLARK_MMT_DATA_HPP 00002 #define SKYLARK_MMT_DATA_HPP 00003 00004 #ifndef SKYLARK_SKETCH_HPP 00005 #error "Include top-level sketch.hpp instead of including individuals headers" 00006 #endif 00007 00008 #include "../utility/distributions.hpp" 00009 00010 namespace skylark { namespace sketch { 00011 00021 struct MMT_data_t : public hash_transform_data_t< 00022 boost::random::uniform_int_distribution, 00023 boost::random::cauchy_distribution > { 00024 00025 typedef hash_transform_data_t< 00026 boost::random::uniform_int_distribution, 00027 boost::random::cauchy_distribution > base_t; 00028 00030 struct params_t : public sketch_params_t { 00031 00032 }; 00033 00034 MMT_data_t(int N, int S, base::context_t& context) 00035 : base_t(N, S, context, "MMT") { 00036 00037 context = base_t::build(); 00038 } 00039 00040 MMT_data_t(int N, int S, const params_t& params, base::context_t& context) 00041 : base_t(N, S, context, "MMT") { 00042 00043 context = base_t::build(); 00044 } 00045 00046 MMT_data_t(const boost::property_tree::ptree& pt) : 00047 base_t(pt.get<int>("N"), pt.get<int>("S"), 00048 base::context_t(pt.get_child("creation_context")), "MMT") { 00049 base_t::build(); 00050 } 00051 00057 virtual 00058 boost::property_tree::ptree to_ptree() const { 00059 boost::property_tree::ptree pt; 00060 sketch_transform_data_t::add_common(pt); 00061 return pt; 00062 } 00063 00064 protected: 00065 00066 MMT_data_t(int N, int S, const base::context_t& context, 00067 std::string type) 00068 : base_t(N, S, context, type) { 00069 00070 } 00071 00072 }; 00073 00074 } } 00076 #endif // SKYLARK_MMT_DATA_HPP