Commit Graph

3032 Commits

Author SHA1 Message Date
Gilles Sadowski 334c01e6eb MATH-631
Work around infinite loop.


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1154614 13f79535-47bb-0310-9956-ffa450edef68
2011-08-06 22:26:55 +00:00
Gilles Sadowski d451a1fb92 MATH-621
Change history:
 Constants in procedures replaced by static final fields.
 NF eliminated (function evaluation counting is done in base class).
 MAXFUN eliminated (exception is thrown by base class).
 -1e300 replaced by NEGATIVE_INFINITY.
 1e300 replaced by POSITIVE_INFINITY.
 Number of interpolation points set at construction (no automatic default to "2n+1" if set to "-1").
 Replaced "checkParameters()" with "setup()" and moved validity checks from "doOptimize()" to "setup()".
 Replaced "boundaries[][]" with two "double[]" for the constraints.
 Removed unit test "testBoundariesNoData" ("null" is interpreted as "no constraints").
 Replaced "xl" and "xu" with "lowerBound" and "upperBound", respectively (Fortran 1-based indexing still used).
 Replaced "x" with "currentBest".
 Replaced "rhobeg" with "initialTrustRegionRadius". Using instance field directly instead of passing it as function argument.
 Replaced "rhoend" with "stoppingTrustRegionRadius". Using instance field directly instead of passing it as function argument.
 Removed all parameters from "bobyqa" function (using instance fields directly).
 Removed (from "bobyqa" function) a test on the bound difference: It would never fail because of the auto-correction in "setup".
 Replaced "ScopedPtr" by "FortranArray" for all one-dimensional data.
 0-based loop in "bobyqa".
 Replaced "ScopedPtr" by "FortranMatrix" for all matrix data.
 Loop-local counters in all functions.
 Replaced kopt with "trustRegionCenterInterpolationPointIndex" instance variable.
 Removed "ndim", "n" and "npt" from the arguments list of all functions.
 Removed "w" from the arguments list of "update".
 Removed "w" from the arguments list of "altmov" (replaced with local variables "work1" and "work2").
 In "trsbox" arguments list, replaced "ScopedPtr" ("gnew", "xbdi", "s", "hs", "hred") by "FortranArray".
 Removed "ptsaux", "ptsid" from arguments list of "rescue" (replaced with local variables).
 Corrected bug in "rescue" function.
 Removed "w" from arguments list of "rescue".
 Removed "glag" and "hcol" from arguments list of "altmov" (replaced by local variables).
 Removed "w" from arguments list of "bobyqb" (replaced by local variables).
 Removed global work space "w".
 Removed auxiliary class "ScopedPtr".
 Removed "alpha" and "cauchy" ("DoubleRef") in "altmov" arguments list: Values returned in a "double[]" array.
 Removed "dsq" and "crvmin" ("DoubleRef") in "trsbox" arguments list: Values returned in a "double[]" array.
 Removed "DoubleRef" auxiliary class.
 Removed unused local variables; changed some to be "final".

This is still an intermediate version. Please do not commit any changes
without discussing it on JIRA.


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1154550 13f79535-47bb-0310-9956-ffa450edef68
2011-08-06 17:06:38 +00:00
Gilles Sadowski a821e798c3 MATH-621
Original contribution due to Dietmar Wolz: Fortran code translated in Java.
This commit is for reference only; work is under way to adapt the code into
a more maintainable version.


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1154543 13f79535-47bb-0310-9956-ffa450edef68
2011-08-06 16:54:39 +00:00
Gilles Sadowski a9c5cda5bd More efficient implementation: Removed unnecessary arrays.
Added another test.


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1154485 13f79535-47bb-0310-9956-ffa450edef68
2011-08-06 11:02:01 +00:00
Gilles Sadowski 367fe7662e Array version of "linearCombination".
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1154416 13f79535-47bb-0310-9956-ffa450edef68
2011-08-06 00:13:49 +00:00
Gilles Sadowski cae2a845fa MATH-632
Added explicit note on the different behaviors for NaN values between
Java and IEEE-754.


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1154392 13f79535-47bb-0310-9956-ffa450edef68
2011-08-05 22:07:31 +00:00
Gilles Sadowski 33c0778d90 MATH-581
New exception. Simplified others.


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1154361 13f79535-47bb-0310-9956-ffa450edef68
2011-08-05 19:43:04 +00:00
Luc Maisonobe 9c6557732b fixed typos, it's IEEE754, not IEEE753 ...
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1154356 13f79535-47bb-0310-9956-ffa450edef68
2011-08-05 19:12:37 +00:00
Luc Maisonobe 8b41800046 Fixed a wrong detection of rotation axis versus vectors plane in Rotation constructor using two vectors pairs.
JIRA: MATH-639

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1154257 13f79535-47bb-0310-9956-ffa450edef68
2011-08-05 15:05:33 +00:00
Luc Maisonobe 3defe7345d Use the new highly accurate linearCombination utility methods in 3D Euclidean geometry.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1154253 13f79535-47bb-0310-9956-ffa450edef68
2011-08-05 15:02:56 +00:00
Luc Maisonobe 079e67738b Added a few linearCombination utility methods in MathUtils to compute accurately
linear combinations a1.b1 + a2.b2 + ... + an.bn taking great care to compensate
for cancellation effects. This both improves and simplify several methods in
euclidean geometry classes, including linear constructors, dot product and cross
product.


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1154250 13f79535-47bb-0310-9956-ffa450edef68
2011-08-05 15:01:49 +00:00
Gilles Sadowski cb067c2503 MATH-581
Method rename (previous one was misleading).


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1153821 13f79535-47bb-0310-9956-ffa450edef68
2011-08-04 10:03:51 +00:00
Phil Steitz 98556fedcc Fixed bugs in AbstractRandomGenerator nextInt() and nextLong() default
implementations.  Prior to the fix for this issue, these methods
generated only positive values.

