Skylark (Sketching Library)  0.1
/var/lib/jenkins/jobs/Skylark/workspace/sketch/JLT_data.hpp
Go to the documentation of this file.
00001 #ifndef SKYLARK_JLT_DATA_HPP
00002 #define SKYLARK_JLT_DATA_HPP
00003 
00004 #ifndef SKYLARK_SKETCH_HPP
00005 #error "Include top-level sketch.hpp instead of including individuals headers"
00006 #endif
00007 
00008 namespace skylark { namespace sketch {
00009 
00010 namespace bstrand = boost::random;
00011 
00017 struct JLT_data_t :
00018    public dense_transform_data_t<bstrand::normal_distribution> {
00019 
00020     typedef dense_transform_data_t<bstrand::normal_distribution> base_t;
00021 
00023     struct params_t : public sketch_params_t {
00024 
00025     };
00026 
00027     JLT_data_t(int N, int S, skylark::base::context_t& context)
00028         : base_t(N, S, sqrt(1.0 / static_cast<double>(S)), context, "JLT") {
00029 
00030         context = base_t::build();
00031     }
00032 
00033     JLT_data_t(int N, int S, const params_t& params,
00034         skylark::base::context_t& context)
00035         : base_t(N, S, sqrt(1.0 / static_cast<double>(S)), context, "JLT") {
00036 
00037         context = base_t::build();
00038     }
00039 
00040     JLT_data_t(const boost::property_tree::ptree &pt) :
00041         base_t(pt.get<int>("N"), pt.get<int>("S"),
00042             sqrt(1.0 / pt.get<double>("S")),
00043             base::context_t(pt.get_child("creation_context")), "JLT") {
00044 
00045         base_t::build();
00046     }
00047 
00053     virtual
00054     boost::property_tree::ptree to_ptree() const {
00055         boost::property_tree::ptree pt;
00056         sketch_transform_data_t::add_common(pt);
00057         return pt;
00058     }
00059 
00060 protected:
00061 
00062     JLT_data_t(int N, int S, const skylark::base::context_t& context,
00063         std::string type)
00064         : base_t(N, S, sqrt(1.0 / static_cast<double>(S)), context, type) {
00065 
00066     }
00067 
00068 
00069 };
00070 
00071 } } 
00073 #endif // SKYLARK_JLT_DATA_HPP