probcomp / hierarchical-irm

Probabilistic structure discovery for rich relational systems
Apache License 2.0
4 stars 2 forks source link

Add max_table method to CRP #222

Closed ThomasColthurst closed 1 month ago

ThomasColthurst commented 1 month ago

and use it to make the code more understandable and more efficient.

Also, switch the table_weights() return values from unordered_map's to map's, so that their maximum key can be compute in O(1) time.

ThomasColthurst commented 1 month ago

Why do you figure they used unordered_map here?

Probably that was their default (for the slight efficiency win over map?), and then when they added the table_weights methods they didn't realize that map<> would be more efficient.