Skylark (Sketching Library)  0.1
/var/lib/jenkins/jobs/Skylark/workspace/sketch/RFUT_data.hpp
Go to the documentation of this file.
00001 #ifndef SKYLARK_RFUT_DATA_HPP
00002 #define SKYLARK_RFUT_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 <vector>
00009 
00010 #include "boost/foreach.hpp"
00011 #include "boost/property_tree/ptree.hpp"
00012 
00013 #include "../utility/randgen.hpp"
00014 
00015 namespace skylark { namespace sketch {
00016 
00021 template <typename ValueDistributionType>
00022 struct RFUT_data_t {
00023     // Only for consistency reasons
00024     typedef ValueDistributionType value_distribution_type;
00025 
00029     RFUT_data_t (int N, skylark::base::context_t& context)
00030         : _N(N), _creation_context(context) {
00031 
00032         build();
00033     }
00034 
00035     // TODO support to_ptree (challenging part: the distribution).
00036 
00037 protected:
00038     int _N; 
00040 
00041     const base::context_t _creation_context;
00042 
00043     std::vector<double> D; 
00045     base::context_t build() {
00046         base::context_t ctx = _creation_context;
00047 
00048         value_distribution_type distribution;
00049         D = ctx.generate_random_samples_array(_N, distribution);
00050 
00051         return ctx;
00052     }
00053 };
00054 
00055 } } 
00057 #endif