commons-math.git
8 years agoRelease candidate 3 for Apache Commons Math 3.3 has passed vote tags/MATH_3_3 MATH_3_3
Luc Maisonobe [Wed, 14 May 2014 18:42:03 +0000 (18:42 +0000)] 
Release candidate 3 for Apache Commons Math 3.3 has passed vote

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/tags/MATH_3_3@1594665 13f79535-47bb-0310-9956-ffa450edef68

8 years agoCreating Commons Math v3.3 tag. tags/MATH_3_3_RC3 MATH_3_3_RC3
Thomas Neidhart [Wed, 7 May 2014 20:40:29 +0000 (20:40 +0000)] 
Creating Commons Math v3.3 tag.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/tags/MATH_3_3_RC3@1593134 13f79535-47bb-0310-9956-ffa450edef68

8 years agoAdded StatUtils convenience methods and updated user guide for Kolmogorov-Smirnov...
Phil Steitz [Sun, 4 May 2014 23:19:43 +0000 (23:19 +0000)] 
Added StatUtils convenience methods and updated user guide for Kolmogorov-Smirnov tests.  JIRA: MATH-437.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1592430 13f79535-47bb-0310-9956-ffa450edef68

8 years agoRevert javadoc changes after discussion on the mailinglist.
Thomas Neidhart [Fri, 2 May 2014 09:04:01 +0000 (09:04 +0000)] 
Revert javadoc changes after discussion on the mailinglist.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1591835 13f79535-47bb-0310-9956-ffa450edef68

8 years agoFixed checkstyle error.
Luc Maisonobe [Fri, 2 May 2014 08:03:03 +0000 (08:03 +0000)] 
Fixed checkstyle error.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1591822 13f79535-47bb-0310-9956-ffa450edef68

8 years agoRemoved test based on the assumption that iterating over a
Gilles Sadowski [Thu, 1 May 2014 20:43:46 +0000 (20:43 +0000)] 
Removed test based on the assumption that iterating over a
"ConcurrentHashMap" would always provide its elements in a
random order. This seemed to be the case up to Java 7 but
not always in Java 8.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1591770 13f79535-47bb-0310-9956-ffa450edef68

8 years agoRe-enabled test, build is anyway not ready for Java 8.
Thomas Neidhart [Thu, 1 May 2014 20:05:31 +0000 (20:05 +0000)] 
Re-enabled test, build is anyway not ready for Java 8.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1591760 13f79535-47bb-0310-9956-ffa450edef68

8 years agoJavadoc fixes with Java 8.
Thomas Neidhart [Thu, 1 May 2014 13:48:02 +0000 (13:48 +0000)] 
Javadoc fixes with Java 8.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1591664 13f79535-47bb-0310-9956-ffa450edef68

8 years agoDisable randomly failing unit test.
Thomas Neidhart [Thu, 1 May 2014 12:14:14 +0000 (12:14 +0000)] 
Disable randomly failing unit test.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1591631 13f79535-47bb-0310-9956-ffa450edef68

8 years agoAdd missing due-to.
Thomas Neidhart [Thu, 1 May 2014 11:57:55 +0000 (11:57 +0000)] 
Add missing due-to.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1591626 13f79535-47bb-0310-9956-ffa450edef68

8 years ago[MATH-1110] Added constructor to OLSMultipleLinearRegression to be able to specify...
Thomas Neidhart [Thu, 1 May 2014 11:54:06 +0000 (11:54 +0000)] 
[MATH-1110] Added constructor to OLSMultipleLinearRegression to be able to specify a custom singularity threshold for QR decomposition. Thanks to Edward Segall.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1591624 13f79535-47bb-0310-9956-ffa450edef68

8 years agoFix typo.
Thomas Neidhart [Thu, 1 May 2014 11:12:12 +0000 (11:12 +0000)] 
Fix typo.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1591603 13f79535-47bb-0310-9956-ffa450edef68

8 years agoMATH-1092
Gilles Sadowski [Wed, 30 Apr 2014 22:18:03 +0000 (22:18 +0000)] 
MATH-1092
Added changelog entry.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1591497 13f79535-47bb-0310-9956-ffa450edef68

8 years agoAdded missing change entry for 3.3.
Luc Maisonobe [Wed, 30 Apr 2014 19:06:20 +0000 (19:06 +0000)] 
Added missing change entry for 3.3.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1591448 13f79535-47bb-0310-9956-ffa450edef68

8 years agoAdded findbugs exception for CMAES.
Luc Maisonobe [Wed, 30 Apr 2014 08:21:15 +0000 (08:21 +0000)] 
Added findbugs exception for CMAES.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1591212 13f79535-47bb-0310-9956-ffa450edef68