JIRA: MATH-640

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1153338 13f79535-47bb-0310-9956-ffa450edef68
2011-08-03 04:16:23 +00:00
Phil Steitz b42223e931 Made it clear that PerfTestUtils is in src/test (so when reading release notes, users will not expect to find it in main.)
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1153337 13f79535-47bb-0310-9956-ffa450edef68
2011-08-03 04:03:32 +00:00
Phil Steitz b468defc67 Refactored RandomGenerator tests.
* Added RandomGeneratorAbstractTest collecting stock tests for RandomGenerator
  implementations and running RandomDataTest test cases using RandomDataImpls
  constructed from generators under test.
* Added BitsStreamGeneratorTest extending RandomGeneratorAbstractTest to test
  abstract method implementations in BitStreamGenerator.
* Changed Mersenne and Well generator tests to extend RandomGeneratorAbstractTest.
* Improved test coverage (discovering MATH-640) of AbstractRandomGeneratorTest
  by making this class extend RandomGeneratorAbstractTest.
All new tests use fixed seeds.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1153257 13f79535-47bb-0310-9956-ffa450edef68
2011-08-02 19:48:18 +00:00
Phil Steitz d2d9d32f79 Use fixed seeds in random data generation tests.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1152663 13f79535-47bb-0310-9956-ffa450edef68
2011-07-31 23:47:45 +00:00
Phil Steitz 32bbe0ed8e Made RandomGenerator configurable and reseedable. JIRA: MATH-634.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1152662 13f79535-47bb-0310-9956-ffa450edef68
2011-07-31 23:31:34 +00:00
Phil Steitz 7b4c168854 Made ConstantGenerator public and constant value configurable.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1152659 13f79535-47bb-0310-9956-ffa450edef68
2011-07-31 22:51:35 +00:00
Phil Steitz 1bc6cbd731 Clarified null contract.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1152658 13f79535-47bb-0310-9956-ffa450edef68
2011-07-31 22:49:58 +00:00
Gilles Sadowski a7c7172b3f MATH-599
Renamed "AllowedSolutions" to "AllowedSolution".


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1152644 13f79535-47bb-0310-9956-ffa450edef68
2011-07-31 21:27:39 +00:00
Phil Steitz 20b4584303 Corrected observed/expected value label error.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1152585 13f79535-47bb-0310-9956-ffa450edef68
2011-07-31 15:57:20 +00:00
Gilles Sadowski 06ddf2d772 MATH-637
Replaced "DescriptiveStatistics" by "StatisticalSummary", as suggested
by Phil.
Added some "randomness" so that the timed code has a side-effect that
cannot be optimized away by the JIT compiler.


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1152584 13f79535-47bb-0310-9956-ffa450edef68
2011-07-31 14:04:41 +00:00
Gilles Sadowski 48e54b0a55 MATH-637
Several modifications to avoid some potential pitfalls of micro-benchmarking:
Attempt to run GC preemptively, keep track of the computation result, output
variance of the run times.


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1152524 13f79535-47bb-0310-9956-ffa450edef68
2011-07-30 21:59:57 +00:00
Gilles Sadowski 89bf9e4d9a MATH-638
Fixed Findbugs and CheckStyle warnings.


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1152462 13f79535-47bb-0310-9956-ffa450edef68
2011-07-30 13:50:51 +00:00
Gilles Sadowski efbad3aa60 Junit4 package.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1152408 13f79535-47bb-0310-9956-ffa450edef68
2011-07-30 00:38:30 +00:00
Gilles Sadowski 9879b8baa8 MATH-637
Simple benchmarking utility.


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1152380 13f79535-47bb-0310-9956-ffa450edef68
2011-07-29 21:46:28 +00:00
Phil Steitz a3053da744 Moved PRNG seeding so it actually determines fixed seed for the test.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1152366 13f79535-47bb-0310-9956-ffa450edef68
2011-07-29 20:28:12 +00:00
Luc Maisonobe 9679d37e09 Use the new nth order bracketing Brent solver by default if user didn't specify a root solver for ODE events detection.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1152283 13f79535-47bb-0310-9956-ffa450edef68
2011-07-29 15:50:39 +00:00
Luc Maisonobe fe650d7b39 fixed javadoc warnings
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1152281 13f79535-47bb-0310-9956-ffa450edef68
2011-07-29 15:49:16 +00:00
Luc Maisonobe 6a329f9e43 Added a solver for Dfp-based (i.e. high accuracy) functions.
JIRA: MATH-636

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1152280 13f79535-47bb-0310-9956-ffa450edef68
2011-07-29 15:47:36 +00:00
Luc Maisonobe c68662e257 Added a Brent-like solver that has higher (user specified) order and does
bracket selection on the result: BracketingNthOrderBrentSolver.

