mirror of
https://github.com/zeek/zeek.git
synced 2025-10-06 16:48:19 +00:00
and const 2 more functions
This commit is contained in:
parent
c0f780c728
commit
ecc20b932a
2 changed files with 4 additions and 4 deletions
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
using namespace probabilistic;
|
using namespace probabilistic;
|
||||||
|
|
||||||
int CardinalityCounter::OptimalB(double error, double confidence)
|
int CardinalityCounter::OptimalB(double error, double confidence) const
|
||||||
{
|
{
|
||||||
double initial_estimate = 2 * (log(1.04) - log(error)) / log(2);
|
double initial_estimate = 2 * (log(1.04) - log(error)) / log(2);
|
||||||
int answer = (int) floor(initial_estimate);
|
int answer = (int) floor(initial_estimate);
|
||||||
|
@ -87,7 +87,7 @@ CardinalityCounter::~CardinalityCounter()
|
||||||
delete [] buckets;
|
delete [] buckets;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t CardinalityCounter::Rank(uint64 hash_modified)
|
uint8_t CardinalityCounter::Rank(uint64 hash_modified) const
|
||||||
{
|
{
|
||||||
uint8_t answer = 0;
|
uint8_t answer = 0;
|
||||||
|
|
||||||
|
|
|
@ -147,7 +147,7 @@ private:
|
||||||
*
|
*
|
||||||
* @return minimal B-value satisfying the error-rate under confidence.
|
* @return minimal B-value satisfying the error-rate under confidence.
|
||||||
*/
|
*/
|
||||||
int OptimalB(double error, double confidence);
|
int OptimalB(double error, double confidence) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determines at which index (counted from the back) the first one-bit
|
* Determines at which index (counted from the back) the first one-bit
|
||||||
|
@ -158,7 +158,7 @@ private:
|
||||||
*
|
*
|
||||||
* @returns index of first one-bit
|
* @returns index of first one-bit
|
||||||
*/
|
*/
|
||||||
uint8_t Rank(uint64 hash_modified);
|
uint8_t Rank(uint64 hash_modified) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the number of buckets that will be stored. The standard
|
* This is the number of buckets that will be stored. The standard
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue