Commit Graph

4321 Commits

Author SHA1 Message Date
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
Sebastien Brisard a1469c73be MATH-795: in RealVectorAbstractTest, added unit tests for
RealVector.setSubVector(int, RealVector).


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1348211 13f79535-47bb-0310-9956-ffa450edef68
2012-06-08 19:56:42 +00:00
Mikkel Meyer Andersen 33169dcf75 MATH-790: Patch applied to fix the overflow issue.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1348024 13f79535-47bb-0310-9956-ffa450edef68
2012-06-08 11:04:11 +00:00
Mikkel Meyer Andersen a40ad8af53 MATH-774: Fixed documentation to described the actual sampling algorithms used
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1348020 13f79535-47bb-0310-9956-ffa450edef68
2012-06-08 10:47:59 +00:00
Mikkel Meyer Andersen e157ce5541 MATH-774: Gamma Distribution override inversion sampling with nextGamma-implementation from oacm.random
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1348015 13f79535-47bb-0310-9956-ffa450edef68
2012-06-08 10:41:49 +00:00
Sebastien Brisard 290224dce3 MATH-795: extracted
- testSubVectorInvalidIndex1(),
  - testSubVectorInvalidIndex2(),
  - testSubVectorInvalidIndex3(),
  - testSubVectorInvalidIndex4()
from RealVectorAbstractTest.testDataInOut(). This test revealed that
positivity of the number of elements was not checked for in
RealVector.getSubVector(int, int).

This is corrected, and a NotPositiveException is now thrown (corresponding
error message has been added to LocalizedFormats).


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1347883 13f79535-47bb-0310-9956-ffa450edef68
2012-06-08 05:50:11 +00:00
Sebastien Brisard 1d0adbdc72 MATH-795: extracted testGetSubVector() from
RealVectorAbstractTest.testDataInOut().


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1347877 13f79535-47bb-0310-9956-ffa450edef68
2012-06-08 03:24:01 +00:00
Sebastien Brisard 32a9299389 MATH-795: RealVectorTest.testAddToEntryInvalidIndex1() and
RealVectorTest.testAddToEntryInvalidIndex2() revealed a bug in
ArrayRealVector.addToEntry(int, double) (method used to throw wrong type of
exception).


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1347717 13f79535-47bb-0310-9956-ffa450edef68
2012-06-07 17:10:48 +00:00
Sebastien Brisard fcfe0a0644 MATH-795: splitted tests for
- RealVector.setEntry(int, double),
  - RealVector.addToEntry(int, double).


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1347401 13f79535-47bb-0310-9956-ffa450edef68
2012-06-07 05:45:44 +00:00
Sebastien Brisard 00bc945db4 MATH-795:
- added in RealVectorAbstractTest tests for RealVector.getEntry()
preconditions,
  - modified exceptions thrown in RealVectorTest.TestVectorImpl accordingly.


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1347395 13f79535-47bb-0310-9956-ffa450edef68
2012-06-07 05:22:52 +00:00
Sebastien Brisard 3a7911512f In TestUtils, improved handling of error messages for
- assertEquals(String, double[], RealVector, double),
  - assertEquals(String, RealVector, RealVector, double).


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1347393 13f79535-47bb-0310-9956-ffa450edef68
2012-06-07 05:12:46 +00:00
Sebastien Brisard ca70b29dd7 Utility method for testing for equality of expected double[] with RealVector.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1347392 13f79535-47bb-0310-9956-ffa450edef68
2012-06-07 05:05:33 +00:00
Gilles Sadowski 3e83661989 MATH-800
Updated userguide and added unit test.


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1347211 13f79535-47bb-0310-9956-ffa450edef68
2012-06-06 23:48:49 +00:00
Gilles Sadowski 6525baf194 MATH-800
Deprecated "PolynomialFitter" and adapted unit test to use "CurveFitter"
directly.


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1347184 13f79535-47bb-0310-9956-ffa450edef68
2012-06-06 22:33:42 +00:00
Sebastien Brisard 60c60e05f8 MATH-795: in RealVectorAbstractTest
- defined class variables data1 and data2 for the creation of test vectors.
Attention has been paid to "special" values, which are interspersed with
"normal" values (see e.g. sparse vectors).
  - created testGetDimension().
  - created testGetEntry().


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1346741 13f79535-47bb-0310-9956-ffa450edef68
2012-06-06 05:41:21 +00:00
Sebastien Brisard a37a9384f1 MATH-795:
- some methods are not implemented by RealVector, so they should not be
tested: added @Ignore annotations in RealVectorTest.
  - in RealVectorAbstractTest, extracted
    + testAppendVector()
    + testAppendScalar()
from testDataInOut().


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1346740 13f79535-47bb-0310-9956-ffa450edef68
2012-06-06 05:21:18 +00:00
Sebastien Brisard 1214de50cd MATH-795: in RealVectorAbstractTest, added method getPreferredEntryValue()
which allows testing vectors with some entries set to a preferred value (e.g. 0
for sparse vectors).


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1346729 13f79535-47bb-0310-9956-ffa450edef68
2012-06-06 03:56:02 +00:00
Sebastien Brisard 8d8ede74b5 MATH-795: removed unused imports.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1346725 13f79535-47bb-0310-9956-ffa450edef68
2012-06-06 03:23:39 +00:00
Sebastien Brisard 3f83d10d68 MATH-795: factored out
- testCombineToSelfPreconditionSameType()
  - testCombineToSelfSameType()
  - testCombineToSelfPreconditionMixeType()
  - testCombineToSelfMixedTypes()


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1346723 13f79535-47bb-0310-9956-ffa450edef68
2012-06-06 03:19:18 +00:00
Sebastien Brisard 5a4f0a8171 MATH-795: factored out
- testCombinePreconditionSameType()
  - testCombineSameType()
  - testCombinePreconditionMixedType()
  - testCombineMixedTypes()


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1346523 13f79535-47bb-0310-9956-ffa450edef68
2012-06-05 18:46:29 +00:00
Luc Maisonobe 118e94b5e9 Fixed a problem when building rotations from two pairs of vectors.
In very rare cases, due to numerical inaccuracies the computed quaternion
was not normalized (some examples went as high as 1.0e8) and even after
normalization, the quaternion was plain wrong.

JIRA: MATH-801

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1346513 13f79535-47bb-0310-9956-ffa450edef68
2012-06-05 18:26:02 +00:00
Sebastien Brisard 09d7f9a7b8 MATH-795: factored out testCosinePrecondition1(), testCosinePrecondition2() and
testCosinePrecondition3().


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1346475 13f79535-47bb-0310-9956-ffa450edef68
2012-06-05 17:11:15 +00:00
Sebastien Brisard 0f9932a5c5 MATH-795: factored out testCosine().
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1346471 13f79535-47bb-0310-9956-ffa450edef68
2012-06-05 17:08:20 +00:00
Sebastien Brisard 1d9b3006bf MATH-795: factored out testMinMax().
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1346467 13f79535-47bb-0310-9956-ffa450edef68
2012-06-05 17:01:57 +00:00
Sebastien Brisard ce5671bfb0 MATH-795: factored out testAddToEntry().
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1346245 13f79535-47bb-0310-9956-ffa450edef68
2012-06-05 05:45:41 +00:00
Sebastien Brisard 6d5b6eb0d1 MATH-795
- Factored out testSerial().
  - In RealVectorTest, the vector returned by create(double[]) should really be
of type RealVectorTest.TestVectorImpl, as the minimal implementation is to be
tested. This causes some tests not to pass, they are skipped for the time
being (overriden from RealVectorAbstractTest, without @Test annotation). When
the tests in RealVectorAbstractTest are split, only the smaller tests which do
not make sense in the present context will be skipped.
  - In RealVectorTest, the constructor of RealVectorTest.TestVectorImpl now
makes a defensive copy of the specified double[] array (see Javadoc of
    + RealVectorAbstractTest.create(double[]),
    + RealVectorAbstractTest.createAlien(double[]).


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1346243 13f79535-47bb-0310-9956-ffa450edef68
2012-06-05 05:37:37 +00:00
Sebastien Brisard a222b6b3ac MATH-795: factoring out testPredicates().
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1346240 13f79535-47bb-0310-9956-ffa450edef68
2012-06-05 05:10:55 +00:00
Sebastien Brisard ca6583feb8 MATH-795: factored out testOuterProduct() and testMisc().
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1345837 13f79535-47bb-0310-9956-ffa450edef68
2012-06-04 05:40:33 +00:00
Gilles Sadowski 8987aa0cfe MATH-799
Deprecated default values for thresholds, and constructors that use
them. Scheduled for removal in CM 4.0.


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1345803 13f79535-47bb-0310-9956-ffa450edef68
2012-06-03 23:24:43 +00:00
Gilles Sadowski 290002cb88 MATH-798
Test case provided by the reporter, adapted to become a unit test, shows
that the same convergence criterion generates a very similar solution by
both "LevenbergMarquardtOptimizer" and "GaussNewtonOptimizer".



git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1345538 13f79535-47bb-0310-9956-ffa450edef68
2012-06-02 17:53:05 +00:00