Commit 3ed8e071 authored by Emmanuel Bourg's avatar Emmanuel Bourg

Merge tag 'upstream/3.6'

Upstream version 3.6
parents 0f658e50 ce59910f
Apache Commons Math
Copyright 2001-2015 The Apache Software Foundation
Copyright 2001-2016 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
......
The Apache Commons Math team is pleased to announce the commons-math3-3.5 release!
The Apache Commons Math team is pleased to announce the commons-math3-3.6 release!
The Apache Commons Math project is a library of lightweight, self-contained mathematics
and statistics components addressing the most common practical problems not immediately
......@@ -7,27 +7,108 @@ available in the Java programming language or commons-lang.
Changes in this version include:
New features:
o Added a way to build polyhedrons sets from a list of vertices and
facets specified using vertices indices.
o Simplified "FastMath#exp(double)" in order to avoid a potential
Java 1.5 JIT bug when calling with negative infinity as argument. Issue: MATH-1198.
o Added method "getQuadraticMean()" to "DescriptiveStatistics"
and "SummaryStatistics" which calculates the root mean square. Issue: MATH-1199.
o Added a RotationConvention enumerate to allow specifying the semantics
or axis/angle for rotations. This enumerate has two values:
VECTOR_OPERATOR and FRAME_TRANSFORM. Issue: MATH-1302,MATH-1303.
o Added a field-based version of Ordinary Differential Equations framework.
This allows integrating ode that refer to RealField elements instead of
primitive double, hence opening the way to use DerivativeStructure to
compute partial differential without using variational equations, or to solve
ode with extended precision using Dfp. Issue: MATH-1288.
o Added a nth order Brent solver for general real fields, replacing the former
solver that was restricted to Dfp fields only.
o New "Range" inner class of "o.a.c.m.util.IntegerSequence". Issue: MATH-1286.
o "AggregateSummaryStatistics" can now aggregate any kind of
"StatisticalSummary". Issue: MATH-837.
o Deep copy of "Network" (package "o.a.c.m.ml.neuralnet") to allow evaluation of
of intermediate states during training. Issue: MATH-1278.
o Added negative zero support in FastMath.pow. Issue: MATH-1273. Thanks to Qualtagh.
o Various SOFM visualizations (in package "o.a.c.m.ml.neuralnet.twod.util"):
Unified distance matrix, hit histogram, smoothed data histograms,
topographic error, quantization error. Issue: MATH-1270.
o New interfaces to be implemented by algorithms that visualizes properties
of a "NeuronSquareMesh2D" (package "o.a.c.m.ml.neuralnet.twod.util"). Issue: MATH-1268.
o Reimplemented pow(double, double) in FastMath, for better accuracy in
integral power cases and trying to fix erroneous JIT optimization again.
o Added a pow(double, long) method in FastMath.
o "NeuronSquareMesh2D" (package "o.a.c.m.ml.neuralnet.twod") implements "Iterable". Issue: MATH-1265.
o "MapUtils" (package "o.a.c.m.ml.neuralnet"): Method to sort units according to distance
from a given vector. Issue: MATH-1264.
o Accessor (class "o.a.c.m.ml.neuralnet.twod.NeuronSquareMesh2D"). Issue: MATH-1263.
o New "IntegerSequence" class (in package "o.a.c.m.util") with "Incrementor" inner class. Issue: MATH-1259.
o "Neuron" class (package "o.a.c.m.ml.neuralnet"): added methods that can be used
to assess concurrency performance. Issue: MATH-1250.
o Method "cosAngle" in "o.a.c.m.util.MathArrays". Issue: MATH-1244.
Fixed Bugs:
o Moved FastMathTestPerformance out of the main test tree, as is is
a benchmark rather than a test. Issue: MATH-1195.
o Fixed ignored method parameters in QRDecomposition protected methods. Issue: MATH-1191.
o Fixed wrong selection of line/polyhedron intersection point. Issue: MATH-1211. Thanks to Mike Zimmerman.
o Improved fix for corner cases in BSP-tree merging, when cut sub-hyperplanes vanish. Issue: MATH-1162.
o Fixed link to algorithm description in "PoissonDistribution#sample()". Issue: MATH-1209. Thanks to Jonathan Ogilvie.
o EmpiricalDistribution cumulativeProbability can return NaN when evaluated within a constant bin. Issue: MATH-1208.
o EmpiricalDistribution getKernel fails for buckets with only multiple instances of the same value. Issue: MATH-1203.
o "UnivariateSolverUtils#bracket(...)" sometimes failed to bracket
if a reached the lower bound. Issue: MATH-1204.
o Improved performance and accuracy of 2-sample KolmogorovSmirnov tests. Issue: MATH-1310.
o Detect start failures with multi-step ODE integrators. Issue: MATH-1297.
o Fixed stability issues with Adams-Bashforth and Adams-Moulton ODE integrators.
The integrators did not estimate the local error properly and were sometimes
stuck attempting to reduce indefinitely the step size as they thought the
error was too high. Thanks to Julien Queyrel.
o Increased default value for number of allowed evaluations in
"o.a.c.m.optim.univariate.BracketFinder". Issue: MATH-1295. Thanks to Luke Lindsay.
o Fixed potential race condition in PolynomialUtils#buildPolynomial in
case polynomials are generated from multiple threads. Furthermore, the
synchronization is now performed on the coefficient list instead of the class. Issue: MATH-1294. Thanks to Kamil Włodarczyk.
o Fixed FastMath.exp that potentially returned NaN for non-NaN argument. Issue: MATH-1269.
o Updated reference in ZipfDistribution's javadoc. Issue: MATH-1285. Thanks to Pim van der Hoorn.
o Fixed "Gamma#gamma(double)" for negative values smaller than -20. Issue: MATH-1283. Thanks to Jean Noel Delavalade.
o Fixed javadoc of methods {floorDiv,floorMod} in class "FastMath". Issue: MATH-1237. Thanks to Ken Williams.
o Check precondition (class "o.a.c.m.random.EmpiricalDistribution"). Issue: MATH-1279.
o Fixed incorrect Kendall's tau coefficient calculation due to internal integer overflow. Issue: MATH-1277. Thanks to Marc Rosen.
o Fixed split/side inconsistencies in BSP trees. Issue: MATH-1266.
o Avoid overflow in "Fraction" (multiplication or division by an int). Issue: MATH-1261. Thanks to Osamu Ikeuchi.
o Added check for equal array lengths to distance measure functions. Issue: MATH-1258. Thanks to Gunel Jahangirova.
o Better accuracy in computation of cumulative probability of "NormalDistribution"
(package "o.a.c.m.distribution"). Issue: MATH-1257. Thanks to Bill Murphy.
o Boundary check to construct an "Interval" (package "o.a.c.m.geometry.euclidean.oned"). Issue: MATH-1256.
o Wrong neighbourhood size in class "KohonenUpdateAction" (package "o.a.c.m.ml.neuralnet.sofm"). Issue: MATH-1255.
o ResizableDoubleArray constructor does not work with double array of size 1. Issue: MATH-1252. Thanks to John Bay.
o Fixed initial value of "number of calls" counter in class "KohonenUpdateAction"
(package "o.a.c.m.ml.neuralnet.sofm"). Issue: MATH-1251.
o Removed unnecessary allocations in "BigFraction" (package "o.a.c.m.fraction"). Issue: MATH-1248. Thanks to Chris Popp.
o Fixed error in computing discrete distribution of D statistics for small-sample
2-sample Kolmogorov-Smirnov tests. Error was causing incorrect p-values returned
by exactP and monteCarloP methods (used by default for small, mid-size samples). Issue: MATH-1245.
o "KolmogorovSmirnovTest#ksSum(...)" returned wrong result in case the provided
t-parameters was zero. This affected the calculation of "approximateP(...)" for
identical samples. Issue: MATH-1240.
o Improved performance to calculate the two-sample Kolmogorov-Smirnov test
via monte carlo simulation ("KolmogorovSmirnovTets#monteCarloP(...)"). Issue: MATH-1242. Thanks to Otmar Ertl.
o A "StackOverflowException" was thrown when passing Double.NaN or infinity
to "Gamma#digamma(double)" or "Gamma#trigamma(double)". Now the input value
is propagated to the output if it is not a real number. Issue: MATH-1241. Thanks to Aleksei Dievskii.
o Improved performance of calculating the two-sample Kolmogorov-Smirnov
test statistic. Issue: MATH-1232. Thanks to Otmar Ertl.
o Fixed error message for unknown parameter name in ODE. Issue: MATH-1232.
o Fixed wrong event detection in case of close events pairs. Issue: MATH-1226.
o Fix potential branching errors in "FastMath#pow(double, double)" when
passing special values, i.e. infinity, due to erroneous JIT optimization.
o Fixed equals/hashcode contract failure for Dfp. Issue: MATH-1118.
o Fixed wrong splitting of huge number in extended accuracy algorithms. Issue: MATH-1223.
o Improve performance of "BetaDistribution#sample()" by using Cheng's algorithm. Issue: MATH-1153. Thanks to Sergei Lebedev.
o Computation of 2-sample Kolmogorov-Smirnov statistic in case of ties
was not correct. Issue: MATH-1197.
Changes:
o Added Laguerre complex solve methods taking maxEval parameters. Issue: MATH-1213.
o Modified 2-sample KolmogorovSmirnovTest to handle ties in sample data. By default,
ties are broken by adding random jitter to input data. Also added bootstrap method
analogous to ks.boot in R Matching package. Issue: MATH-1246.
o Added bootstrap method to KolmogorovSmirnov test. Issue: MATH-1246.
o Added constructors taking sample data as arguments to enumerated real and integer distributions. Issue: MATH-1287.
o Improved performance of sampling and inverse cumulative probability calculation
for geometric distributions. Issue: MATH-1276.
o Representation of Kolmogorov-Smirnov statistic as integral value. Issue: MATH-1274.
o Faster generation of Zipf distributed random numbers by using rejection-inversion sampling. Issue: MATH-1220.
o Improved performance of sort-in-place methods by avoiding boxing. Issue: MATH-990.
o Refactored implementation of the "miscrosphere projection"
interpolation algorithm.
New classes: "MicrosphereProjectionInterpolator",
"InterpolatingMicrosphere" and "InterpolatingMicrosphere2D"
replace "MicrosphereInterpolator" and "MicrosphereInterpolatingFunction".
(package "o.a.c.m.analysis.interpolation"). Issue: MATH-1243.
Have fun!
......
......@@ -30,12 +30,12 @@
<!-- ========== External Dependencies ===================================== -->
<property name="repository" value = "${user.home}/.m2/repository"/>
<!-- Junit -->
<property name="junit.version" value="4.8.2"/>
<property name="junit.home" value="/usr/share/junit"/>
<property name="junit.jar" value="${junit.home}/junit-${junit.version}.jar"/>
<property name="junit.version" value="4.11"/>
<property name="junit.jar" value="$junit-{junit.version}.jar"/>
<property name="hamcrest.jar" value="hamcrest-core-1.3.jar"/>
<!-- ========== Component Declarations ==================================== -->
......@@ -50,7 +50,7 @@
<property name="component.title" value="Commons MATH"/>
<!-- The current version number of this component -->
<property name="component.version" value="3.5"/>
<property name="component.version" value="3.6"/>
<!-- The base directory for component sources -->
<property name="source.home" value="src/main/java"/>
......@@ -111,6 +111,7 @@
<!-- External dependency classpath -->
<path id="downloaded.lib.classpath">
<pathelement location="${download.lib.dir}/junit-${junit.version}.jar"/>
<pathelement location="${download.lib.dir}/${hamcrest.jar}"/>
</path>
<!-- ========== Test Execution Defaults =================================== -->
......@@ -121,6 +122,7 @@
<pathelement location="${build.home}/classes"/>
<pathelement location="${build.home}/test-classes"/>
<pathelement location="${junit.jar}"/>
<pathelement location="${hamcrest.jar}"/>
<path refid="downloaded.lib.classpath"/>
</path>
......@@ -247,7 +249,7 @@
bottom="Copyright (c) 2003-${current.year} Apache Software Foundation"
additionalparam="-header &apos;&lt;script type=&quot;text/javascript&quot; src=&quot;http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML&quot;&gt;&lt;/script&gt;&apos;"
classpathref="compile.classpath">
<link href="http://java.sun.com/j2se/1.5.0/docs/api/"/>
<link href="http://docs.oracle.com/javase/1.5.0/docs/api/"/>
</javadoc>
</target>
......@@ -343,9 +345,10 @@
<!-- ========== Download Dependencies =========================================== -->
<target name="download-dependencies"
depends="check-availability" unless="skip.download">
depends="check-availability" unless="skip.download">
<echo message="doing download-dependencies..." />
<antcall target="download-junit" />
<antcall target="download-hamcrest" />
</target>
<target name="check-availability">
......@@ -360,6 +363,14 @@
usetimestamp="true" ignoreerrors="true"
src="http://repo1.maven.org/maven2/junit/junit/${junit.version}/junit-${junit.version}.jar"/>
</target>
<target name="download-hamcrest" unless="hamcrest.found">
<echo message="Downloading hamcrest..."/>
<mkdir dir="${download.lib.dir}" />
<get dest="${download.lib.dir}/${hamcrest.jar}"
usetimestamp="true" ignoreerrors="true"
src="http://repo1.maven.org/maven2/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar"/>
</target>
</project>
......@@ -25,8 +25,6 @@
<module name="TreeWalker">
<property name="cacheFile" value="target/checkstyle-cachefile"/>
<!-- Operator must be at end of wrapped line -->
<module name="OperatorWrap">
<property name="option" value="eol"/>
......@@ -45,14 +43,9 @@
<module name="JavadocMethod">
<property name="allowUndeclaredRTE" value="true"/>
<property name="allowThrowsTagsForSubclasses" value="true"/>
<property name="validateThrows" value="false"/>
</module>
<!-- Allow declaration of detailed exception set -->
<module name="RedundantThrows">
<property name="allowUnchecked" value="true"/>
<property name="allowSubclasses" value="true"/>
</module>
<!-- Require field javadoc -->
<module name="JavadocVariable"/>
......@@ -193,6 +186,11 @@
<property name="onCommentFormat" value="CHECKSTYLE\: resume DeclarationOrder"/>
<property name="checkFormat" value="DeclarationOrder"/>
</module>
<module name="SuppressionCommentFilter">
<property name="offCommentFormat" value="CHECKSTYLE\: stop RedundantModifier"/>
<property name="onCommentFormat" value="CHECKSTYLE\: resume RedundantModifier"/>
<property name="checkFormat" value="RedundantModifier"/>
</module>
<module name="SuppressionCommentFilter">
<property name="offCommentFormat" value="CHECKSTYLE\: stop all"/>
<property name="onCommentFormat" value="CHECKSTYLE\: resume all"/>
......
......@@ -23,6 +23,13 @@
-->
<FindBugsFilter>
<!-- the following field is unused but cannot be suppressed as it is protected -->
<!-- and some user class may require it -->
<Match>
<Class name="org.apache.commons.math3.analysis.integration.BaseAbstractUnivariateIntegrator" />
<Bug pattern="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD" />
</Match>
<!-- the following equality tests are part of the reference algorithms -->
<!-- which already know about limited precision of the double numbers -->
<Match>
......@@ -163,6 +170,21 @@
<Bug pattern="DLS_DEAD_LOCAL_STORE" />
</Match>
<!-- Spurious: Findbugs confused by FastMath.PI - 1.0e-10 -->
<Match>
<Class name="org.apache.commons.math3.geometry.euclidean.threed.Plane" />
<Method name="isSimilarTo" params="org.apache.commons.math3.geometry.euclidean.threed.Plane" returns="boolean" />
<Bug pattern="CNT_ROUGH_CONSTANT_VALUE" />
</Match>
<!-- Spurious: Findbugs confused by constant 1.570796251296997 which is a
intentionally slightly offset from PI/2 as per Cody Waite arguments reduction -->
<Match>
<Class name="org.apache.commons.math3.util.FastMath$CodyWaite" />
<Method name="&lt;init>" params="double" returns="void" />
<Bug pattern="CNT_ROUGH_CONSTANT_VALUE" />
</Match>
<!-- the following expositions of internal representation are intentional and documented -->
<Match>
<Class name="org.apache.commons.math3.stat.regression.RegressionResults"/>
......
<?xml version="1.0"?>
<!--
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.
-->
<ruleset name="commons-math-customized"
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd">
<description>
This ruleset checks the code for discouraged programming constructs.
</description>
<rule ref="rulesets/java/basic.xml"/>
<rule ref="rulesets/java/braces.xml"/>
<rule ref="rulesets/java/comments.xml">
<exclude name="CommentSize"/>
</rule>
<rule ref="rulesets/java/comments.xml/CommentSize">
<properties>
<property name="maxLines" value="200"/>
<property name="maxLineLength" value="256"/>
</properties>
</rule>
<rule ref="rulesets/java/empty.xml"/>
<rule ref="rulesets/java/finalizers.xml"/>
<rule ref="rulesets/java/imports.xml"/>
<rule ref="rulesets/java/typeresolution.xml">
<!-- TODO: we should reactivate this rule -->
<exclude name="CloneMethodMustImplementCloneable"/>
</rule>
<!-- TODO: we should reactivate this ruleset -->
<!-- <rule ref="rulesets/java/clone.xml"/> -->
<rule ref="rulesets/java/unnecessary.xml">
<!-- In many places in Apache Commons Math, there are complex boolean expressions.
We do use extra parentheses there as most people do not recall operator precedence,
this means even if the parentheses are useless for the compiler, we don't consider
them useless for the developer. This is the reason why we disable this rule. -->
<exclude name="UselessParentheses"/>
<!-- At several places in the optimization package, we set up public "optimize" methods
that simply call their base class optimize method. This is intentional and allows
to update the javadoc and make sure the additional parameters implemented at the
lower class level are properly documented. These new parameters are really taken
into accound despite we merely call super.optimize because the top level optimze
methods call a protected parseOptimizationData method implemented in the specialized
class. This is the reason why we disable this rule. -->
<exclude name="UselessOverridingMethod"/>
</rule>
</ruleset>
......@@ -19,12 +19,12 @@
<parent>
<groupId>org.apache.commons</groupId>
<artifactId>commons-parent</artifactId>
<version>34</version>
<version>39</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.commons</groupId>
<artifactId>commons-math3</artifactId>
<version>3.5</version>
<version>3.6</version>
<name>Apache Commons Math</name>
<inceptionYear>2003</inceptionYear>
......@@ -82,6 +82,11 @@
<id>rdonkin</id>
<email>rdonkin at apache dot org</email>
</developer>
<developer>
<name>Otmar Ertl</name>
<id>oertl</id>
<email>oertl at apache dot org</email>
</developer>
<developer>
<name>Luc Maisonobe</name>
<id>luc</id>
......@@ -251,6 +256,9 @@
<contributor>
<name>Piotr Kochanski</name>
</contributor>
<contributor>
<name>Sergei Lebedev</name>
</contributor>
<contributor>
<name>Bob MacCallum</name>
</contributor>
......@@ -344,6 +352,9 @@
<contributor>
<name>Xiaogang Zhang</name>
</contributor>
<contributor>
<name>Chris Popp</name>
</contributor>
</contributors>
<dependencies>
......@@ -363,9 +374,9 @@
<!-- This value must reflect the current name of the base package. -->
<commons.osgi.symbolicName>org.apache.commons.math3</commons.osgi.symbolicName>
<!-- do not use snapshot suffix here -->
<commons.release.version>3.5</commons.release.version>
<commons.release.version>3.6</commons.release.version>
<commons.release.desc>(requires Java 1.5+)</commons.release.desc>
<commons.rc.version>RC1</commons.rc.version>
<commons.rc.version>RC2</commons.rc.version>
<commons.binary.suffix>-bin</commons.binary.suffix>
<commons.release.2.version>2.2</commons.release.2.version>
......@@ -379,13 +390,13 @@
<commons.encoding>UTF-8</commons.encoding>
<maven.compiler.source>1.5</maven.compiler.source>
<maven.compiler.target>1.5</maven.compiler.target>
<math.pmd.version>2.7.1</math.pmd.version>
<math.findbugs.version>2.5.1</math.findbugs.version>
<math.checkstyle.version>2.9.1</math.checkstyle.version>
<math.pmd.version>3.5</math.pmd.version>
<math.findbugs.version>3.0.2</math.findbugs.version>
<math.checkstyle.version>2.17</math.checkstyle.version>
<math.clirr.version>2.6.1</math.clirr.version>
<!-- Temporary fix to support Java 8 -->
<commons.jacoco.version>0.7.2.201409121644</commons.jacoco.version>
<commons.jacoco.version>0.7.5.201505241946</commons.jacoco.version>
<commons.jacoco.classRatio>0.96</commons.jacoco.classRatio>
<commons.jacoco.instructionRatio>0.8</commons.jacoco.instructionRatio>