Commit Graph

4320 Commits

Author SHA1 Message Date
Sebastien Brisard 95bf9fb6cf In AbstractRealMatrix, removed empty abstract method copy() (specified in interface RealMatrix).
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1388296 13f79535-47bb-0310-9956-ffa450edef68
2012-09-21 01:53:28 +00:00
Sebastien Brisard d2258eff70 Removed some @Override tags, which have become illegal following some changes in r1388154.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1388294 13f79535-47bb-0310-9956-ffa450edef68
2012-09-21 01:49:51 +00:00
Sebastien Brisard b2cea08e85 MATH-854
- filled the "throws" clause of Array2DRowRealMatrix,
  - corrected some method signatures in RealMatrix and AbstractRealMatrix accordingly,
  - in AbstractRealMatrix, removed "abstract implementations" of some methods specified in interface RealMatrix, as they serve no purpose.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1388154 13f79535-47bb-0310-9956-ffa450edef68
2012-09-20 18:50:45 +00:00
Gilles Sadowski 7a74137904 MATH-863
New "Quaternion" class. Thanks to Julien Anxionnat.
After applying the original patch, the following changes were made:
* Renamed the "static" quaternion instances ("PLUS_" prefix removed).
* Removed some (syntactic sugar) methods; removed or modified corresponding
  unit tests.
* Made the redundant accessors call the "canonic" ones.
* Removed the default tolerance and added an explicit tolerance parameter
  in methods that depend on equality testing.
* When a "ZeroException" is thrown, the actual value of the norm is provided
  in the detailed message (as the implementation actually does not use a
  strict comparison with 0).
* Added "equals(Object)" and "hashCode" methods.
* Javadoc and formatting. Added license header.
* Removed "toString" documentation (as this representation should not be
  binding). Changed the representation to not use a comma.
* Renamed "scalarMultiply" to "multiply".
* More stringent tolerance used in the unit tests assertions, whenever
  possible.
* Added unit tests.



