|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.math.TestUtils
public class TestUtils
Method Summary | ||
---|---|---|
static void |
assertContains(org.apache.commons.math.complex.Complex[] values,
org.apache.commons.math.complex.Complex z,
double epsilon)
Fails iff values does not contain a number within epsilon of z. |
|
static void |
assertContains(double[] values,
double x,
double epsilon)
Fails iff values does not contain a number within epsilon of x. |
|
static void |
assertContains(String msg,
org.apache.commons.math.complex.Complex[] values,
org.apache.commons.math.complex.Complex z,
double epsilon)
Fails iff values does not contain a number within epsilon of z. |
|
static void |
assertContains(String msg,
double[] values,
double x,
double epsilon)
Fails iff values does not contain a number within epsilon of x. |
|
static void |
assertEquals(org.apache.commons.math.complex.Complex expected,
org.apache.commons.math.complex.Complex actual,
double delta)
Verifies that real and imaginary parts of the two complex arguments differ by at most delta. |
|
static void |
assertEquals(double[] expected,
double[] observed,
double tolerance)
Verifies that two double arrays have equal entries, up to tolerance |
|
static void |
assertEquals(double expected,
double actual,
double delta)
Verifies that expected and actual are within delta, or are both NaN or infinities of the same sign. |
|
static void |
assertEquals(org.apache.commons.math.linear.FieldMatrix<? extends org.apache.commons.math.FieldElement<?>> expected,
org.apache.commons.math.linear.FieldMatrix<? extends org.apache.commons.math.FieldElement<?>> observed)
verifies that two matrices are equal |
|
static void |
assertEquals(String msg,
double[] expected,
double[] observed,
double tolerance)
verifies that two arrays are close (sup norm) |
|
static void |
assertEquals(String msg,
double expected,
double actual,
double delta)
Verifies that expected and actual are within delta, or are both NaN or infinities of the same sign. |
|
static void |
assertEquals(String msg,
org.apache.commons.math.linear.RealMatrix expected,
org.apache.commons.math.linear.RealMatrix observed,
double tolerance)
verifies that two matrices are close (1-norm) |
|
static
|
assertEquals(T[] m,
T[] n)
verifies that two arrays are equal |
|
static void |
assertRelativelyEquals(double expected,
double actual,
double relativeError)
Verifies that the relative error in actual vs. |
|
static void |
assertRelativelyEquals(String msg,
double expected,
double actual,
double relativeError)
Verifies that the relative error in actual vs. |
|
static void |
assertSame(org.apache.commons.math.complex.Complex expected,
org.apache.commons.math.complex.Complex actual)
Verifies that real and imaginary parts of the two complex arguments are exactly the same. |
|
static void |
assertSame(double expected,
double actual)
Verifies that the two arguments are exactly the same, either both NaN or infinities of same sign, or identical floating point values. |
|
static void |
checkSerializedEquality(Object object)
Verifies that serialization preserves equals and hashCode. |
|
static Object |
serializeAndRecover(Object o)
Serializes an object to a bytes array and then recovers the object from the bytes array. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void assertEquals(double expected, double actual, double delta)
public static void assertEquals(String msg, double expected, double actual, double delta)
public static void assertSame(double expected, double actual)
public static void assertSame(org.apache.commons.math.complex.Complex expected, org.apache.commons.math.complex.Complex actual)
public static void assertEquals(org.apache.commons.math.complex.Complex expected, org.apache.commons.math.complex.Complex actual, double delta)
public static void assertEquals(double[] expected, double[] observed, double tolerance)
public static Object serializeAndRecover(Object o)
o
- object to serialize and recover
public static void checkSerializedEquality(Object object)
object
- the object to serialize and recoverpublic static void assertRelativelyEquals(double expected, double actual, double relativeError)
expected
- expected valueactual
- observed valuerelativeError
- maximum allowable relative errorpublic static void assertRelativelyEquals(String msg, double expected, double actual, double relativeError)
msg
- message to return with failureexpected
- expected valueactual
- observed valuerelativeError
- maximum allowable relative errorpublic static void assertContains(String msg, org.apache.commons.math.complex.Complex[] values, org.apache.commons.math.complex.Complex z, double epsilon)
msg
- message to return with failurevalues
- complex array to searchz
- value soughtepsilon
- tolerancepublic static void assertContains(org.apache.commons.math.complex.Complex[] values, org.apache.commons.math.complex.Complex z, double epsilon)
values
- complex array to searchz
- value soughtepsilon
- tolerancepublic static void assertContains(String msg, double[] values, double x, double epsilon)
msg
- message to return with failurevalues
- double array to searchx
- value soughtepsilon
- tolerancepublic static void assertContains(double[] values, double x, double epsilon)
values
- double array to searchx
- value soughtepsilon
- tolerancepublic static void assertEquals(String msg, org.apache.commons.math.linear.RealMatrix expected, org.apache.commons.math.linear.RealMatrix observed, double tolerance)
public static void assertEquals(org.apache.commons.math.linear.FieldMatrix<? extends org.apache.commons.math.FieldElement<?>> expected, org.apache.commons.math.linear.FieldMatrix<? extends org.apache.commons.math.FieldElement<?>> observed)
public static void assertEquals(String msg, double[] expected, double[] observed, double tolerance)
public static <T extends org.apache.commons.math.FieldElement<T>> void assertEquals(T[] m, T[] n)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |