Hi.
I wonder if/how we would introduce the following functionality:
---CUT---
/**
* @param rng Generator that will be shared in the returned sampler.
* @param list Samplers whose underlying generators will be discarded in
* the returned instance.
* @return a sampler sharing the given provider.
*/
public static ObjectSampler<double[]>
withUniformRandomProvider(final UniformRandomProvider rng, final
SharedStateContinuousSampler... list) {
final SharedStateContinuousSampler[] samplers = new
SharedStateContinuousSampler[list.length];
for (int i = 0; i < list.length; i++) {
samplers[i] = list[i].withUniformRandomProvider(rng);
}
return new ObjectSampler<double[]>() {
/** {@inheritDoc} */
@Override
public double[] sample() {
final double[] out = new double[list.length];
for (int i = 0; i < list.length; i++) {
out[i] = samplers[i].sample();
}
return out;
}
};
}
---CUT---
Gilles
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]