Skylark (Sketching Library)  0.1
/var/lib/jenkins/jobs/Skylark/workspace/sketch/CWT_data.hpp
Go to the documentation of this file.
00001 #ifndef SKYLARK_CWT_DATA_HPP
00002 #define SKYLARK_CWT_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 
00023 struct CWT_data_t : public hash_transform_data_t<
00024     boost::random::uniform_int_distribution,
00025     utility::rademacher_distribution_t > {
00026 
00027     typedef hash_transform_data_t<
00028         boost::random::uniform_int_distribution,
00029         utility::rademacher_distribution_t > base_t;
00030 
00032     struct params_t : public sketch_params_t {
00033 
00034     };
00035 
00036     CWT_data_t(int N, int S, base::context_t& context)
00037         : base_t(N, S, context, "CWT") {
00038 
00039         context = base_t::build();
00040     }
00041 
00042     CWT_data_t(int N, int S, const params_t& params, base::context_t& context)
00043         : base_t(N, S, context, "CWT") {
00044 
00045         context = base_t::build();
00046     }
00047 
00048     CWT_data_t(const boost::property_tree::ptree& pt) :
00049         base_t(pt.get<int>("N"), pt.get<int>("S"),
00050             base::context_t(pt.get_child("creation_context")), "CWT") {
00051         base_t::build();
00052     }
00053 
00060     virtual
00061     boost::property_tree::ptree to_ptree() const {
00062         boost::property_tree::ptree pt;
00063         sketch_transform_data_t::add_common(pt);
00064         return pt;
00065     }
00066 
00067 protected:
00068 
00069     CWT_data_t(int N, int S, const base::context_t& context, std::string type)
00070         : base_t(N, S, context, type) {
00071 
00072     }
00073 
00074 
00075 };
00076 
00077 } } 
00079 #endif // SKYLARK_CWT_DATA_HPP