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
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
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
- 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
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
- 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
- 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
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
- 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
- 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