This is an automated email from the ASF dual-hosted git repository. aherbert pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-rng.git
commit 789dc713ccd9f66dd90cdd4780758ba3ca714d6d Author: Alex Herbert <aherb...@apache.org> AuthorDate: Fri Jul 19 18:16:18 2019 +0100 RNG-110: Add SharedStateDiscreteSampler and SharedStateContinuousSampler These interfaces define functionality for all distribution samplers. --- .../distribution/SharedStateContinuousSampler.java | 30 ++++++++++++++++++++++ .../distribution/SharedStateDiscreteSampler.java | 30 ++++++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/SharedStateContinuousSampler.java b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/SharedStateContinuousSampler.java new file mode 100644 index 0000000..b1b8bac --- /dev/null +++ b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/SharedStateContinuousSampler.java @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.commons.rng.sampling.distribution; + +import org.apache.commons.rng.sampling.SharedStateSampler; + +/** + * Sampler that generates values of type {@code double} and can create new instances to sample + * from the same state with a given source of randomness. + * + * @since 1.3 + */ +public interface SharedStateContinuousSampler + extends ContinuousSampler, SharedStateSampler<SharedStateContinuousSampler> { + // Composite interface +} diff --git a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/SharedStateDiscreteSampler.java b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/SharedStateDiscreteSampler.java new file mode 100644 index 0000000..fe751bf --- /dev/null +++ b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/SharedStateDiscreteSampler.java @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.commons.rng.sampling.distribution; + +import org.apache.commons.rng.sampling.SharedStateSampler; + +/** + * Sampler that generates values of type {@code int} and can create new instances to sample + * from the same state with a given source of randomness. + * + * @since 1.3 + */ +public interface SharedStateDiscreteSampler + extends DiscreteSampler, SharedStateSampler<SharedStateDiscreteSampler> { + // Composite interface +}