JIRA: MATH-635

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1152276 13f79535-47bb-0310-9956-ffa450edef68
2011-07-29 15:44:21 +00:00
Luc Maisonobe 21d9fa79fb document some exceptions that may be thrown by derived classes
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1152268 13f79535-47bb-0310-9956-ffa450edef68
2011-07-29 15:35:19 +00:00
Luc Maisonobe b5d183025d Added a few shortcut methods and predicates to Dfp
(abs, isZero, negativeOrNull, strictlyNegative, positiveOrNull, strictlyPositive).


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1152266 13f79535-47bb-0310-9956-ffa450edef68
2011-07-29 15:34:10 +00:00
Gilles Sadowski f0e28eb000 MATH-633
"AbstractRealMatrix" inherits from "RealLinearOperator".
Added "@Override" annotations.


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1151806 13f79535-47bb-0310-9956-ffa450edef68
2011-07-28 11:59:23 +00:00
Gilles Sadowski 4f7b6d2d75 MATH-613
Linear combination of vectors.


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1151665 13f79535-47bb-0310-9956-ffa450edef68
2011-07-27 23:26:45 +00:00
Henri Yandell 86835c1471 Adding PMD plugin, hope that's okay
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1151332 13f79535-47bb-0310-9956-ffa450edef68
2011-07-27 05:07:40 +00:00
Henri Yandell 78abc7984d Removing unused import
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1151329 13f79535-47bb-0310-9956-ffa450edef68
2011-07-27 04:11:39 +00:00
Henri Yandell bea7d3b97b Removing trailing whitespace
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1151328 13f79535-47bb-0310-9956-ffa450edef68
2011-07-27 04:11:21 +00:00
Gilles Sadowski 0770b1f1a9 MATH-623
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1151062 13f79535-47bb-0310-9956-ffa450edef68
2011-07-26 11:00:32 +00:00
Luc Maisonobe 57ae67e836 typos
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1151012 13f79535-47bb-0310-9956-ffa450edef68
2011-07-26 07:48:05 +00:00
Phil Steitz ca82f7a1a0 Removed unused imports.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1150929 13f79535-47bb-0310-9956-ffa450edef68
2011-07-25 21:48:04 +00:00
Phil Steitz 54b0cce8fe Added ModelSpecificationException and changed UpdatingRegression impls to use it. JIRA: MATH-607.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1150923 13f79535-47bb-0310-9956-ffa450edef68
2011-07-25 21:34:04 +00:00
Gilles Sadowski d4283bbd1d MATH-632
Added tests referred to in the corresponding JIRA ticket.


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1150496 13f79535-47bb-0310-9956-ffa450edef68
2011-07-24 21:43:08 +00:00
Gilles Sadowski af33f7c7ef MATH-577
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1150495 13f79535-47bb-0310-9956-ffa450edef68
2011-07-24 21:39:36 +00:00
Phil Steitz 9099fa31a1 Javadoc, removed commented out code.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1150462 13f79535-47bb-0310-9956-ffa450edef68
2011-07-24 18:46:20 +00:00
Phil Steitz 431ff783f0 Made scalar division consistent with complex division wrt infinite arguments, improved tests.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1150433 13f79535-47bb-0310-9956-ffa450edef68
2011-07-24 16:45:06 +00:00
Phil Steitz 093aa6786f Javadoc.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1150430 13f79535-47bb-0310-9956-ffa450edef68
2011-07-24 16:35:36 +00:00
Sebastian Bazley d2adf76e61 Unnecessary casts
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1150381 13f79535-47bb-0310-9956-ffa450edef68
2011-07-24 14:31:52 +00:00
Sebastian Bazley 69b7b985da Nested inline tags are not allowed
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1150380 13f79535-47bb-0310-9956-ffa450edef68
2011-07-24 14:28:50 +00:00
Sebastian Bazley a95b0def8c Nested inline tags are not allowed
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1150379 13f79535-47bb-0310-9956-ffa450edef68
2011-07-24 14:27:20 +00:00