org.apache.commons.math3.linear
Class RealVectorAbstractTest

java.lang.Object
  extended by org.apache.commons.math3.linear.RealVectorAbstractTest
Direct Known Subclasses:
ArrayRealVectorTest, RealVectorTest, SparseRealVectorTest

public abstract class RealVectorAbstractTest
extends Object


Nested Class Summary
static class RealVectorAbstractTest.RealVectorTestImpl
          Minimal implementation of the RealVector abstract class, for mixed types unit tests.
 
Constructor Summary
RealVectorAbstractTest()
           
 
Method Summary
abstract  RealVector create(double[] data)
          Creates a new instance of RealVector, with specified entries.
 RealVector createAlien(double[] data)
          Creates a new instance of RealVector, with specified entries.
 double getPreferredEntryValue()
          Returns a preferred value of the entries, to be tested specifically.
 void testAddDimensionMismatch()
           
 void testAddMixedTypes()
           
 void testAddSameType()
           
 void testAddToEntry()
           
 void testAddToEntryInvalidIndex1()
           
 void testAddToEntryInvalidIndex2()
           
 void testAppendScalar()
           
 void testAppendVector()
           
 void testCombineDimensionMismatchMixedTypes()
           
 void testCombineDimensionMismatchSameType()
           
 void testCombineMixedTypes()
           
 void testCombineSameType()
           
 void testCombineToSelfDimensionMismatchMixedTypes()
           
 void testCombineToSelfDimensionMismatchSameType()
           
 void testCombineToSelfMixedTypes()
           
 void testCombineToSelfSameType()
           
 void testCopy()
           
 void testCosineDimensionMismatch()
           
 void testCosineLeftNullVector()
           
 void testCosineMixedTypes()
           
 void testCosineRightNullVector()
           
 void testCosineSameType()
           
 void testDotProductDimensionMismatchMixedTypes()
           
 void testDotProductDimensionMismatchSameType()
           
 void testDotProductMixedTypes()
           
 void testDotProductSameType()
           
 void testEbeDivideDimensionMismatch()
           
 void testEbeDivideMixedTypes()
           
 void testEbeDivideSameType()
           
 void testEbeMultiplyDimensionMismatch()
           
 void testEbeMultiplyMixedTypes()
           
 void testEbeMultiplySameType()
           
 void testEquals()
           
 void testGetDimension()
           
 void testGetDistanceDimensionMismatch()
           
 void testGetDistanceMixedTypes()
           
 void testGetDistanceSameType()
           
 void testGetEntry()
           
 void testGetEntryInvalidIndex1()
           
 void testGetEntryInvalidIndex2()
           
 void testGetL1DistanceDimensionMismatch()
           
 void testGetL1DistanceMixedTypes()
           
 void testGetL1DistanceSameType()
           
 void testGetL1Norm()
           
 void testGetLInfDistanceDimensionMismatch()
           
 void testGetLInfDistanceMixedTypes()
           
 void testGetLInfDistanceSameType()
           
 void testGetLInfNorm()
           
 void testGetNorm()
           
 void testGetSubVector()
           
 void testGetSubVectorInvalidIndex1()
           
 void testGetSubVectorInvalidIndex2()
           
 void testGetSubVectorInvalidIndex3()
           
 void testGetSubVectorInvalidIndex4()
           
 void testIsInfinite()
           
 void testIsNaN()
           
 void testIterator()
           
 void testMap()
           
 void testMapAdd()
           
 void testMapAddToSelf()
           
 void testMapDivide()
           
 void testMapDivideToSelf()
           
 void testMapMultiply()
           
 void testMapMultiplyToSelf()
           
 void testMapSubtract()
           
 void testMapSubtractToSelf()
           
 void testMapToSelf()
           
 void testMinMax()
           
 void testOuterProductMixedTypes()
           
 void testOuterProductSameType()
           
 void testProjectionDimensionMismatch()
           
 void testProjectionMixedTypes()
           
 void testProjectionNullVector()
           
 void testProjectionSameType()
           
 void testSerial()
           
 void testSet()
           
 void testSetEntry()
           
 void testSetEntryInvalidIndex1()
           
 void testSetEntryInvalidIndex2()
           
 void testSetSubVectorInvalidIndex1()
           
 void testSetSubVectorInvalidIndex2()
           
 void testSetSubVectorInvalidIndex3()
           
 void testSetSubVectorMixedType()
           
 void testSetSubVectorSameType()
           
 void testSubtractDimensionMismatch()
           
 void testSubtractMixedTypes()
           
 void testSubtractSameType()
           
 void testToArray()
           
 void testUnitize()
           
 void testUnitizeNullVector()
           
 void testUnitVector()
           
 void testUnitVectorNullVector()
           
 void testWalkInDefaultOrderChangingVisitor1()
          The whole vector is visited.
 void testWalkInDefaultOrderChangingVisitor2()
          Visiting an invalid subvector.
 void testWalkInDefaultOrderChangingVisitor3()
          Visiting a valid subvector.
 void testWalkInDefaultOrderPreservingVisitor1()
          The whole vector is visited.
 void testWalkInDefaultOrderPreservingVisitor2()
          Visiting an invalid subvector.
 void testWalkInDefaultOrderPreservingVisitor3()
          Visiting a valid subvector.
 void testWalkInOptimizedOrderChangingVisitor1()
          The whole vector is visited.
 void testWalkInOptimizedOrderChangingVisitor2()
          Visiting an invalid subvector.
 void testWalkInOptimizedOrderChangingVisitor3()
          Visiting a valid subvector.
 void testWalkInOptimizedOrderPreservingVisitor1()
          The whole vector is visited.
 void testWalkInOptimizedOrderPreservingVisitor2()
          Visiting an invalid subvector.
 void testWalkInOptimizedOrderPreservingVisitor3()
          Visiting a valid subvector.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RealVectorAbstractTest

