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 2021/06/29 22:34:46 UTC
[commons-rng] branch master updated: Do not call deprecated
nextVector method
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
The following commit(s) were added to refs/heads/master by this push:
new 5c87814 Do not call deprecated nextVector method
5c87814 is described below
commit 5c8781430c93407c87ab4822acf15d5a2fecac9c
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Tue Jun 29 23:34:42 2021 +0100
Do not call deprecated nextVector method
---
.../java/org/apache/commons/rng/sampling/UnitSphereSampler.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/UnitSphereSampler.java b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/UnitSphereSampler.java
index bb4c0bc..76db7b0 100644
--- a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/UnitSphereSampler.java
+++ b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/UnitSphereSampler.java
@@ -106,7 +106,7 @@ public class UnitSphereSampler implements SharedStateObjectSampler<double[]> {
if (sum == 0) {
// Zero-norm vector is discarded.
- return nextVector();
+ return sample();
}
final double f = 1.0 / Math.sqrt(sum);
@@ -143,7 +143,7 @@ public class UnitSphereSampler implements SharedStateObjectSampler<double[]> {
if (sum == 0) {
// Zero-norm vector is discarded.
- return nextVector();
+ return sample();
}
final double f = 1.0 / Math.sqrt(sum);
@@ -193,7 +193,7 @@ public class UnitSphereSampler implements SharedStateObjectSampler<double[]> {
// than a few such vectors. It also protects against infinite
// loop (in case a buggy generator is used), by eventually
// raising a "StackOverflowError".
- return nextVector();
+ return sample();
}
final double f = 1 / Math.sqrt(sum);