You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by er...@apache.org on 2022/08/20 00:48:31 UTC
[commons-math] branch master updated (3c1c92d3e -> 97191fc73)
This is an automated email from the ASF dual-hosted git repository.
erans pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-math.git
from 3c1c92d3e MATH-1589: Remove spurious "throws" clause.
new 01ba89bf2 MATH-1647: Enforce precondition (index must be larger than 0).
new 021754216 Javadoc.
new 97191fc73 Track changes.
The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../commons/math4/legacy/random/HaltonSequenceGenerator.java | 7 ++++++-
.../math4/legacy/random/HaltonSequenceGeneratorTest.java | 10 ++++++++++
src/changes/changes.xml | 3 +++
3 files changed, 19 insertions(+), 1 deletion(-)
[commons-math] 01/03: MATH-1647: Enforce precondition (index must be larger than 0).
Posted by er...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
erans pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-math.git
commit 01ba89bf26da87e998cbc68262afc637ea4dd615
Author: rednikeeg <ma...@gmail.com>
AuthorDate: Fri Aug 19 21:27:11 2022 +0300
MATH-1647: Enforce precondition (index must be larger than 0).
---
.../commons/math4/legacy/random/HaltonSequenceGenerator.java | 5 +++++
.../math4/legacy/random/HaltonSequenceGeneratorTest.java | 10 ++++++++++
2 files changed, 15 insertions(+)
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/random/HaltonSequenceGenerator.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/random/HaltonSequenceGenerator.java
index 8a175618b..3805be497 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/random/HaltonSequenceGenerator.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/random/HaltonSequenceGenerator.java
@@ -19,6 +19,7 @@ package org.apache.commons.math4.legacy.random;
import java.util.function.Supplier;
import org.apache.commons.math4.legacy.exception.DimensionMismatchException;
+import org.apache.commons.math4.legacy.exception.NotPositiveException;
import org.apache.commons.math4.legacy.exception.NullArgumentException;
import org.apache.commons.math4.legacy.exception.OutOfRangeException;
@@ -165,6 +166,10 @@ public class HaltonSequenceGenerator implements Supplier<double[]> {
* @throws org.apache.commons.math4.legacy.exception.NotPositiveException NotPositiveException if index < 0
*/
public double[] skipTo(final int index) {
+ if (index < 0) {
+ throw new NotPositiveException(index);
+ }
+
count = index;
return get();
}
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/random/HaltonSequenceGeneratorTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/random/HaltonSequenceGeneratorTest.java
index 4dd800b41..c1931f517 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/random/HaltonSequenceGeneratorTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/random/HaltonSequenceGeneratorTest.java
@@ -18,6 +18,7 @@ package org.apache.commons.math4.legacy.random;
import org.junit.Assert;
import org.apache.commons.math4.legacy.exception.DimensionMismatchException;
+import org.apache.commons.math4.legacy.exception.NotPositiveException;
import org.apache.commons.math4.legacy.exception.NullArgumentException;
import org.apache.commons.math4.legacy.exception.OutOfRangeException;
import org.junit.Before;
@@ -131,4 +132,13 @@ public class HaltonSequenceGeneratorTest {
}
}
+ @Test
+ public void testSkipToNegative() {
+ try {
+ generator.skipTo(-4584);
+ Assert.fail("an exception should have been thrown");
+ } catch (NotPositiveException e) {
+ // expected
+ }
+ }
}
[commons-math] 02/03: Javadoc.
Posted by er...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
erans pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-math.git
commit 0217542162120f9e6688715e84e2bea1c7de91ea
Author: Gilles Sadowski <gi...@gmail.com>
AuthorDate: Sat Aug 20 02:43:51 2022 +0200
Javadoc.
---
.../org/apache/commons/math4/legacy/random/HaltonSequenceGenerator.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/random/HaltonSequenceGenerator.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/random/HaltonSequenceGenerator.java
index 3805be497..a45e16e93 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/random/HaltonSequenceGenerator.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/random/HaltonSequenceGenerator.java
@@ -163,7 +163,7 @@ public class HaltonSequenceGenerator implements Supplier<double[]> {
*
* @param index the index in the sequence to skip to
* @return the i-th point in the Halton sequence
- * @throws org.apache.commons.math4.legacy.exception.NotPositiveException NotPositiveException if index < 0
+ * @throws NotPositiveException if {@code index < 0}.
*/
public double[] skipTo(final int index) {
if (index < 0) {
[commons-math] 03/03: Track changes.
Posted by er...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
erans pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-math.git
commit 97191fc73cda17794ac44cf2fcae629695001999
Author: Gilles Sadowski <gi...@gmail.com>
AuthorDate: Sat Aug 20 02:44:37 2022 +0200
Track changes.
Closes #211.
---
src/changes/changes.xml | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 7e06e5e3a..fdff0ca37 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -97,6 +97,9 @@ Caveat:
nightmare was one of the main reasons for creating more focused
components.]
">
+ <action dev="erans" type="fix" issue="MATH-1647" due-to="Maksym Bohachov">
+ "HaltonSequenceGenerator": Raise exception when precondition is not met.
+ </action>
<action dev="erans" type="add" issue="MATH-1648" due-to="Alessandro Moscatelli">
"BicubicInterpolator": Provide partial derivatives of interpolating functions.
</action>