[
https://issues.apache.org/jira/browse/RNG-142?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17358276#comment-17358276
]
Gilles Sadowski commented on RNG-142:
-------------------------------------
bq. I think the other expectation is once you have a sampler it does not matter
that it is of a certain type. All that matters is it produces samples.
Essentially it hides the type of sampler and just states the contract is to
provide samples of a certain type. If it shares state then the sampler can be
duplicated with another RNG. So without breaking binary compatibility this is
the API we currently have.
I know/agree.
I don't suggest to have a new major release just because of this issue.
> Return type of method "withUniformRandomProvider"
> -------------------------------------------------
>
> Key: RNG-142
> URL: https://issues.apache.org/jira/browse/RNG-142
> Project: Commons RNG
> Issue Type: Improvement
> Components: sampling
> Reporter: Gilles Sadowski
> Priority: Major
>
> Expected usage:
> {code:java}
> NormalizedGaussianSampler n01 =
> ZigguratNormalizedGaussianSampler.of(RandomSource.create(RandomSource.KISS));
> GaussianSampler g =
> GaussianSampler.of(n01.withUniformRandomProvider(RandomSource.create(RandomSource.JSF_64)),
> 0.43, 2.1);
> {code}
> Code doesn't compile: Method {{withUniformRandomProvider}} returns a
> {{SharedStateContinuousSampler}} whereas a {{NormalizedGaussianSampler}} is
> required.
> Am I missing something?
--
This message was sent by Atlassian Jira
(v8.3.4#803005)