Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


On 11/28/2012 02:41 PM, tino wrote:
Thanks for the additional insight.  Well, I can see two possibilities:

1) Use boost's generator for Windows platform-only, while we keep
the glibc's version for Linux.  I wonder what the situation is on
Mac...

2) Use boost's generator for all platforms.

If there are no issues with using boost then I'd suggest 2) and use
boost's implementation of Mersenne Twister (boost::mt19937) as default
for all.

Yup, I agree with that. That's probably the better approach.

It also turns out to be slightly faster than rand().

Good. This was my only concern toward use of boost's generator over glibc's. But now there is one less reason not to use boost's.

What is your opinion on implementing generators for other
distributions like normal and all the ones listed under statistics
(which calculate densities but don't generate)?

Well, re-implementing the existing RAND and RANDBETWEEN with the new generator is no brainer. But I'm not sure if we really need to provide multiple variants for different random number generators. What we could do is to specify a run-time option for the algorithm for the normal RAND and RANDBETWEEN functions rather than providing multiple variants. That would be my preference. We already have formula engine options in Tools - Options (in the Formula tab page), so adding another one shouldn't be too difficult.

With boost this is
simple so just a matter of extending the UNO interface.

Well, these functions are implemented in the core interpreter in the sc module (ScInterpreter). Not scaddins. So, no UNO interface involved there. :-)

Kohei

--
Kohei Yoshida, LibreOffice hacker, Calc

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.