On Jun 8, 5:00*am, Öö Tiib <oot...@hot.ee> wrote:
> On Jun 8, 11:40*am, orz <cdh...@gmail.com> wrote:
> > template-heavy:
> > I suspect we just have different standards of template-heavy.
>
> Oh. Yes, everybody have.
I am also worried when heavy template
> wizardry is used. In Boost.Random it seems just to be straightforward
> for to parametrize and combine distribution and engine classes compile
> time. That is classical usage of templates and i feel comfortable with
> such. The major effect of such templates is that it produces lighter
> results especially at low end and is still efficient.
>
> Typical user is usally fine with maybe one or two combinations (so he
> #includes and gets binary code only for these). For a power user who
> simulates natural processes the virtual calls (or even callbacks)
> between distribution and engine may be too slow.
I downloaded the latest Boost and glanced through it, and maybe I
spoke too soon on that being too template-heavy. The way they handle
distributions is lighter-weight than I thought from glancing at the
docs. All in all it's not really that different than my setup aside
from the detail that all distributions (except that native to the RNG
engine) are separate Boost, while only non-uniform ones are in mine,
and they're willing to incur a tiny bit of runtime overhead to allow
persistent RNG-distribution pairings.
> > adding a generator to Boost:
> > I suppose I could propose a generator or two to Boost, but there's no
> > way they would be interested in most of this package, as it has lots
> > of code for doing things Boost has no interest in, like statistical
> > tests.
>
> Boost libraries have tests, but usually against bugs and not for
> statistics. With your experience you probably would be of great
> contributor even if you simply evaluated the efficiency of the
> templates and compared it with your functions.
They could start by flipping through the paper L'Ecuyer published with
TestU01 to the list of results near the end and arbitrarily picking a
few RNGs listed as both passing all statistical tests and taking less
than 1.5 seconds on an Athlon 64 2.4 GHrz. Admittedly I think all of
those are large-state RNGs (there are relatively few good small-state
RNGs, and they tend to be more obscure too), but asside from that,
there's a dozen RNGs there that meet those criteria and have no major
drawbacks.
> > interface features missing from Boost / TR1:
> > I expect they'll support all the basic features. *Although... I can't
> > actually find any kind of serialization / save & restore type
> > functionality in their interface... probably an omission they'll fix
> > sometime soon, or maybe it's there and I'm just not seeing it.
>
> The pseudo-random-generators are all seedable and streamable in Boost.
> "streamable" means these have "ostream << engine" for serialization
> and "istream >> engine" for deserialization. These ara usually enough
> to save/restore, copy/paste or undo/redo.
Ah, thanks. I see the serialization code now that I've downloaded the
package instead of browsing the online documentation. Though... it
seems oriented to serializing to a string of text describing RNG state
rather than to a binary representation as I do in my interface. Their
text serialization & deserialization will thus be slower and take more
memory, but will be (slightly) human-readable if you wanted to print a
serialized state out on the users screen. Still, 95% of users won't
use serialization, and 95% of the ones that do won't care about its
efficiency.