Commit Graph

4100 Commits

Author SHA1 Message Date
Sebastien Brisard 6eb4655543 MATH-812: fixed a bug in RealVector.dotProduct(RealVector). Now loops through *all* entries of the vectors.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1360662 13f79535-47bb-0310-9956-ffa450edef68
2012-07-12 13:17:08 +00:00
Gilles Sadowski 5cdd5e950c Typo in userguide.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1358535 13f79535-47bb-0310-9956-ffa450edef68
2012-07-07 10:26:33 +00:00
Sebastien Brisard 42596833d5 MATH-795: made some error messages more explicit.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1358502 13f79535-47bb-0310-9956-ffa450edef68
2012-07-07 05:17:44 +00:00
Sebastien Brisard e36f4a730d MATH-795: final clean-up of ArrayRealVectorTest.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1358366 13f79535-47bb-0310-9956-ffa450edef68
2012-07-06 19:31:00 +00:00
Sebastien Brisard c846a2953f In RealVectorAbstractTest.RealVectorTestImpl, removed
- RealVector mapToSelf(UnivariateFunction),
  - double[] toArray(),
which override default implementations.


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1358359 13f79535-47bb-0310-9956-ffa450edef68
2012-07-06 19:12:52 +00:00
Sebastien Brisard f838857569 MATH-795: in RealVectorAbstractTest, removed unused class variables.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1358355 13f79535-47bb-0310-9956-ffa450edef68
2012-07-06 19:07:07 +00:00
Sebastien Brisard 3621d9d559 MATH-795: in RealVectorAbstractTest, removed unused method assertClose.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1358353 13f79535-47bb-0310-9956-ffa450edef68
2012-07-06 19:05:58 +00:00
Sebastien Brisard 8c10a80525 MATH-795: in RealVectorTest, removed unecessary re-implementation of testAddToEntry.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1358349 13f79535-47bb-0310-9956-ffa450edef68
2012-07-06 19:02:16 +00:00
Sebastien Brisard 58c9ef25ef MATH-795: in RealVectorTest, removed
- testCombineToSelfPrecondition()
  - testCombineToSelf()
which are redundant with other tests already implemented in RealVectorAbstractTest.


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1358346 13f79535-47bb-0310-9956-ffa450edef68
2012-07-06 18:59:12 +00:00
Sebastien Brisard 2094b5cb5f In RealVectorTest, removed testClone(), which does not test anything.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1358344 13f79535-47bb-0310-9956-ffa450edef68
2012-07-06 18:55:49 +00:00
Sebastien Brisard e24e3100ed MATH-795: in RealVectorTest, cleaned-up testSparseIterator().
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1358343 13f79535-47bb-0310-9956-ffa450edef68
2012-07-06 18:54:29 +00:00
Sebastien Brisard 1ebfcaaffa MATH-795: default implementation of RealVector RealVectorAbstractTest.createAlien(double[]).
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1358339 13f79535-47bb-0310-9956-ffa450edef68
2012-07-06 18:32:03 +00:00
Sebastien Brisard cae661e3ce MATH-795: SparseRealVectorTest now uses RealVectorAbstractTest.RealVectorTestImpl instead of SparseRealVectorTest.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1358338 13f79535-47bb-0310-9956-ffa450edef68
2012-07-06 18:29:11 +00:00
Sebastien Brisard 53fb7e8704 MATH-795: moved minimal implementation of RealVector, ArrayRealVectorTest.RealVectorTestImpl to RealVectorAbstractTest.RealVectorTestImpl.
This minimal implementation is now used by RealVectorTest and ArrayRealVectorTest.


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1358334 13f79535-47bb-0310-9956-ffa450edef68
2012-07-06 18:24:50 +00:00
Sebastien Brisard 092c0972ba MATH-795: in ArrayRealVectorTest, cleaned up the minimal implementation of RealVector, RealVectorTestImpl. This minimal implementation used to be cluttered with unnecessary method implementations, which should have been removed when the interface RealVector was changed into an abstract class.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1358319 13f79535-47bb-0310-9956-ffa450edef68
2012-07-06 17:59:42 +00:00
Sebastien Brisard 12dfb2e92d MATH-795: cleanup of RealVectorAbstractTest.
Removed unused class variables and imports.


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1358049 13f79535-47bb-0310-9956-ffa450edef68
2012-07-06 06:23:03 +00:00
Sebastien Brisard e89009749f MATH-795:
- Corrected some build failures caused by changes in r1358046.
  - Moved javadoc of boolean ArrayRealVector.equals(Object) to RealVector.
  - In RealVector, default implementations of equals(Object) and hashCode() throw UnsupportedOperationException, in order to force implementation in subclasses.


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1358048 13f79535-47bb-0310-9956-ffa450edef68
2012-07-06 05:47:02 +00:00
Sebastien Brisard 8762808a04 MATH-795: removed redundant unit tests.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1358046 13f79535-47bb-0310-9956-ffa450edef68
2012-07-06 05:26:35 +00:00
Sebastien Brisard ea6d2beeaf MATH-795:
- Added default implementation to RealVector RealVector.projection(RealVector)
  - Removed implementation in concrete classes (to avoid code duplication).
  - Created unit tests accordingly.
 


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1358044 13f79535-47bb-0310-9956-ffa450edef68
2012-07-06 05:18:39 +00:00
Sebastien Brisard c7196c8f20 MATH-795: refactored unit tests for double RealVector.cosine(RealVector).
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1358033 13f79535-47bb-0310-9956-ffa450edef68
2012-07-06 03:48:04 +00:00
Gilles Sadowski d182f07d6a MATH-798
Added overridden "fit" method where one can specify the maximum number of
function evaluations.


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1357353 13f79535-47bb-0310-9956-ffa450edef68
2012-07-04 18:00:02 +00:00
Gilles Sadowski f2187efaf0 MATH-810
Added new accessors.


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1357004 13f79535-47bb-0310-9956-ffa450edef68
2012-07-03 23:03:55 +00:00
Sebastien Brisard 075a88a074 MATH-795: in RealVectorAbstractTest, factored out unit tests for
double dotProduct(RealVector)

