Is there a wrapper for TRandom derivatives to provide the std UniformRandomBitGenerator interface?

Hello,

I want to use std::shuffle which expects an object following this requirement:
https://en.cppreference.com/w/cpp/named_req/UniformRandomBitGenerator

Given that I am using TRandomMixMax as the source of random numbers, is there a wrapper to provide the expected interface?

Until now the closest I came to the solution is to use ROOT::Math::MixMaxEngine and wrap it myself, so the IntRndm(), MaxInt(), and MinInt() implement respectively g(), G::max(), G::min().

Cheer,
Antoni

Hi,

This wrapper already exists in ROOT, it is defined in TMVA, in the TMVA/Tools.h file, see
https://root.cern.ch/doc/master/classTMVA_1_1RandomGenerator.html

We should maybe plan to move it in the common Math library (e.g. MathCore)

Cheers

Lorenzo

Hi Lorenzo,

Thanks! I thought that it would already be there.

Cheers,
Antoni

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.