#include <bloom_filter.hpp>
Definition at line 46 of file bloom_filter.hpp.
◆ bloom_parameters()
fc::bloom_parameters::bloom_parameters |
( |
| ) |
|
|
inline |
Definition at line 50 of file bloom_filter.hpp.
52 maximum_size(std::numeric_limits<unsigned long long int>::max()),
58 {}
unsigned long long int maximum_size
unsigned long long int random_seed
unsigned long long int projected_element_count
double false_positive_probability
unsigned int maximum_number_of_hashes
unsigned int minimum_number_of_hashes
unsigned long long int minimum_size
◆ ~bloom_parameters()
virtual fc::bloom_parameters::~bloom_parameters |
( |
| ) |
|
|
inlinevirtual |
◆ compute_optimal_parameters()
virtual bool fc::bloom_parameters::compute_optimal_parameters |
( |
| ) |
|
|
inlinevirtual |
Definition at line 109 of file bloom_filter.hpp.
110 {
111
112
113
114
115
116
117
118
119 if (!(*this))
120 return false;
121
122 double min_m = std::numeric_limits<double>::infinity();
123 double min_k = 0.0;
124 double curr_m = 0.0;
125 double k = 1.0;
126
127 while (k < 1000.0)
128 {
131 curr_m = numerator / denominator;
132 if (curr_m < min_m)
133 {
134 min_m = curr_m;
135 min_k = k;
136 }
137 k += 1.0;
138 }
139
141
143 optp.table_size = static_cast<unsigned long long int>(min_m);
144 optp.table_size += (((optp.table_size % bits_per_char) != 0) ? (bits_per_char - (optp.table_size % bits_per_char)) : 0);
145
150
155
156 return true;
157 }
optimal_parameters_t optimal_parameters
unsigned int number_of_hashes
◆ operator!()
bool fc::bloom_parameters::operator! |
( |
| ) |
|
|
inline |
Definition at line 63 of file bloom_filter.hpp.
64 {
73 (0xFFFFFFFFFFFFFFFFULL == random_seed);
74 }
◆ false_positive_probability
double fc::bloom_parameters::false_positive_probability |
◆ maximum_number_of_hashes
unsigned int fc::bloom_parameters::maximum_number_of_hashes |
◆ maximum_size
unsigned long long int fc::bloom_parameters::maximum_size |
◆ minimum_number_of_hashes
unsigned int fc::bloom_parameters::minimum_number_of_hashes |
◆ minimum_size
unsigned long long int fc::bloom_parameters::minimum_size |
◆ optimal_parameters
◆ projected_element_count
unsigned long long int fc::bloom_parameters::projected_element_count |
◆ random_seed
unsigned long long int fc::bloom_parameters::random_seed |
The documentation for this class was generated from the following file: