emphf icon indicating copy to clipboard operation
emphf copied to clipboard

Use MPHF

Open Malfoy opened this issue 10 years ago • 3 comments

Hello, Would it be possible to add a sample code on how to use the MPHF created by compute_mphf_seq, compute_mphf_hem and compute_mphf_scan in the README or in a minimal C++ file ?

Malfoy avatar Jun 18 '15 11:06 Malfoy

Hi Malfoy, you can find an example of usage in the unit tests, specifically https://github.com/ot/emphf/blob/master/compute_mphf_generic.hpp for building the data structure and https://github.com/ot/emphf/blob/master/test_mphf_generic.hpp for lookups. I agree that is not as minimal as it could be, but it should be quite self-explanatory. If you think that's not clear enough I can add another example.

ot avatar Jun 21 '15 22:06 ot

Ok it is self-explanatory, was just afraid of template use. But is it normal that a key value of 0 result in an infinite loop "Hypergraph is not peelable" with mphf_seq ?

Malfoy avatar Jul 01 '15 08:07 Malfoy

No, that shouldn't happen. On how many keys are you trying to build the hash? For small key sets a special case might be needed and I haven't tested that.

ot avatar Jul 01 '15 23:07 ot