1 #ifndef BARRY_COUNTERS_BONES_HPP
2 #define BARRY_COUNTERS_BONES_HPP 1
34 template <
typename Array_Type = BArray<>,
typename Data_Type =
bool>
64 std::string
name_ =
"",
65 std::string
desc_ =
""
80 double count(Array_Type & Array,
size_t i,
size_t j);
81 double init(Array_Type & Array,
size_t i,
size_t j);
107 template <
typename Array_Type = BArray<>,
typename Data_Type =
bool>
111 std::vector< Counter<Array_Type,Data_Type > > data;
175 std::string
name_ =
"",
176 std::string
desc_ =
""
191 const Array_Type & array,
A counter function based on change statistics.
double init(Array_Type &Array, size_t i, size_t j)
Hasher_fun_type< Array_Type, Data_Type > hasher_fun
Counter< Array_Type, Data_Type > operator=(const Counter< Array_Type, Data_Type > &counter_)
Copy assignment.
Counter< Array_Type, Data_Type > & operator=(Counter< Array_Type, Data_Type > &&counter_) noexcept
Move assignment.
Counter_fun_type< Array_Type, Data_Type > count_fun
std::string get_description() const
Counter(const Counter< Array_Type, Data_Type > &counter_)
Copy constructor.
double count(Array_Type &Array, size_t i, size_t j)
std::string get_name() const
void set_hasher(Hasher_fun_type< Array_Type, Data_Type > fun)
Get and set the hasher function.
Counter_fun_type< Array_Type, Data_Type > init_fun
Hasher_fun_type< Array_Type, Data_Type > get_hasher()
Counter(Counter_fun_type< Array_Type, Data_Type > count_fun_, Counter_fun_type< Array_Type, Data_Type > init_fun_, Hasher_fun_type< Array_Type, Data_Type > hasher_fun_, Data_Type data_, std::string name_="", std::string desc_="")
Counter(Counter< Array_Type, Data_Type > &&counter_) noexcept
Move constructor.
void add_counter(Counter_fun_type< Array_Type, Data_Type > count_fun_, Counter_fun_type< Array_Type, Data_Type > init_fun_, Hasher_fun_type< Array_Type, Data_Type > hasher_fun_, Data_Type data_, std::string name_="", std::string desc_="")
Counters(const Counters< Array_Type, Data_Type > &counter_)
Copy constructor.
Counter< Array_Type, Data_Type > & operator[](size_t idx)
Returns a pointer to a particular counter.
void add_hash(Hasher_fun_type< Array_Type, Data_Type > fun_)
Counters< Array_Type, Data_Type > & operator=(Counters< Array_Type, Data_Type > &&counter_) noexcept
Move assignment constructor.
std::vector< std::string > get_descriptions() const
Counters< Array_Type, Data_Type > operator=(const Counters< Array_Type, Data_Type > &counter_)
Copy assignment constructor.
std::vector< std::string > get_names() const
Counters(Counters< Array_Type, Data_Type > &&counters_) noexcept
Move constructor.
std::size_t size() const noexcept
Number of counters in the set.
void add_counter(Counter< Array_Type, Data_Type > counter)
std::vector< double > gen_hash(const Array_Type &array, bool add_dims=true)
Generates a hash for the given array according to the counters.
Data_Type &&counter_ data(std::move(counter_.data))
Data_Type Counter_fun_type< Array_Type, Data_Type > init_fun_
Data_Type Counter_fun_type< Array_Type, Data_Type > Hasher_fun_type< Array_Type, Data_Type > hasher_fun_
Data_Type Counter_fun_type< Array_Type, Data_Type > Hasher_fun_type< Array_Type, Data_Type > Data_Type std::string std::string desc_
Data_Type Counter_fun_type< Array_Type, Data_Type > Hasher_fun_type< Array_Type, Data_Type > Data_Type std::string name_
Data_Type &&counter_ noexcept
Data_Type Counter_fun_type< Array_Type, Data_Type > Hasher_fun_type< Array_Type, Data_Type > Data_Type data_
std::function< std::vector< double >(const Array_Type &, Data_Type *)> Hasher_fun_type
Hasher function used by the counter.
std::function< double(const Array_Type &, size_t, size_t, Data_Type &)> Counter_fun_type
Counter and rule functions.