8 years agoJavadoc.
Luc Maisonobe [Wed, 30 Apr 2014 08:20:51 +0000 (08:20 +0000)] 
Javadoc.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1591211 13f79535-47bb-0310-9956-ffa450edef68

8 years agoApache is now part of the project name.
Thomas Neidhart [Tue, 29 Apr 2014 06:29:53 +0000 (06:29 +0000)] 
Apache is now part of the project name.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1590879 13f79535-47bb-0310-9956-ffa450edef68

8 years agoChange naming of tools jar to support the classifier tag of maven.
Thomas Neidhart [Mon, 28 Apr 2014 22:04:42 +0000 (22:04 +0000)] 
Change naming of tools jar to support the classifier tag of maven.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1590823 13f79535-47bb-0310-9956-ffa450edef68

8 years agoAdd link to javadoc of latest release.
Thomas Neidhart [Mon, 28 Apr 2014 21:33:38 +0000 (21:33 +0000)] 
Add link to javadoc of latest release.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1590809 13f79535-47bb-0310-9956-ffa450edef68

8 years agoUpdate changelog.
Thomas Neidhart [Mon, 28 Apr 2014 21:32:05 +0000 (21:32 +0000)] 
Update changelog.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1590808 13f79535-47bb-0310-9956-ffa450edef68

8 years agoFixed javadoc.
Luc Maisonobe [Mon, 28 Apr 2014 06:39:21 +0000 (06:39 +0000)] 
Fixed javadoc.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1590561 13f79535-47bb-0310-9956-ffa450edef68

8 years agoTypos.
Luc Maisonobe [Mon, 28 Apr 2014 06:39:01 +0000 (06:39 +0000)] 
Typos.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1590560 13f79535-47bb-0310-9956-ffa450edef68

8 years agoBuild empty polyhedrons set when given equal min/max boundaries.
Luc Maisonobe [Sat, 26 Apr 2014 17:36:34 +0000 (17:36 +0000)] 
Build empty polyhedrons set when given equal min/max boundaries.

Also explained better in the javadoc about some wrong usage of
PolyhedronsSet constructor.

JIRA: MATH-1115

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1590254 13f79535-47bb-0310-9956-ffa450edef68

8 years agoBuild properly empty polygons for equal min/max box.
Luc Maisonobe [Sat, 26 Apr 2014 16:55:11 +0000 (16:55 +0000)] 
Build properly empty polygons for equal min/max box.

JIRA: MATH-1117

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1590251 13f79535-47bb-0310-9956-ffa450edef68

8 years agoAdded a fast single-step method for fixed-step Runge-Kutta integrators.
Luc Maisonobe [Sun, 20 Apr 2014 14:29:42 +0000 (14:29 +0000)] 
Added a fast single-step method for fixed-step Runge-Kutta integrators.

JIRA: MATH-1119

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1588769 13f79535-47bb-0310-9956-ffa450edef68

8 years agoJavadoc.
Luc Maisonobe [Sun, 20 Apr 2014 13:30:16 +0000 (13:30 +0000)] 
Javadoc.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1588755 13f79535-47bb-0310-9956-ffa450edef68

8 years agoMath.nextUp is not available before Java 1.6.
Luc Maisonobe [Sun, 20 Apr 2014 13:25:36 +0000 (13:25 +0000)] 
Math.nextUp is not available before Java 1.6.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1588754 13f79535-47bb-0310-9956-ffa450edef68

8 years agoAdded an order 6 fixed-step ODE integrator.
Luc Maisonobe [Sun, 20 Apr 2014 13:25:11 +0000 (13:25 +0000)] 
Added an order 6 fixed-step ODE integrator.

The integrator was designed by H. A. Luther in 1968. We have added a
corresponding step interpolator by solving the order conditions provided
by the rkcheck tool.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1588753 13f79535-47bb-0310-9956-ffa450edef68

8 years agoRemoved deprecations of test(.) methods.
Phil Steitz [Sat, 19 Apr 2014 01:27:33 +0000 (01:27 +0000)] 
Removed deprecations of test(.) methods.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1588601 13f79535-47bb-0310-9956-ffa450edef68

8 years agoAdvertise the right exception.
Phil Steitz [Sat, 19 Apr 2014 01:24:37 +0000 (01:24 +0000)] 
Advertise the right exception.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1588600 13f79535-47bb-0310-9956-ffa450edef68

