cegme / vose

A discrete distribution sampler with really nice guarantees and performance properties.
2 stars 0 forks source link

Max marble size #7

Open cegme opened 11 years ago

cegme commented 11 years ago

The maximum marble size must be less than the maximum bag size. If not the adding code gets complicated. I should revisit this restriction.

jnwilson commented 11 years ago

I don't think his should not be a problem if you get rid of the requirement that there be a static max bag size. Do you really need one? If a single marble is larger than the largest bag, it can become the new single alias for every other cell in a structure. The reconstruction will require 0(n) where there are n existing cells, but is pretty trivial. If bag formation and reconstruction is dynamic, there need be no max size.