Class ComplexSparseEquals
java.lang.Object
org.flag4j.operations.sparse.coo.complex.ComplexSparseEquals
This class contains low-level implementations to check if a pair of complex sparse tensors/matrices/vectors
are element-wise equivalent.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
allCloseMatrix
(CooCMatrix src1, CooCMatrix src2, double relTol, double absTol) Checks that all non-zero entries are "close" according toComplexProperties.allClose(CNumber[], CNumber[])
and * all indices are the same.static boolean
allCloseTensor
(CooCTensor src1, CooCTensor src2, double relTol, double absTol) Checks that all non-zero entries are "close" according toComplexProperties.allClose(CNumber[], CNumber[])
and all indices are the same.static boolean
allCloseVector
(CooCVector src1, CooCVector src2, double relTol, double absTol) Checks that all non-zero entries are "close" according toComplexProperties.allClose(CNumber[], CNumber[])
and all indices are the same.static boolean
matrixEquals
(CooCMatrix a, CooCMatrix b) Checks if two complex sparse matrices are equal.static boolean
tensorEquals
(CooCTensor a, CooCTensor b) Checks if two complex sparse matrices are equal.static boolean
vectorEquals
(CooCVector a, CooCVector b) Checks if two complex sparse vectors are equal.
-
Constructor Details
-
ComplexSparseEquals
private ComplexSparseEquals()
-
-
Method Details
-
tensorEquals
Checks if two complex sparse matrices are equal.- Parameters:
a
- First matrix in the equality check.b
- First matrix in the equality check.- Returns:
- True if the matrices are equal. False otherwise.
-
matrixEquals
Checks if two complex sparse matrices are equal.- Parameters:
a
- First matrix in the equality check.b
- First matrix in the equality check.- Returns:
- True if the matrices are equal. False otherwise.
-
vectorEquals
Checks if two complex sparse vectors are equal.- Parameters:
a
- First vector in the equality check.b
- Second vector in the equality check.- Returns:
- True if the vectors are equal. False otherwise.
-
allCloseMatrix
public static boolean allCloseMatrix(CooCMatrix src1, CooCMatrix src2, double relTol, double absTol) Checks that all non-zero entries are "close" according toComplexProperties.allClose(CNumber[], CNumber[])
and * all indices are the same.- Parameters:
src1
- First matrix in comparison.src2
- Second matrix in comparison.relTol
- Relative tolerance.absTol
- Absolute tolerance.- Returns:
- True if all entries are "close". Otherwise, false.
-
allCloseTensor
public static boolean allCloseTensor(CooCTensor src1, CooCTensor src2, double relTol, double absTol) Checks that all non-zero entries are "close" according toComplexProperties.allClose(CNumber[], CNumber[])
and all indices are the same.- Parameters:
src1
- First tensor in comparison.src2
- Second tensor in comparison.relTol
- Relative tolerance.absTol
- Absolute tolerance.- Returns:
- True if all entries are "close". Otherwise, false.
-
allCloseVector
public static boolean allCloseVector(CooCVector src1, CooCVector src2, double relTol, double absTol) Checks that all non-zero entries are "close" according toComplexProperties.allClose(CNumber[], CNumber[])
and all indices are the same.- Parameters:
src1
- First vector in comparison.src2
- Second vector in comparison.relTol
- Relative tolerance.absTol
- Absolute tolerance.- Returns:
- True if all entries are "close". Otherwise, false.
-