8 years agoMATH-1118
Gilles Sadowski [Fri, 18 Apr 2014 15:58:47 +0000 (15:58 +0000)] 
MATH-1118
Fixed compatibility of "equals(Object)" with "hashCode()" ("Complex" will
behave as JDK's "Double"). Added new methods for testing floating-point
equality.
Thanks to Cyrille Artho for reporting the issue.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1588500 13f79535-47bb-0310-9956-ffa450edef68

8 years agoTypo.
Gilles Sadowski [Thu, 17 Apr 2014 09:14:24 +0000 (09:14 +0000)] 
Typo.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1588182 13f79535-47bb-0310-9956-ffa450edef68

8 years agoMATH-1118
Gilles Sadowski [Tue, 15 Apr 2014 12:22:31 +0000 (12:22 +0000)] 
MATH-1118
Equality of double values in accordance with the semantics of "java.lang.Double".

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1587548 13f79535-47bb-0310-9956-ffa450edef68

8 years agoMATH-1116
Gilles Sadowski [Tue, 15 Apr 2014 10:02:54 +0000 (10:02 +0000)] 
MATH-1116
Javadoc

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1587494 13f79535-47bb-0310-9956-ffa450edef68

8 years agoReplace tabs.
Thomas Neidhart [Thu, 27 Mar 2014 21:47:41 +0000 (21:47 +0000)] 
Replace tabs.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1582491 13f79535-47bb-0310-9956-ffa450edef68

8 years agoClearer statements.
Gilles Sadowski [Tue, 25 Mar 2014 16:05:36 +0000 (16:05 +0000)] 
Clearer statements.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1581393 13f79535-47bb-0310-9956-ffa450edef68

8 years agoMinimize number of array accesses.
Gilles Sadowski [Tue, 25 Mar 2014 16:00:36 +0000 (16:00 +0000)] 
Minimize number of array accesses.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1581391 13f79535-47bb-0310-9956-ffa450edef68

8 years ago"final" keyword.
Gilles Sadowski [Tue, 25 Mar 2014 15:57:18 +0000 (15:57 +0000)] 
"final" keyword.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1581389 13f79535-47bb-0310-9956-ffa450edef68

8 years agoMinimize number of array accesses.
Gilles Sadowski [Tue, 25 Mar 2014 15:51:25 +0000 (15:51 +0000)] 
Minimize number of array accesses.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1581383 13f79535-47bb-0310-9956-ffa450edef68

8 years ago"final" keyword.
Gilles Sadowski [Tue, 25 Mar 2014 15:48:28 +0000 (15:48 +0000)] 
"final" keyword.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1581381 13f79535-47bb-0310-9956-ffa450edef68

8 years agoJavadoc.
Gilles Sadowski [Wed, 19 Mar 2014 18:43:39 +0000 (18:43 +0000)] 
Javadoc.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1579346 13f79535-47bb-0310-9956-ffa450edef68

8 years agoMATH-1111
Gilles Sadowski [Wed, 19 Mar 2014 18:33:13 +0000 (18:33 +0000)] 
MATH-1111
Javadoc.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1579343 13f79535-47bb-0310-9956-ffa450edef68

8 years agoImproved brackting utility for univariate solvers.
Luc Maisonobe [Mon, 17 Mar 2014 15:14:07 +0000 (15:14 +0000)] 
Improved brackting utility for univariate solvers.

Bracketing utility for univariate root solvers now returns a tighter
interval than before. It also allows choosing the search interval
expansion rate, supporting both linear and asymptotically exponential
rates.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1578428 13f79535-47bb-0310-9956-ffa450edef68

8 years agoFixed failing test.
Luc Maisonobe [Mon, 3 Mar 2014 11:11:46 +0000 (11:11 +0000)] 
Fixed failing test.

As functions evaluations were not counted properly, which has been fixed
a few days ago, the multi-start test in fact did not performed all
expected restarts. This commit fixes this (by increasing the max
evaluations), and fixes the result checks accordingly.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1573523 13f79535-47bb-0310-9956-ffa450edef68

8 years agoPrevent penalties to grow multiplicatively in CMAES.
Luc Maisonobe [Mon, 3 Mar 2014 09:58:29 +0000 (09:58 +0000)] 
Prevent penalties to grow multiplicatively in CMAES.

Patch provided by Bruce A Johnson.

JIRA: MATH-1107

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1573506 13f79535-47bb-0310-9956-ffa450edef68

8 years agoAdd SVD to GaussNewtonOptimizer
Luc Maisonobe [Sun, 2 Mar 2014 19:54:43 +0000 (19:54 +0000)] 
Add SVD to GaussNewtonOptimizer

Allow using the SVD decomposition which has excellent stability and can
provide a "solution" for singular problems.

Figured out why one of the least squares tests did not check two of the
states. There was only one equation for the two states. The test now
verifies the states satisfy the constraint.

Patch provided by Evan Ward.

JIRA: MATH-1104

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1573351 13f79535-47bb-0310-9956-ffa450edef68

8 years agoMATH-1092
Gilles Sadowski [Sun, 2 Mar 2014 19:38:47 +0000 (19:38 +0000)] 
MATH-1092
Javadoc.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1573341 13f79535-47bb-0310-9956-ffa450edef68

8 years agoMATH-1092
Gilles Sadowski [Sun, 2 Mar 2014 14:54:37 +0000 (14:54 +0000)] 
MATH-1092
Added parameter in "LineSearch" and "NonLinearConjugateGradientOptimizer".

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1573316 13f79535-47bb-0310-9956-ffa450edef68

8 years agoFix switched iterations and evaluations
Luc Maisonobe [Sun, 2 Mar 2014 14:02:50 +0000 (14:02 +0000)] 
Fix switched iterations and evaluations

In LevenbergMarquardtOptimizer the number of iterations and evaluations
was switched in two of the return statements.

Patch provided by Evan Ward.

JIRA: MATH-1106

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1573308 13f79535-47bb-0310-9956-ffa450edef68

8 years agoFix checker seeing not old point
Luc Maisonobe [Sun, 2 Mar 2014 14:02:21 +0000 (14:02 +0000)] 
Fix checker seeing not old point

ConvergenceCheckers always saw previous.getPoint() to equal
current.getPoint() because the optimizers used the same array and did
not make a copy of the previous point. Fixed by using a new array for
each model evaluation and LSP.evaluate() now makes its own copy of the
state vector as well.

Path provided by Evan Ward.

JIRA: MATH-1103

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1573307 13f79535-47bb-0310-9956-ffa450edef68

8 years agoFix typo.
Thomas Neidhart [Sun, 2 Mar 2014 08:31:30 +0000 (08:31 +0000)] 
Fix typo.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1573271 13f79535-47bb-0310-9956-ffa450edef68

8 years agoMATH-1092
Gilles Sadowski [Fri, 28 Feb 2014 16:23:26 +0000 (16:23 +0000)] 
MATH-1092

Extracted class "LineSearch" from "PowellOptimizer".
Made method "computeObjectiveValue" public in "MultivariateOptimizer".
Modified "PowellOptimizer" to use the now public class.
"NonLinearConjugateGradientOptimizer" uses the new "LineSearch".
Added constructors to set the line search tolerances and deprecated
obsolete contructors and inner classes ("BracketingStep" and
"LineSearchFunction".
Removed method "findUpperBound".

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1572988 13f79535-47bb-0310-9956-ffa450edef68

8 years agoFixed comment.
Phil Steitz [Wed, 26 Feb 2014 23:24:21 +0000 (23:24 +0000)] 
Fixed comment.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1572341 13f79535-47bb-0310-9956-ffa450edef68

8 years agoAdded KolmogorovSmirnovTest, deprecated KolmogorovSmirnovDistributio. JIRA: MATH-437
Phil Steitz [Wed, 26 Feb 2014 23:14:08 +0000 (23:14 +0000)] 
Added KolmogorovSmirnovTest, deprecated KolmogorovSmirnovDistributio. JIRA: MATH-437

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1572335 13f79535-47bb-0310-9956-ffa450edef68

8 years agoImproved test coverage.
Luc Maisonobe [Tue, 25 Feb 2014 16:42:07 +0000 (16:42 +0000)] 
Improved test coverage.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1571737 13f79535-47bb-0310-9956-ffa450edef68

8 years agoTypo.
Gilles Sadowski [Tue, 25 Feb 2014 10:27:21 +0000 (10:27 +0000)] 
Typo.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1571640 13f79535-47bb-0310-9956-ffa450edef68

8 years agoFixed small inconsistency.
Gilles Sadowski [Tue, 25 Feb 2014 10:26:55 +0000 (10:26 +0000)] 
Fixed small inconsistency.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1571639 13f79535-47bb-0310-9956-ffa450edef68

8 years agoJavadoc.
Luc Maisonobe [Tue, 25 Feb 2014 09:21:32 +0000 (09:21 +0000)] 
Javadoc.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1571627 13f79535-47bb-0310-9956-ffa450edef68

8 years agoMake AbstractEvaluation public
Luc Maisonobe [Mon, 24 Feb 2014 14:58:07 +0000 (14:58 +0000)] 
Make AbstractEvaluation public

Allow custom implementations of LeastSquaresProblem to use the default
methods for computing the covariance, rms, etc.

JIRA: MATH-1102

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1571307 13f79535-47bb-0310-9956-ffa450edef68

8 years agoIn LeastSquaresProblem.Evaluation removed the getValue() method.
Luc Maisonobe [Mon, 24 Feb 2014 14:57:44 +0000 (14:57 +0000)] 
In LeastSquaresProblem.Evaluation removed the getValue() method.

- The residuals are the really the values of the objective function
  that is being minimized.
- Forcing the value to be a real vector and the residual computed
  through subtraction is an unnecessary constraint. For example
  Rotation.distance() will compute a better residual than
  subtracting the quaternion elements of two rotations.
- Method was not used by any optimizer.

JIRA: MATH-1102

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1571306 13f79535-47bb-0310-9956-ffa450edef68

8 years agoMoved OptimizationProblem interface to optim package.
Luc Maisonobe [Sun, 23 Feb 2014 14:00:48 +0000 (14:00 +0000)] 
Moved OptimizationProblem interface to optim package.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1571015 13f79535-47bb-0310-9956-ffa450edef68

8 years agoChange private least square problem implementation to internal class.
Luc Maisonobe [Sun, 23 Feb 2014 14:00:20 +0000 (14:00 +0000)] 
Change private least square problem implementation to internal class.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1571014 13f79535-47bb-0310-9956-ffa450edef68

8 years agoImproved documentation of QR decomposition handling of singular matrix.
Luc Maisonobe [Sun, 23 Feb 2014 11:10:41 +0000 (11:10 +0000)] 
Improved documentation of QR decomposition handling of singular matrix.

JIRA: MATH-1101

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1570994 13f79535-47bb-0310-9956-ffa450edef68

8 years agoQR decomposition can compute pseudo-inverses for tall matrices.
Luc Maisonobe [Fri, 21 Feb 2014 13:18:35 +0000 (13:18 +0000)] 
QR decomposition can compute pseudo-inverses for tall matrices.

Thanks to Sean Owen for the patch.

JIRA: MATH-1053

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1570566 13f79535-47bb-0310-9956-ffa450edef68

8 years agoField vectors now implement the visitor pattern just like real vectors.
Luc Maisonobe [Fri, 21 Feb 2014 11:26:09 +0000 (11:26 +0000)] 
Field vectors now implement the visitor pattern just like real vectors.

JIRA: MATH-820

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1570536 13f79535-47bb-0310-9956-ffa450edef68

8 years agoUn-deprecated RealVector.sparseIterator.
Luc Maisonobe [Fri, 21 Feb 2014 10:16:52 +0000 (10:16 +0000)] 
Un-deprecated RealVector.sparseIterator.

The documentation now explicitly states that entries not iterated above
are the zero ones.

This is part of Apache Commons Math reconsidering support for sparse
linear algebra.

JIRA: MATH-875

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1570510 13f79535-47bb-0310-9956-ffa450edef68

8 years agoRelaxed specification for function mapping on vectors.
Luc Maisonobe [Thu, 20 Feb 2014 16:16:19 +0000 (16:16 +0000)] 
Relaxed specification for function mapping on vectors.

JIRA: MATH-821

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1570254 13f79535-47bb-0310-9956-ffa450edef68

8 years agoContinue un-deprecation of sparse methods.
Luc Maisonobe [Thu, 20 Feb 2014 15:56:37 +0000 (15:56 +0000)] 
Continue un-deprecation of sparse methods.

JIRA: MATH-870
JIRA: MATH-803

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1570246 13f79535-47bb-0310-9956-ffa450edef68

8 years agoAdded a test showing the limitation of sparse matrices implementation.
Luc Maisonobe [Thu, 20 Feb 2014 14:52:13 +0000 (14:52 +0000)] 
Added a test showing the limitation of sparse matrices implementation.

JIRA:MATH-870.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1570209 13f79535-47bb-0310-9956-ffa450edef68

8 years agocomputeXxx renamed getXxx in the Evaluation interface (leastsquares).
Luc Maisonobe [Thu, 20 Feb 2014 14:35:14 +0000 (14:35 +0000)] 
computeXxx renamed getXxx in the Evaluation interface (leastsquares).

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1570206 13f79535-47bb-0310-9956-ffa450edef68

8 years agoMake QR the default in GaussNewtonOptimizer
Luc Maisonobe [Wed, 19 Feb 2014 20:32:43 +0000 (20:32 +0000)] 
Make QR the default in GaussNewtonOptimizer

Theoretically QR offers the best blend of speed and numerical stability.
Empirically the QR implementation is slightly faster than the Cholesky
implementation.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1569907 13f79535-47bb-0310-9956-ffa450edef68

8 years agoAdd Cholesky option to GaussNewtonOptimizer
Luc Maisonobe [Wed, 19 Feb 2014 20:32:20 +0000 (20:32 +0000)] 
Add Cholesky option to GaussNewtonOptimizer

Since the normal matrix is symmetric positive (semi-)definite, the
Cholesky decomposition is theoretically faster.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1569906 13f79535-47bb-0310-9956-ffa450edef68

8 years agoMake QR in GaussNewton faster and more accurate
Luc Maisonobe [Wed, 19 Feb 2014 20:31:47 +0000 (20:31 +0000)] 
Make QR in GaussNewton faster and more accurate

Re-factored the code in GaussNewtonOptimizer so that the decomposition
algorithm sees the Jacobian and residuals instead of the normal
equation. This lets the QR algorithm operate directly on the Jacobian
matrix, which is faster and less sensitive to numerical errors. As a
result, one test case that threw a singular matrix exception now passes
with the QR decomposition.

The refactoring also include a speed improvement when computing the
normal matrix for the LU decomposition. Since the normal matrix is
symmetric only half of is computed, which results in a factor of 2 speed
up in computing the normal matrix for problems with many more
measurements than states.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1569905 13f79535-47bb-0310-9956-ffa450edef68

8 years agoThe sparse vector and matrix classes have been un-deprecated.
Luc Maisonobe [Wed, 19 Feb 2014 17:19:59 +0000 (17:19 +0000)] 
The sparse vector and matrix classes have been un-deprecated.

This is a reversal of a former decision, as we now think we should adopt
a generally accepted behavior which is ... to ignore the problems of
NaNs and infinities in sparse linear algebra entities.

JIRA: MATH-870 (which is therefore NOT fixed)

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1569825 13f79535-47bb-0310-9956-ffa450edef68

8 years agoJavadoc.
Luc Maisonobe [Tue, 18 Feb 2014 15:11:46 +0000 (15:11 +0000)] 
Javadoc.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1569380 13f79535-47bb-0310-9956-ffa450edef68

8 years agoRemoved interfaces in the fluent API that do not add any value.
Luc Maisonobe [Tue, 18 Feb 2014 14:33:57 +0000 (14:33 +0000)] 
Removed interfaces in the fluent API that do not add any value.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1569363 13f79535-47bb-0310-9956-ffa450edef68

8 years agoFixed checkstyle and compiler warnings.
Luc Maisonobe [Tue, 18 Feb 2014 14:33:49 +0000 (14:33 +0000)] 
Fixed checkstyle and compiler warnings.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1569362 13f79535-47bb-0310-9956-ffa450edef68

8 years agoExpand Evaluation tests, use weighted values.
Luc Maisonobe [Tue, 18 Feb 2014 14:33:41 +0000 (14:33 +0000)] 
Expand Evaluation tests, use weighted values.

Added more test cases to EvaluationTest to test the other methods of
DenseWeightedEvaluation/UnweightedEvaluation.

Fixed a bug in DenseWeightedEvaluation.computeValue() where the the
weights were not applied to the return value.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1569361 13f79535-47bb-0310-9956-ffa450edef68

8 years agoQualify Evaluation in interfaces.
Luc Maisonobe [Tue, 18 Feb 2014 14:33:33 +0000 (14:33 +0000)] 
Qualify Evaluation in interfaces.

Use LeastSquaresProblem.Evaluation in the public interfaces for
readability.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1569360 13f79535-47bb-0310-9956-ffa450edef68

8 years agoJUnit directly executes least squares tests
Luc Maisonobe [Tue, 18 Feb 2014 14:33:28 +0000 (14:33 +0000)] 
JUnit directly executes least squares tests

Previously JUnit would make the call to test a specific optimizer, and
then that method would call all of the individual test cases relevant to
that optimizer.,Now JUnit will directly call each individual test case.

The same test coverage is preserved. The GaussNewtonOptimizerTest is
split into two classes, one for each decomposition algorithm it can use.
There is a significant amount of duplicated code between
GaussNewtonOptimizerWithLUTest and GaussNewtonOptimizerWithQRTest.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1569359 13f79535-47bb-0310-9956-ffa450edef68

8 years agoFixed errors introduced by few previous API changes.
Luc Maisonobe [Tue, 18 Feb 2014 14:33:20 +0000 (14:33 +0000)] 
Fixed errors introduced by few previous API changes.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1569358 13f79535-47bb-0310-9956-ffa450edef68

8 years agoFix Javadoc and checkstyle errors.
Luc Maisonobe [Tue, 18 Feb 2014 14:33:14 +0000 (14:33 +0000)] 
Fix Javadoc and checkstyle errors.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1569357 13f79535-47bb-0310-9956-ffa450edef68

8 years agoClean up LeastSquaresBuilder
Luc Maisonobe [Tue, 18 Feb 2014 14:33:08 +0000 (14:33 +0000)] 
Clean up LeastSquaresBuilder

Provide methods for using old and new interfaces. Data is stored internally
using the new interfaces now.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1569356 13f79535-47bb-0310-9956-ffa450edef68

8 years agoClean up LeastSquaresFactory
Luc Maisonobe [Tue, 18 Feb 2014 14:33:00 +0000 (14:33 +0000)] 
Clean up LeastSquaresFactory

* There are now 3 factory methods: one using the previous interfaces, one using
  the new interfaces with weights, and one using the new interfaces without
  weights.

* Make model(...) method public.

* Fix javadoc typo

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1569355 13f79535-47bb-0310-9956-ffa450edef68

8 years agoUse Real{Vector,Matrix} in LeastSquares interfaces
Luc Maisonobe [Tue, 18 Feb 2014 14:32:54 +0000 (14:32 +0000)] 
Use Real{Vector,Matrix} in LeastSquares interfaces

Covered all of the interfaces in the leastsquares package to use RealVector and
RealMatrix instead of double[] and double[][]. This reduced some duplicated code.
For example Evaluation.computeResiduals() was a complete duplication of
RealVector.subtract(). It also presents a consistent interface and allows data
encapsulation.

Lastly, this change enables [math] to "eat our own dog food." It enables the
linear package to be used in the implementation of the optimization algorithms.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1569354 13f79535-47bb-0310-9956-ffa450edef68

8 years agoUse Evaluation instead of PointVectorValuePair
Luc Maisonobe [Tue, 18 Feb 2014 14:32:44 +0000 (14:32 +0000)] 
Use Evaluation instead of PointVectorValuePair

Use Evaluation instead of PointVectorValuePair in the ConvergenceChecker. This
gives the checkers access to more information, such as the rms and covariances.
The change also simplified the optimizer implementations since they no longer
have to keep track of the current function value.

A method was added to LeastSquaresFactory to convert between the two types of
checkers and a method added to LeastSquaresBuilder so that it can accept either
type. I would have prefered to do this through method overloading, but
overloading doesn't play well with generics.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1569353 13f79535-47bb-0310-9956-ffa450edef68

8 years agoUse enum for LU or QR in GaussNewtonOptimizer
Luc Maisonobe [Tue, 18 Feb 2014 14:32:36 +0000 (14:32 +0000)] 
Use enum for LU or QR in GaussNewtonOptimizer

Changed the boolean useLu prarameter to an enum. This is benificial because:
1. user code is easier to read: new GNO(Decomposition.QR) instead of new GNO(false)
2. Allows other algorithms to be added in the future
3. developer code is easier to read. One less if statement in optimize()

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1569352 13f79535-47bb-0310-9956-ffa450edef68

8 years agoMake infinite loop in GaussNewton explicit.
Luc Maisonobe [Tue, 18 Feb 2014 14:32:28 +0000 (14:32 +0000)] 
Make infinite loop in GaussNewton explicit.

The main loop in GN could only be ended by convergence or exception. I made that
explicit with while(true) and removed an unreachable MathInternalError.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1569350 13f79535-47bb-0310-9956-ffa450edef68

8 years agoLevenbergMarquardtOptimizer is thread safe.
Luc Maisonobe [Tue, 18 Feb 2014 14:32:23 +0000 (14:32 +0000)] 
LevenbergMarquardtOptimizer is thread safe.

Converted the mutable fields to locals.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1569349 13f79535-47bb-0310-9956-ffa450edef68

8 years agoAdd Javadoc to LeastSquaresBuilder.
Luc Maisonobe [Tue, 18 Feb 2014 14:32:17 +0000 (14:32 +0000)] 
Add Javadoc to LeastSquaresBuilder.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1569348 13f79535-47bb-0310-9956-ffa450edef68

8 years agoFixup javadoc in LeastSquaresProblem
Luc Maisonobe [Tue, 18 Feb 2014 14:32:11 +0000 (14:32 +0000)] 
Fixup javadoc in LeastSquaresProblem

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1569347 13f79535-47bb-0310-9956-ffa450edef68

8 years agoValue and Jacobian evaluated in a single method.
Luc Maisonobe [Tue, 18 Feb 2014 14:32:06 +0000 (14:32 +0000)] 
Value and Jacobian evaluated in a single method.

A new interface MultivariateJacobianFunction lets the function value and
Jacobian be evaluated at the same time. This saves the user from having to cache
the result between calls to get the value and the jacobian.

A factory method was added to create LeastSquaresProblems from the new interface.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1569346 13f79535-47bb-0310-9956-ffa450edef68

8 years agoClean up LeastSquaresProblemImpl
Luc Maisonobe [Tue, 18 Feb 2014 14:31:59 +0000 (14:31 +0000)] 
Clean up LeastSquaresProblemImpl

Reorder constructor parameters to match LeastSquaresFactory and remove an unused
method.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1569345 13f79535-47bb-0310-9956-ffa450edef68

8 years agoImplicit Weights
Luc Maisonobe [Tue, 18 Feb 2014 14:31:53 +0000 (14:31 +0000)] 
Implicit Weights

The weights are no longer implicit in LeastSquaresProblem.Evaluation. They are
already included in the computed residuals and Jacobian.

GN and LM multiplied the residuals by the weights immediately, so that was easy
to remove.

Created an AbstractEvaluation class which handles the derived quantitied (cost,
rms, covariance,...) and two implementations. UnweightedEvaluation uses the
straight forward formulas. DenseWeightedEvaluation delegates to an Evaluation
and multiples the residuals and Jacobian by the square root of the weight matrix
before returning them. Allowed me to remove the reference to the full weight
matrix.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1569344 13f79535-47bb-0310-9956-ffa450edef68

8 years agoImmutable Optimizer configuration.
Luc Maisonobe [Tue, 18 Feb 2014 14:31:43 +0000 (14:31 +0000)] 
Immutable Optimizer configuration.

The GN and LM optimizers now use an immutable fields for their configuration
parameters and a fluent api. LM still has some mutable fields it uses a scratch
space.

This commit is a backport of Evan Ward github commit
    https://github.com/wardev/commons-math/commit/157cdde
into the current development version.

Conflicts:
src/main/java/org/apache/commons/math3/fitting/leastsquares/GaussNewtonOptimizer.java
src/main/java/org/apache/commons/math3/fitting/leastsquares/LevenbergMarquardtOptimizer.java

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1569343 13f79535-47bb-0310-9956-ffa450edef68

8 years agoSeparate least squares algorithm from problem.
Luc Maisonobe [Tue, 18 Feb 2014 14:31:34 +0000 (14:31 +0000)] 
Separate least squares algorithm from problem.

The least squares package now has two main interfaces LeastSquaresOptimizer and
LeastSquaresProblem, where the optimizer can be applied to the problem.

In this commit all of the test cases pass with one change (annotated) to
LevenbergMarquardt.testControlParameters(). The tests for Gauss Newton were
expanded to cover using the QR decomposition, which revealed a QR default
tolerance discrepancy.

A factory and a mutable builder were create for LeastSquaresProblem.

This commit is a backport of Evan Ward github commit
 https://github.com/wardev/commons-math/commit/7e9a15efb535b91afad9d8275eb2864ea2295ab4
into the current development version.

Conflicts:
src/main/java/org/apache/commons/math3/fitting/leastsquares/AbstractLeastSquaresOptimizer.java
src/main/java/org/apache/commons/math3/fitting/leastsquares/GaussNewtonOptimizer.java
src/main/java/org/apache/commons/math3/optim/AbstractOptimizer.java
src/test/java/org/apache/commons/math3/fitting/leastsquares/AbstractLeastSquaresOptimizerAbstractTest.java
src/test/java/org/apache/commons/math3/fitting/leastsquares/GaussNewtonOptimizerTest.java
src/test/java/org/apache/commons/math3/fitting/leastsquares/LevenbergMarquardtOptimizerTest.java

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1569342 13f79535-47bb-0310-9956-ffa450edef68

8 years agoUpdate test after adding new error message.
Thomas Neidhart [Sun, 16 Feb 2014 12:32:52 +0000 (12:32 +0000)] 
Update test after adding new error message.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1568754 13f79535-47bb-0310-9956-ffa450edef68

8 years ago[MATH-749] Remove GrahamScan, GiftWrap, make MonotoneChain more robust wrt collinear...
Thomas Neidhart [Sun, 16 Feb 2014 12:19:51 +0000 (12:19 +0000)] 
[MATH-749] Remove GrahamScan, GiftWrap, make MonotoneChain more robust wrt collinear points, add ConvergenceException in case the specified tolerance results in a non-convex hull.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1568752 13f79535-47bb-0310-9956-ffa450edef68

8 years agoRewrote completely the enclosing spherical cap computation on 2-sphere.
Luc Maisonobe [Wed, 12 Feb 2014 11:12:45 +0000 (11:12 +0000)] 
Rewrote completely the enclosing spherical cap computation on 2-sphere.

The previous version was based on Welzl algorithm, but it appeared this
algorithm really need some properties that hold in Euclidean spaces and
not on the sphere.

The current version is not perfect in the sense that some times the
enclosing spherical cap returned is not the smallest possible. It is
documented in the Javadoc.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1567599 13f79535-47bb-0310-9956-ffa450edef68

8 years agoFurther improvements.
Thomas Neidhart [Tue, 11 Feb 2014 22:33:39 +0000 (22:33 +0000)] 
Further improvements.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1567427 13f79535-47bb-0310-9956-ffa450edef68