25double FastLog2(int64_t
input) {
26#if defined(_MSC_VER) || defined(__ANDROID__)
27 return log(
static_cast<double>(
input)) / log(2.0L);
35 CHECK(cache_.empty());
37 cache_.resize(
size, 0.0);
38 for (
int i = 0; i <
size; ++i) {
39 cache_[i] = FastLog2(i + 1);
45 if (
input <= cache_.size()) {
46 return cache_[
input - 1];
48 return FastLog2(
input);
double Log2(int64_t input) const
Returns the log2 of 'input'.
void Init(int cache_size)
This method can only be called once, and with a cache_size > 0.
In SWIG mode, we don't want anything besides these top-level includes.
static int input(yyscan_t yyscanner)