Closed ralfkonrad closed 2 months ago
I guess we could also export RandomSequenceGenerator<ZigguratGaussianRng<Xoshiro256StarStarUniformRng>>
?
Okay, I'll give it a try.
Hm, it doesn't work out-of-the-box: template<class RNG> class RandomSequenceGenerator
expects
RandomSequenceGenerator(Size dimensionality,
BigNatural seed = 0);
which translate into a missing constructor
explicit ZigguratGaussianRng<RNG>(BigNatural seed = 0);
We could add in SWIG something like
{%
template <class RNG>
class ZigguratGaussianRngExtension
: public QuantLib::ZigguratGaussianRng<RNG> {
public:
ZigguratGaussianRngExtension(BigNatural seed = 0)
: QuantLib::ZigguratGaussianRng<RNG>(RNG(seed)) {}
};
%}
%template(ZigguratXoshiro256StarStarGaussianRsg)
RandomSequenceGenerator<
ZigguratGaussianRngExtension<Xoshiro256StarStarUniformRng>>;
which works but creates e.g. these artificial java classes like SWIGTYPE_p_ZigguratGaussianRngExtensionT_Xoshiro256StarStarUniformRng_t
.
We could add the constructor explicit ZigguratGaussianRng<RNG>(BigNatural seed = 0);
in QuantLib directly but that's also a bit dirty.
Any better idea?
Added — I hid it behind a typedef and exported the available interface only.
Fine, thanks!
Not sure if we can add it elsewhere?!