HyperLogLog Counter

# HyperLogLog Counter

This implements #233. A HyperLogLog counter is a probabilistic counter capable of cardinality estimation (how many unique elements appears in a dataset) with very low memory consumption. In khmer it can be useful to give better guesses for hash size parameters (-x and -N).

## References

- svpcom/hyperloglog@f91ed5db8ca8f4cf7b364f2a54dd89e0a125a699
-  http://algo.inria.fr/flajolet/Publications/FlFuGaMe07.pdf
-  http://research.google.com/pubs/pub40671.html

## TODO

- [ ] add tests
- [x] implement Google paper suggestion (64 bits hash function, bias correction)
    
    Kinda done. Using a 64-bits SHA-1 or MurmurHash3, but should rerun bias correction analysis from paper for new constants. For now they work reasonably well.

- [ ] ask @mr-c and @camillescott about the right way to implement extensions
- [x] think more about get_rho function
- [x] parallel reading and HLL merges for better performance
- [x] put constants in a separate header
On Mon, Dec 15, 2014 at 11:18:09AM -0800, Luiz Irber wrote:
> > +    HashIntoType j = x & (this->m - 1);
> > +    this->M[j] = max(this->M[j], get_rho(x >> this->p, 64 - this->p));
> > +}
> > +
> > +unsigned int HLLCounter::consume_string(const std::string &s) {
> > +    unsigned int n_consumed = 0;
> > +    std::string kmer = "";
> > +
> > +    for(std::string::const_iterator it = s.begin(); it != s.end(); ++it) {
> > +        kmer.push_back(*it);
> > +        if (kmer.size() < _ksize) {
> > +            continue;
> > +        }
> > +        this->add(kmer);
> > +
> > +        kmer.erase(0, 1);
> 
> I'm not using the two-bit representation (HLL supports k > 32 because of this), so KMerIterator is not applicable in this case.

What about using the same interface?