git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1388099 13f79535-47bb-0310-9956-ffa450edef68
2012-09-20 16:21:46 +00:00
Gilles Sadowski 600f00ba58 MATH-866
Method to test for equality with a given relative tolerance (due to
Yannick Tanguy and Julien Anxionnat). Original patch provided in
JIRA MATH-863 and committed with a few changes.


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1387941 13f79535-47bb-0310-9956-ffa450edef68
2012-09-20 10:09:37 +00:00
Thomas Neidhart b245e08d24 Removed exception from throws clause which is never thrown.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1387637 13f79535-47bb-0310-9956-ffa450edef68
2012-09-19 15:21:57 +00:00
Thomas Neidhart 322fde4ec5 Javadoc formatting.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1387635 13f79535-47bb-0310-9956-ffa450edef68
2012-09-19 15:15:43 +00:00
Luc Maisonobe a20a890fa6 Typo.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1387501 13f79535-47bb-0310-9956-ffa450edef68
2012-09-19 09:12:01 +00:00
Luc Maisonobe c390c53c22 Removed dead test code.
The code was never used and was an implementation of a now deprecated
interface.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1387084 13f79535-47bb-0310-9956-ffa450edef68
2012-09-18 10:30:01 +00:00
Luc Maisonobe 5259df5f91 Fail early on wrong derivation order.
If the user asks for a derivation order that is too large for the number
of points in the finite differences algorithm, we now detect it before
the first call to the underlying function.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1387064 13f79535-47bb-0310-9956-ffa450edef68
2012-09-18 09:07:54 +00:00
Sebastien Brisard 19c954cabc MATH-854: populated throws clause of AbstractRealMatrix.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1387002 13f79535-47bb-0310-9956-ffa450edef68
2012-09-18 06:38:33 +00:00
Thomas Neidhart f91ffbac36 Add findbugs exception for RealVector#equals method.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1386794 13f79535-47bb-0310-9956-ffa450edef68
2012-09-17 19:54:33 +00:00
Luc Maisonobe 830cd9eeca Added a FiniteDifferencesDifferentiator class.
This class implements both UnivariateFunctionDifferentiator,
UnivariateVectorFunctionDifferentiator and
UnivariateMatrixFunctionDifferentiator. It is not limited in the
derivation order, but checks the order is consistent with the number of
points. Typically, attempting to extract 5th derivative from a 3 points
scheme will not work (a NumberIsTooLargeException will be thrown,
referencing the derivation order).

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1386745 13f79535-47bb-0310-9956-ffa450edef68
2012-09-17 17:42:47 +00:00
Luc Maisonobe 3876bd9bc4 Added a way to create DerivativeStructure from all derivatives.
In some cases, users may already have all the derivatives available at
once. It was impossible to use this knowledge and create the object, so
users had to user dirty tricks like adding together variables holding
value and zero derivative with variables holding derivatives and zero
value.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1386743 13f79535-47bb-0310-9956-ffa450edef68
2012-09-17 17:42:19 +00:00
Luc Maisonobe be26e43b98 Added differentiator interfaces for vector and matrix functions.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1386742 13f79535-47bb-0310-9956-ffa450edef68
2012-09-17 17:41:54 +00:00
Luc Maisonobe 69f087edcb Differentiable function can trigger any MathIllegalArgumentException.
One very important case corresponds to an unsupported derivation order.
The order is not enforced in the API, but is specified as the properties
of the DerivativeStructure argument, as well as the number of free
parameters. Some functions have no limitation on this order (typically
functions implemented using only the DerivativeStructure API), but some
functions may limit the derivation order to 1 or 2 as they implement the
differentiation themselves or through finite differences.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1386741 13f79535-47bb-0310-9956-ffa450edef68
2012-09-17 17:41:24 +00:00
Sebastien Brisard 06880f1138 Populated throws clause of RealMatrix (MATH-854); javadoc + formatting.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1386486 13f79535-47bb-0310-9956-ffa450edef68
2012-09-17 06:48:04 +00:00
Phil Steitz dae4cf5da1 Added missing throws declarations and fixed javadoc to match what is actually thrown. JIRA: MATH-854.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1385386 13f79535-47bb-0310-9956-ffa450edef68
2012-09-16 22:11:15 +00:00
Thomas Neidhart 0752ffec8f [MATH-666] added to changes.xml.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1385318 13f79535-47bb-0310-9956-ffa450edef68
2012-09-16 16:54:20 +00:00
Thomas Neidhart 79f99111d5 [MATH-666] make FieldVector#getData() method deprecated in favor of toArray(), minor formatting, move implementation of SparseFieldVector#getData() to toArray().
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1385316 13f79535-47bb-0310-9956-ffa450edef68
2012-09-16 16:50:32 +00:00
Thomas Neidhart 1f914f9917 Removed trailing spaces.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1385315 13f79535-47bb-0310-9956-ffa450edef68
2012-09-16 16:37:34 +00:00
Thomas Neidhart b694b79c60 Javadoc formatting and fixes.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1385314 13f79535-47bb-0310-9956-ffa450edef68
2012-09-16 16:35:49 +00:00
Thomas Neidhart be41bc2053 Removed unused imports.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1385313 13f79535-47bb-0310-9956-ffa450edef68
2012-09-16 16:35:23 +00:00
Thomas Neidhart 7536672818 Javadoc cleanup of transform package, removed unnecessary paragraph tags.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1385310 13f79535-47bb-0310-9956-ffa450edef68
2012-09-16 16:32:10 +00:00
Thomas Neidhart 75fe8b8b99 Javadoc cleanup of linear optimization package.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1385307 13f79535-47bb-0310-9956-ffa450edef68
2012-09-16 16:19:55 +00:00
Thomas Neidhart 0a900fa692 Javadoc fixes.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1385301 13f79535-47bb-0310-9956-ffa450edef68
2012-09-16 16:11:53 +00:00
Thomas Neidhart 9ad58f46b0 Replace deprecated method call.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1385299 13f79535-47bb-0310-9956-ffa450edef68
2012-09-16 16:09:17 +00:00
Thomas Neidhart 497fe1c79b Remove trailing spaces in javadoc.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1385298 13f79535-47bb-0310-9956-ffa450edef68
2012-09-16 16:09:00 +00:00
Thomas Neidhart 1a9e32ab8f [MATH-854] fill throws clause for genetics package.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1385297 13f79535-47bb-0310-9956-ffa450edef68
2012-09-16 16:05:57 +00:00
Thomas Neidhart ef8beb8b2b Javadoc cleanup of genetics package.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1385284 13f79535-47bb-0310-9956-ffa450edef68
2012-09-16 15:19:55 +00:00
Thomas Neidhart 6709b11f9e Javadoc fixes.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1385279 13f79535-47bb-0310-9956-ffa450edef68
2012-09-16 15:06:06 +00:00
Thomas Neidhart 51f446bf0c [MATH-789] Fixed rank calculation in case of dependant columns, added additional constructor that repaces small parameter.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1384945 13f79535-47bb-0310-9956-ffa450edef68
2012-09-14 21:55:46 +00:00
Luc Maisonobe c8b8e61243 Use the new differentiation framework in optimization package.
As a temporary hack for backward compatibility, some optimizers do
provide "optimize" methods which accept the new functions signatures
(i.e. MultivariateDifferentiableXxxFunction), but they do *not*
advertise it in their "implements" clause. The reason for that is that
Java forbid implementing a parameterized interface with two different
parameters. These optimizers already implement the interface with the
older functions signatures, and this cannot be removed as of 3.1.

