You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ah...@apache.org on 2022/09/26 13:48:18 UTC

[commons-rng] 07/08: Update sampling site page

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 3e20b6ceba8bb24422a95fcc5ed1bd0f57a1ffe4
Author: aherbert <ah...@apache.org>
AuthorDate: Mon Sep 26 13:59:20 2022 +0100

    Update sampling site page
    
    Remove deprecated API from UnitSphereSampler example.
    
    Use diamond operator.
---
 commons-rng-sampling/src/site/xdoc/index.xml | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/commons-rng-sampling/src/site/xdoc/index.xml b/commons-rng-sampling/src/site/xdoc/index.xml
index 09c91a7d..f523a42e 100644
--- a/commons-rng-sampling/src/site/xdoc/index.xml
+++ b/commons-rng-sampling/src/site/xdoc/index.xml
@@ -69,13 +69,13 @@ public class NormalDeviates {
 import java.util.HashSet;
 import org.apache.commons.rng.sampling.CollectionSampler;
 
-HashSet&lt;String&gt; list = new HashSet&lt;String&gt;();
-list.add("Apache");
-list.add("Commons");
-list.add("RNG");
+HashSet&lt;String&gt; elements = new HashSet&lt;&gt;();
+elements.add("Apache");
+elements.add("Commons");
+elements.add("RNG");
 
-CollectionSampler&lt;String&gt; sampler = new CollectionSampler&lt;String&gt;(RandomSource.MWC_256.create(),
-                                                                  list);
+CollectionSampler&lt;String&gt; sampler = new CollectionSampler&lt;&gt;(RandomSource.MWC_256.create(),
+                                                            elements);
 String word = sampler.sample();
 </source>
       </p>
@@ -92,7 +92,7 @@ String word = sampler.sample();
 import org.apache.commons.rng.sampling.UnitSphereSampler;
 
 int dimension = 3;
-UnitSphereSampler sampler = new UnitSphereSampler(dimension, RandomSource.KISS.create());
+UnitSphereSampler sampler = UnitSphereSampler.of(dimension, RandomSource.KISS.create());
 
 double[] vector = sampler.sample();
 </source>