public RealVectorAbstractTest()
Method Detail

create

public abstract RealVector create(double[] data)
Creates a new instance of RealVector, with specified entries. The returned vector must be of the type currently tested. It should be noted that some tests assume that no references to the specified double[] are kept in the returned object: if necessary, defensive copy of this array should be made.

Parameters:
data - the entries of the vector to be created
Returns:
a new RealVector of the type to be tested

createAlien

public RealVector createAlien(double[] data)
Creates a new instance of RealVector, with specified entries. The type of the returned vector must be different from the type currently tested. It should be noted that some tests assume that no references to the specified double[] are kept in the returned object: if necessary, defensive copy of this array should be made.

Parameters:
data - the entries of the vector to be created
Returns:
a new RealVector of an alien type

getPreferredEntryValue

public double getPreferredEntryValue()
Returns a preferred value of the entries, to be tested specifically. Some implementations of RealVector (e.g. OpenMapRealVector) do not store specific values of entries. In order to ensure that all tests take into account this specific value, some entries of the vectors to be tested are deliberately set to the value returned by the present method. The default implementation returns 0.0.

Returns:
a value which should be present in all vectors to be tested

testGetDimension

public void testGetDimension()

testGetEntry

public void testGetEntry()

testGetEntryInvalidIndex1

public void testGetEntryInvalidIndex1()

testGetEntryInvalidIndex2

public void testGetEntryInvalidIndex2()

testSetEntry

public void testSetEntry()

testSetEntryInvalidIndex1

public void testSetEntryInvalidIndex1()

testSetEntryInvalidIndex2

public void testSetEntryInvalidIndex2()

testAddToEntry

public void testAddToEntry()

testAddToEntryInvalidIndex1

public void testAddToEntryInvalidIndex1()

testAddToEntryInvalidIndex2

public void testAddToEntryInvalidIndex2()

testAppendVector

public void testAppendVector()

testAppendScalar

public void testAppendScalar()

testGetSubVector

public void testGetSubVector()

testGetSubVectorInvalidIndex1

public void testGetSubVectorInvalidIndex1()

testGetSubVectorInvalidIndex2

public void testGetSubVectorInvalidIndex2()

testGetSubVectorInvalidIndex3

public void testGetSubVectorInvalidIndex3()

testGetSubVectorInvalidIndex4

public void testGetSubVectorInvalidIndex4()

testSetSubVectorSameType

public void testSetSubVectorSameType()

testSetSubVectorMixedType

public void testSetSubVectorMixedType()

testSetSubVectorInvalidIndex1

public void testSetSubVectorInvalidIndex1()

testSetSubVectorInvalidIndex2

public void testSetSubVectorInvalidIndex2()

testSetSubVectorInvalidIndex3

public void testSetSubVectorInvalidIndex3()

testIsNaN

public void testIsNaN()

testIsInfinite

public void testIsInfinite()

testAddSameType

public void testAddSameType()

testAddMixedTypes

public void testAddMixedTypes()

testAddDimensionMismatch

public void testAddDimensionMismatch()

testSubtractSameType

public void testSubtractSameType()

testSubtractMixedTypes

public void testSubtractMixedTypes()

testSubtractDimensionMismatch

public void testSubtractDimensionMismatch()

testEbeMultiplySameType

public void testEbeMultiplySameType()

testEbeMultiplyMixedTypes

public void testEbeMultiplyMixedTypes()

testEbeMultiplyDimensionMismatch

public void testEbeMultiplyDimensionMismatch()

testEbeDivideSameType

public void testEbeDivideSameType()

testEbeDivideMixedTypes

public void testEbeDivideMixedTypes()

testEbeDivideDimensionMismatch

public void testEbeDivideDimensionMismatch()

testGetDistanceSameType

public void testGetDistanceSameType()

testGetDistanceMixedTypes

public void testGetDistanceMixedTypes()

testGetDistanceDimensionMismatch

public void testGetDistanceDimensionMismatch()

testGetNorm

public void testGetNorm()

testGetL1DistanceSameType

public void testGetL1DistanceSameType()

testGetL1DistanceMixedTypes

public void testGetL1DistanceMixedTypes()

