Class EjmlUnitTests
- java.lang.Object
-
- org.ejml.ops.EjmlUnitTests
-
public class EjmlUnitTests extends java.lang.ObjectContains various functions related to unit testing matrix operations.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static classEjmlUnitTests.TestException
-
Constructor Summary
Constructors Constructor and Description EjmlUnitTests()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static voidassertCountable(RealMatrix64F A)Checks to see if every element in A is countable.static voidassertEquals(Complex64F a, Complex64F b, double tol)static voidassertEquals(ComplexMatrix64F A, ComplexMatrix64F B, double tol)static voidassertEquals(RealMatrix32F A, RealMatrix32F B, float tol)static voidassertEquals(RealMatrix64F A, RealMatrix64F B, double tol)Checks to see if each element in the matrices are within tolerance of each other and countable:static voidassertEqualsTrans(RealMatrix64F A, RealMatrix64F B, double tol)Checks to see if the transpose of B is equal to A and countable:static voidassertEqualsUncountable(RealMatrix64F A, RealMatrix64F B, double tol)Checks to see if each element in the matrix is within tolerance of each other:static voidassertShape(Matrix A, Matrix B)Checks to see if A and B have the same shape.static voidassertShape(RealMatrix64F A, int numRows, int numCols)Checks to see if the matrix has the specified number of rows and columns.
-
-
-
Method Detail
-
assertCountable
public static void assertCountable(RealMatrix64F A)
Checks to see if every element in A is countable. A doesn't have any element with a value of NaN or infinite.- Parameters:
A- Matrix
-
assertShape
public static void assertShape(Matrix A, Matrix B)
Checks to see if A and B have the same shape.
- Parameters:
A- MatrixB- Matrix
-
assertShape
public static void assertShape(RealMatrix64F A, int numRows, int numCols)
Checks to see if the matrix has the specified number of rows and columns.
- Parameters:
A- MatrixnumRows- expected number of rows in the matrixnumCols- expected number of columns in the matrix
-
assertEqualsUncountable
public static void assertEqualsUncountable(RealMatrix64F A, RealMatrix64F B, double tol)
Checks to see if each element in the matrix is within tolerance of each other:
The two matrices are identical with in tolerance if:
|aij - bij| ≤ tolIn addition if an element is NaN or infinite in one matrix it must be the same in the other.
- Parameters:
A- Matrix AB- Matrix Btol- Tolerance
-
assertEquals
public static void assertEquals(RealMatrix64F A, RealMatrix64F B, double tol)
Checks to see if each element in the matrices are within tolerance of each other and countable:
The two matrices are identical with in tolerance if:
|aij - bij| ≤ tolThe test will fail if any element in either matrix is NaN or infinite.
- Parameters:
A- Matrix AB- Matrix Btol- Tolerance
-
assertEquals
public static void assertEquals(RealMatrix32F A, RealMatrix32F B, float tol)
-
assertEquals
public static void assertEquals(Complex64F a, Complex64F b, double tol)
-
assertEquals
public static void assertEquals(ComplexMatrix64F A, ComplexMatrix64F B, double tol)
-
assertEqualsTrans
public static void assertEqualsTrans(RealMatrix64F A, RealMatrix64F B, double tol)
Checks to see if the transpose of B is equal to A and countable:
|aij - bji| ≤ tol
The test will fail if any element in either matrix is NaN or infinite.
- Parameters:
A- Matrix AB- Matrix Btol- Tolerance
-
-
DMelt 3.0 © DataMelt by jWork.ORG