forcedotcom / distributions

Low-level primitives for collapsed Gibbs sampling in python and C++
BSD 3-Clause "New" or "Revised" License
33 stars 25 forks source link

DirichletDiscrete: get the signs consistent #68

Closed stephentu closed 10 years ago

stephentu commented 10 years ago

this shuts up sign compare compile errors for DirichletDiscrete

While the distributions makefile does -Wno-sign-compare, I'd like to have this warning on for the data-microscopes project.

stephentu commented 10 years ago

arguably dim/max_dim should be unsigned

fritzo commented 10 years ago

I agree these should be signed. In distributions, we occasionally have used signed instead of unsigned ints for two different reasons:

  1. To sometimes allow negative counts in dd and dpd sufficient statistics, supporting "data debt" in Loom's streaming inference. This feature is exercised in distributions/tests/test_models.py:test_group_allows_debt.
  2. To support legacy code that was used in transition to our new engine, e.g. in Clustering<int>::PitmanYor. The legacy bridge code is no longer used, so these could safely be made unsigned.