|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.math3.linear.UnmodifiableRealVectorAbstractTest
public abstract class UnmodifiableRealVectorAbstractTest
This is an abstract test of the unmodifiable vector
implementation. These unmodifiable vectors decorate a (modifiable)
RealVector; therefore, a new implementation of this abstract
test should be considered for each implementation of
RealVector.
| Field Summary | |
|---|---|
protected static int |
DIM
The dimension of the randomly generated vectors. |
protected static double |
EPS
Absolute tolerance. |
protected static Set<String> |
EXCLUDE
The list of methods which are excluded from the general test testAllButExcluded(). |
protected static Random |
RANDOM
The random number generator (always initialized with the same seed. |
| Constructor Summary | |
|---|---|
UnmodifiableRealVectorAbstractTest()
|
|
| Method Summary | |
|---|---|
Object |
createParameter(Class<?> c)
Creates a new random object of the specified type. |
abstract RealVector |
createVector()
Creates a new random vector of a specified type. |
static boolean |
equals(double[] x,
double[] y)
Returns true if the specified double arrays are equal
(within a given tolerance). |
static boolean |
equals(double x,
double y)
Returns true if the specified double are equal (within a
given tolerance). |
static boolean |
equals(Object x,
Object y)
Returns true if the specified Object are equal. |
static boolean |
equals(RealMatrix x,
RealMatrix y)
Returns true if the specified RealMatrix are equal
(within a given tolerance). |
static boolean |
equals(RealVector x,
double[] y)
Returns true if the specified RealVector is equal to the
specified double array (within a given tolerance). |
static boolean |
equals(RealVector x,
RealVector y)
Returns true if the specified RealVector are equal
(within a given tolerance). |
void |
testAddToEntry()
|
void |
testAllButExcluded()
This test calls callMethod(Method, RealVector, Object...) on
every method defined in interface RealVector. |
void |
testGetEntry()
|
void |
testGetSubVector()
|
void |
testIterator()
|
void |
testSetEntry()
|
void |
testSetSubVector()
|
void |
testSparseIterator()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final int DIM
protected static final double EPS
protected static final Set<String> EXCLUDE
testAllButExcluded().
protected static final Random RANDOM
| Constructor Detail |
|---|
public UnmodifiableRealVectorAbstractTest()
| Method Detail |
|---|
public static boolean equals(double x,
double y)
true if the specified double are equal (within a
given tolerance).
x - First double.y - Second double.
true if x and y are equal.
public static boolean equals(double[] x,
double[] y)
true if the specified double arrays are equal
(within a given tolerance).
x - First array.y - Second array.
true if x and y are equal.
public static boolean equals(RealVector x,
RealVector y)
true if the specified RealVector are equal
(within a given tolerance).
x - First vector.y - Second vector.
true if x and y are equal.
public static boolean equals(RealVector x,
double[] y)
true if the specified RealVector is equal to the
specified double array (within a given tolerance).
x - Vector.y - Array.
true if x and y are equal.
public static boolean equals(RealMatrix x,
RealMatrix y)
true if the specified RealMatrix are equal
(within a given tolerance).
x - First matrix.y - Second matrix.
true if x and y are equal.
public static boolean equals(Object x,
Object y)
true if the specified Object are equal.
x - First object.y - Second object.
true if x and y are equal.
IllegalArgumentException - if x and y could
not be compared.public abstract RealVector createVector()
public Object createParameter(Class<?> c)
c - Class of the object to be created.
IllegalArgumentException - if the specified class is not
recognized by this method.
public void testAllButExcluded()
throws IllegalAccessException,
IllegalArgumentException,
InvocationTargetException
callMethod(Method, RealVector, Object...) on
every method defined in interface RealVector. It generates the
appropriate random arguments. Some methods are manually excluded (see
EXCLUDE), they must be handled by separate tests.
IllegalAccessException
IllegalArgumentException
InvocationTargetExceptionpublic void testGetEntry()
public void testSetEntry()
public void testAddToEntry()
public void testGetSubVector()
public void testSetSubVector()
public void testIterator()
public void testSparseIterator()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||