c3rb3ru5d3d53c/binlex

Entropy uses map to store frequncies, a vector should be used

rpkrawczyk opened this issue · 2 comments

in float Common::Entropy(string trait) a map<char,int> is used to store frequencies. Every access via operator[] is logarithmic in the size of the container which would result in a slower runtime.

Use vector, remember to skip zero frequency elements.

Fixed, and in milestone branch now thanks to @emgon !