As first reported by Bill Barker, these tests fail with the current default implementation (in RealVector) as well as the sparse implementation (in OpenMapRealVector).


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1356576 13f79535-47bb-0310-9956-ffa450edef68
2012-07-03 05:51:57 +00:00
Sebastien Brisard 8071ded100 MATH-795: in RealVectorAbstractTest, refactored unit tests of
- RealVector RealVector.combine(double, double, RealVector),
  - RealVector RealVector.combineToSelf(double, double, RealVector).


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1356070 13f79535-47bb-0310-9956-ffa450edef68
2012-07-02 05:46:10 +00:00
Sebastien Brisard 5e5cb5ec2f MATH-795:
In org.apache.commons.math3.linear.RealVectorAbstractTest
  - factored out unit tests of RealVector RealVector.set(double),
  - created unit tests of double[] RealVector.toArray(),
  - factored out unit tests of RealVector RealVector.unitVector(),
  - factored out unit tests of void RealVector.unitize(),
  - created unit tests of Iterator<RealVector.Entry> RealVector.iterator().

In org.apache.commons.math3.linear.ArrayRealVector, removed unnecessary overrides of unitVector() and unitize().

In org.apache.commons.math3.linear.RealVector
  - unitVector() and unitize() now throw an ArithmeticException when the norm is 0 (as specified in the Javadoc),
  - the returned iterator() returns NoSuchElementException as specified in the general contract of iterators.



