xsl-list
[Top] [All Lists]

Re: [xsl] Random number generation : requirements

2014-05-06 15:53:08
I used exslt math:random() in a Monte Carlo simulation about a year ago.
 iirc, it doesn't change seed under libxslt on subsequent applications of a
stylesheet (I guess that's not surprising).
Here I was originally using a C harness to run a bunch of transformations
iteratively without serializing/deserializing a document.
I found that the call was always getting the same random sequence
(ostensibly it was getting the same seed).
I switched that one (of about ten) transformation to a random/evaluation
using C/libXML/XPath, which was oodles faster than applying that one
stylesheet in an otherwise tight loop.
I probably didn't even need to do that, as my simulation had a huge
performance problem in that my calculated time step was orders of magnitude
too small.
The XSLT implementation was *far* simpler than the C/libXML/XPath version.

Just my non-inflation-adjusted $0.02


On Tue, May 6, 2014 at 9:54 AM, Michael Kay mike(_at_)saxonica(_dot_)com <
xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> wrote:

The W3C WGs are looking at the idea of introducing a random-number
function of some kind in XPath 3.1. The challenge of course is making this
both usable and a pure function with no side-effects. We have various
design ideas which we need to test against requirements.

If you have any applications that use or need such a function, please
could I have a brief description of the way it uses random numbers, e.g.
just wanting a single random number, a random permutation of 52 integers,
an arbitrary sequence of random numebrs for test data generation, etc.

If you're currently using the EXSLT random-sequence() function, please
share your experience with it.

Michael Kay
Saxonica


--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--
<Prev in Thread] Current Thread [Next in Thread>