many useful program including prime/twin sieve & hash map & timer & lru & topk
ktprime / ktprime Goto Github PK
View Code? Open in Web Editor NEWfast prime sieve and hash algorithm
License: MIT License
fast prime sieve and hash algorithm
License: MIT License
many useful program including prime/twin sieve & hash map & timer & lru & topk
Hi,
I think you have accidentally replaced PrimeNumber.cpp
by topK.cpp
. Both PrimeNumber.cpp
and topK.cpp
are nearly identical and your PrimeNumber.cpp
cannot be used anymore to sieve prime numbers.
For the hashmaps, should rehash be public? This seems to be the standard with most the other hashmaps. I see one has shrink_to_fit which calls rehash (but the other does not).
This is a great hashmap! I've been comparing it to many others, and it has clearly been the best.
Hi,
I have run into a compiler error using GCC 6.3 and GCC 7.1 on Ubuntu 17.04 (x86_64):
g++-7.1 -DSIEVE_SIZE=2048 -DW30 -march=native -funroll-loops -O3 -s -pipe PrimeNumber.cpp -o prime
PrimeNumber.cpp: In function ‘int main(int, char**)’:
PrimeNumber.cpp:1865:8: error: ‘gets’ was not declared in this scope
if (!gets(ccmd) || !executeCmd(ccmd))
It seems to me that GCC has removed gets from the <stdio.h>
because its usage is dangerous!
Using the clang++-4.0 the code compiles fine but I get a warning for gets
:
clang++ -DSIEVE_SIZE=2048 -DW30 -march=native -funroll-loops -O3 -s -pipe PrimeNumber.cpp -o PrimeNumber
PrimeNumber.cpp:1864:10: warning: 'gets' is deprecated [-Wdeprecated-declarations]
if (!gets(ccmd) || !executeCmd(ccmd))
^
/usr/include/stdio.h:640:14: note: 'gets' has been explicitly marked deprecated here
extern char *gets (char *__s) __wur __attribute_deprecated__;
^
1 warning generated.
/tmp/PrimeNumber-595f7f.o: In function `main':
PrimeNumber.cpp:(.text+0x4842): warning: the `gets' function is dangerous and should not be used.
To assess hash quality, would you consider running the following "state of the art" hash tests?
stricter (better) counterpart/fork of smhasher (but less actively maintained): https://github.com/demerphq/smhasher/ as described in rurban/smhasher#31
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.