testGetL1DistanceDimensionMismatch

public void testGetL1DistanceDimensionMismatch()

testGetL1Norm

public void testGetL1Norm()

testGetLInfDistanceSameType

public void testGetLInfDistanceSameType()

testGetLInfDistanceMixedTypes

public void testGetLInfDistanceMixedTypes()

testGetLInfDistanceDimensionMismatch

public void testGetLInfDistanceDimensionMismatch()

testGetLInfNorm

public void testGetLInfNorm()

testMapAdd

public void testMapAdd()

testMapAddToSelf

public void testMapAddToSelf()

testMapSubtract

public void testMapSubtract()

testMapSubtractToSelf

public void testMapSubtractToSelf()

testMapMultiply

public void testMapMultiply()

testMapMultiplyToSelf

public void testMapMultiplyToSelf()

testMapDivide

public void testMapDivide()

testMapDivideToSelf

public void testMapDivideToSelf()

testMap

public void testMap()

testMapToSelf

public void testMapToSelf()

testOuterProductSameType

public void testOuterProductSameType()

testOuterProductMixedTypes

public void testOuterProductMixedTypes()

testProjectionSameType

public void testProjectionSameType()

testProjectionMixedTypes

public void testProjectionMixedTypes()

testProjectionNullVector

public void testProjectionNullVector()

testProjectionDimensionMismatch

public void testProjectionDimensionMismatch()

testSet

public void testSet()

testToArray

public void testToArray()

testUnitVector

public void testUnitVector()

testUnitize

public void testUnitize()

testUnitVectorNullVector

public void testUnitVectorNullVector()

testUnitizeNullVector

public void testUnitizeNullVector()

testIterator

public void testIterator()

testCombineSameType

public void testCombineSameType()

testCombineMixedTypes

public void testCombineMixedTypes()

testCombineDimensionMismatchSameType

public void testCombineDimensionMismatchSameType()

testCombineDimensionMismatchMixedTypes

public void testCombineDimensionMismatchMixedTypes()

testCombineToSelfSameType

public void testCombineToSelfSameType()

testCombineToSelfMixedTypes

public void testCombineToSelfMixedTypes()

testCombineToSelfDimensionMismatchSameType

public void testCombineToSelfDimensionMismatchSameType()

testCombineToSelfDimensionMismatchMixedTypes

public void testCombineToSelfDimensionMismatchMixedTypes()

testCopy

public void testCopy()

testDotProductSameType

public void testDotProductSameType()

testDotProductDimensionMismatchSameType

public void testDotProductDimensionMismatchSameType()

testDotProductMixedTypes

public void testDotProductMixedTypes()

testDotProductDimensionMismatchMixedTypes

public void testDotProductDimensionMismatchMixedTypes()

testCosineSameType

public void testCosineSameType()

testCosineMixedTypes

public void testCosineMixedTypes()

testCosineLeftNullVector

public void testCosineLeftNullVector()

testCosineRightNullVector

public void testCosineRightNullVector()

testCosineDimensionMismatch

public void testCosineDimensionMismatch()

testEquals

public void testEquals()

testSerial

public void testSerial()

testMinMax

public void testMinMax()

testWalkInDefaultOrderPreservingVisitor1

public void testWalkInDefaultOrderPreservingVisitor1()
The whole vector is visited.


testWalkInDefaultOrderPreservingVisitor2

public void testWalkInDefaultOrderPreservingVisitor2()
Visiting an invalid subvector.


testWalkInDefaultOrderPreservingVisitor3

public void testWalkInDefaultOrderPreservingVisitor3()
Visiting a valid subvector.


testWalkInOptimizedOrderPreservingVisitor1

public void testWalkInOptimizedOrderPreservingVisitor1()
The whole vector is visited.


testWalkInOptimizedOrderPreservingVisitor2

public void testWalkInOptimizedOrderPreservingVisitor2()
Visiting an invalid subvector.


testWalkInOptimizedOrderPreservingVisitor3

public void testWalkInOptimizedOrderPreservingVisitor3()
Visiting a valid subvector.


testWalkInDefaultOrderChangingVisitor1

public void testWalkInDefaultOrderChangingVisitor1()
The whole vector is visited.


testWalkInDefaultOrderChangingVisitor2

public void testWalkInDefaultOrderChangingVisitor2()
Visiting an invalid subvector.


testWalkInDefaultOrderChangingVisitor3

public void testWalkInDefaultOrderChangingVisitor3()
Visiting a valid subvector.


testWalkInOptimizedOrderChangingVisitor1

public void testWalkInOptimizedOrderChangingVisitor1()
The whole vector is visited.


testWalkInOptimizedOrderChangingVisitor2

public void testWalkInOptimizedOrderChangingVisitor2()
Visiting an invalid subvector.


testWalkInOptimizedOrderChangingVisitor3

public void testWalkInOptimizedOrderChangingVisitor3()
Visiting a valid subvector.



Copyright © 2003-2013 The Apache Software Foundation. All Rights Reserved.