git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1354822 13f79535-47bb-0310-9956-ffa450edef68
2012-06-28 06:09:51 +00:00
Sebastien Brisard 590934526e MATH-795: factored out unit test of
RealMatrix RealVector.outerProduct(RealVector)
This test fails with the default implementation provided by the abstract class RealMatrix.


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1354330 13f79535-47bb-0310-9956-ffa450edef68
2012-06-27 05:53:09 +00:00
Sebastien Brisard fd40f7a4f6 MATH-795: in RealVectorAbstractTest, created an array of specific entry values to be tested. Generalized its use in some unit tests.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1354329 13f79535-47bb-0310-9956-ffa450edef68
2012-06-27 05:37:55 +00:00
Sebastien Brisard 6b4e87c928 MATH-795: factored out unit tests for RealVector.map(UnivariateFunction) and RealVector.mapToSelf(UnivariateFunction).
This test fails with OpenMapRealVector. This is a known issue (sign of zero is lost in this class).

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1353825 13f79535-47bb-0310-9956-ffa450edef68
2012-06-26 06:09:27 +00:00
Sebastien Brisard 83461fe890 MATH-795: factored out unit tests for RealVector.mapAdd(double), RealVector.mapSubtract(double), RealVector.mapDivide(double), RealVector.mapSubtract(double).
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1353824 13f79535-47bb-0310-9956-ffa450edef68
2012-06-26 05:45:13 +00:00
Sebastien Brisard 8ee2bbd33f In the constructor of IterationManager, removed the check for null argument (already carried out in the constructor of Incrementor).
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1353586 13f79535-47bb-0310-9956-ffa450edef68
2012-06-25 15:00:11 +00:00
Sebastien Brisard a4e4583de2 Replaced NullPointerException with NullArgumentException.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1353451 13f79535-47bb-0310-9956-ffa450edef68
2012-06-25 10:44:38 +00:00
Sebastien Brisard 3e8cbfa5c9 MATH-795: factored out test of getL1Norm, getL1Distance, getLInfNorm, getLInfDistance.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1353388 13f79535-47bb-0310-9956-ffa450edef68
2012-06-25 05:57:14 +00:00
Sebastien Brisard c1e51be5a8 MATH-795: factored out unit tests of getDistance and getNorm.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1353387 13f79535-47bb-0310-9956-ffa450edef68
2012-06-25 05:42:09 +00:00
Sebastien Brisard 692c542c5e Reverted changes committed in r1353140. In o.a.c.m3.util.Incrementor, a NullPointerException is now thrown if the call-back function specified at construction is null. o.a.c.m3.util.IterationManager was updated accordingly (used to explicitely use the constructor with null argument).
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1353386 13f79535-47bb-0310-9956-ffa450edef68
2012-06-25 05:22:58 +00:00
Sebastien Brisard 2881c10609 MATH-807: in o.a.c.m3.util.IterationManager, created a new constructor which allows for the specification of a o.a.c.m3.util.Incrementor.MaxCountExceededCallback, to be called when the maximum number of iterations is reached.
Updated the javadoc of iterative linear solvers accordingly.


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1353141 13f79535-47bb-0310-9956-ffa450edef68
2012-06-23 15:12:34 +00:00
Sebastien Brisard 1977d4d968 In o.a.c.m3.Incrementor, modified constructor to allow for null values of the MaxCountExceededCallback. Null value was previously not checked wich could lead to a NullPointerException much later (at exhaustion of the counter).
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1353140 13f79535-47bb-0310-9956-ffa450edef68
2012-06-23 15:09:14 +00:00
Sebastien Brisard b30f3d5556 MATH-803 : deprecated RealVector.ebeMultiply() and RealVector.ebeDivide(), and
updated unit tests accordingly.


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1352782 13f79535-47bb-0310-9956-ffa450edef68
2012-06-22 07:06:28 +00:00
Luc Maisonobe 52eb62e4dd Fixed checkstyle warnings.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1351265 13f79535-47bb-0310-9956-ffa450edef68
2012-06-18 10:13:40 +00:00
Luc Maisonobe e8a6708cfd Added Hermite interpolator.
This class implements the Hermite polynomial interpolation method, which
can match function derivatives in addition to function value at sampling
points. The implementation is done for vector-valued functions.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1351257 13f79535-47bb-0310-9956-ffa450edef68
2012-06-18 10:01:12 +00:00
Thomas Neidhart 5f00c9b777 [MATH-777] added missing license header and test chromosome.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1350755 13f79535-47bb-0310-9956-ffa450edef68
2012-06-15 19:49:16 +00:00
Thomas Neidhart bf181a9152 [MATH-777] Added UniformCrossover policy. Thanks for Reid Hochstedler.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1350391 13f79535-47bb-0310-9956-ffa450edef68
2012-06-14 20:37:29 +00:00
Gilles Sadowski 31217dfcb2 Unit test.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1349707 13f79535-47bb-0310-9956-ffa450edef68
2012-06-13 09:30:56 +00:00
Mikkel Meyer Andersen 07d05a070c MATH-790: Patch applied to fix the second overflow issue.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1349372 13f79535-47bb-0310-9956-ffa450edef68
2012-06-12 14:27:56 +00:00
Sebastien Brisard 069590396c MATH-803:
- modified OpenMapRealVector.ebeMultiply() and ebeDivide() to handle
special cases  0d * NaN, 0d * Infinity, 0d / 0d and 0d / NaN.
  - added implementation of isNaN() and isInfinite() to
SparseRealVectorTest.SparseRealVectorTestImpl in order to allow for testing
of OpenMapRealVector.ebeMultiply() and ebeDivide() with mixed types.


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1348721 13f79535-47bb-0310-9956-ffa450edef68
2012-06-11 05:52:16 +00:00
Gilles Sadowski 6ffc68337f MATH-804
Parameterized "CurveFitter" with the type of the fitting function. Updated subclasses
"PolynomialFitter", "HarmonicFitter", "GaussianFitter" accordingly.


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1348613 13f79535-47bb-0310-9956-ffa450edef68
2012-06-10 15:12:57 +00:00
Sebastien Brisard a9889607c1 MATH-795
- In RealVectorTest.TestVectorImpl, removed add(RealVector) and
subtract(RealVector), as they prevented testing of default implementations
(provided in the RealVector abstract class).
  - In RealVectorAbstractTest, extracted unit tests for
    + RealVector.add(RealVector),
    + RealVector.subtract(RealVector),
    + RealVector.ebeMultiply(RealVector),
    + RealVector.ebeDivide(RealVector).

These tests fail with OpenMapRealVector. This is identified as a bug (see
MATH-803).


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1348485 13f79535-47bb-0310-9956-ffa450edef68
2012-06-09 18:59:44 +00:00
Sebastien Brisard e790293f6e MATH-795: in RealVector.add(RealVector) and RealVector.subtract(RealVector)
(default implementation), exceptional cases were not handled properly.


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1348438 13f79535-47bb-0310-9956-ffa450edef68
2012-06-09 16:00:05 +00:00
Sebastien Brisard ddd5f1a5e9 MATH-802.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1348396 13f79535-47bb-0310-9956-ffa450edef68
2012-06-09 13:11:38 +00:00
Sebastien Brisard 534c5fe89f MATH-795: in RealVectorAbstractTest, extracted testIsInfinite() from
testPredicates().


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1348228 13f79535-47bb-0310-9956-ffa450edef68
2012-06-08 20:18:10 +00:00
Sebastien Brisard ae57c3dbba MATH-795: in RealVectorAbstractTest, extracted testIsNaN() from
testPredicates().


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1348225 13f79535-47bb-0310-9956-ffa450edef68
2012-06-08 20:10:49 +00:00