When 4.0 will be started, the old signatures will be removed, and the
"implements" declarations will be updated.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1384907 13f79535-47bb-0310-9956-ffa450edef68
2012-09-14 20:17:00 +00:00
Luc Maisonobe 8bac3361f2 Fixed too large memory consumption in DSCompiler.
Prior to this correction, when at one point in a program a user needed a
derivative with 1 parameter and order 5, and at another point needed a
derivative with 30 parameters and order 1, all DSCompilers from 1x1 to
30x5 were created. As the compilation rules for 30 parameters and 5
order are huge, this failed with memory heap errors after several
gigabytes were consumed.

The fix is to simply build the necessary compilers, and let the array
contain null references for the compilers never used (these null
references will be populated later if the user ask for some intermediate
value that need them, of course).

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1384905 13f79535-47bb-0310-9956-ffa450edef68
2012-09-14 20:16:05 +00:00
Sebastien Brisard 1c032ee454 - Populated throws clause of FieldVector, ArrayFieldVector, SparseFieldVector (MATH-854).
- Added some missing precondition checks.
  - Corrected some mistakes in javadoc.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1384654 13f79535-47bb-0310-9956-ffa450edef68
2012-09-14 06:42:06 +00:00
Sebastien Brisard aa0b1cc788 MATH-854: in FieldVector and ArrayFieldVector, reverted to r1383770.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1384471 13f79535-47bb-0310-9956-ffa450edef68
2012-09-13 19:00:51 +00:00
Thomas Neidhart 406a6ae49d Fixed typo and formatting in changes.xml.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1384454 13f79535-47bb-0310-9956-ffa450edef68
2012-09-13 18:21:05 +00:00
Thomas Neidhart 70b769ec7f Fixed typo in changes.xml.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1384451 13f79535-47bb-0310-9956-ffa450edef68
2012-09-13 18:18:36 +00:00
Luc Maisonobe 621bbb8fc7 Fixed an error in rectangular Cholesky decomposition.
JIRA: MATH-789

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1384363 13f79535-47bb-0310-9956-ffa450edef68
2012-09-13 15:13:03 +00:00
Sebastien Brisard 8469bc496c MATH-854: document all exceptions in ArrayFieldVector.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1384212 13f79535-47bb-0310-9956-ffa450edef68
2012-09-13 06:11:05 +00:00
Sebastien Brisard 10af7e2b2f MATH-854: in interface FieldVector, some more exceptions are *documented* (as recommendations), but not *specified*.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1384211 13f79535-47bb-0310-9956-ffa450edef68
2012-09-13 06:10:06 +00:00
Sebastien Brisard 443f412728 MATH-854: in interface FieldVector, replaced throws statements with javadoc comments.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1384082 13f79535-47bb-0310-9956-ffa450edef68
2012-09-12 18:37:46 +00:00
Luc Maisonobe 84f92e1928 Added a wrapper class to compute Jacobian from differentiable function.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1383886 13f79535-47bb-0310-9956-ffa450edef68
2012-09-12 11:23:23 +00:00
Luc Maisonobe 88678b58a4 Added a wrapper class to compute gradient from differentiable function.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1383885 13f79535-47bb-0310-9956-ffa450edef68
2012-09-12 11:22:56 +00:00
Luc Maisonobe 6fe3ae0e6c Deprecated DifferentiableUnivariateMatrixFunction interface.
This interface is in fact never used in the library...

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1383854 13f79535-47bb-0310-9956-ffa450edef68
2012-09-12 08:55:32 +00:00
Luc Maisonobe d2f23bba39 Fixed typo in interface name.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1383853 13f79535-47bb-0310-9956-ffa450edef68
2012-09-12 08:55:13 +00:00
Luc Maisonobe b8de2704ac Deprecated DifferentiableUnivariateVectorFunction.
This interface is in fact never used in the library...

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1383852 13f79535-47bb-0310-9956-ffa450edef68
2012-09-12 08:54:40 +00:00
Luc Maisonobe 85bab3ba61 Deprecated DifferentiableUnivariateFunction.
The interface and its implementations should be removed for 4.0. The
remaining uses in the library are only there for compatibility.
Everything else now use the new UnivariateDifferentiableFunction
interface and DerivativeStructure, which allow both arbitrary
differentiation order and arbitrary number of free parameters.

The next step for 3.1 is to replace the multidimensional functions (i.e.
multivariate functions, vector valued functions and matrix valued
functions).

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1383845 13f79535-47bb-0310-9956-ffa450edef68
2012-09-12 08:34:10 +00:00
Sebastien Brisard 47e5bb380e Removed LocalizedFormats.ENTRY previously introduced in r1383747, as LocalizedFormats.INDEX will do nicely.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1383770 13f79535-47bb-0310-9956-ffa450edef68
2012-09-12 04:43:38 +00:00
Sebastien Brisard f0921e844d MATH-854: fill the "throws" clause of FieldVector, ArrayFieldVector.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1383760 13f79535-47bb-0310-9956-ffa450edef68
2012-09-12 04:27:47 +00:00