Class RealSparseEquals
java.lang.Object
org.flag4j.operations.sparse.coo.real.RealSparseEquals
This class contains methods for checking the equality of real sparse tensors.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
allCloseMatrix
(CooMatrix src1, CooMatrix src2, double relTol, double absTol) Checks that all non-zero entries are "close" according toRealProperties.allClose(double[], double[])
and * all indices are the same.static boolean
allCloseTensor
(CooTensor src1, CooTensor src2, double relTol, double absTol) Checks that all non-zero entries are "close" according toRealProperties.allClose(double[], double[], double, double)
and all indices are the same.static boolean
allCloseVector
(CooVector src1, CooVector src2, double relTol, double absTol) Checks that all non-zero entries are "close" according toRealProperties.allClose(double[], double[])
and all indices are the same.static boolean
matrixEquals
(CooMatrix a, CooMatrix b) Checks if two real sparse matrices are real.static boolean
tensorEquals
(CooTensor a, CooTensor b) Checks if two real sparse tensors are real.static boolean
vectorEquals
(CooVector a, CooVector b) Checks if two real sparse vectors are real.
-
Constructor Details
-
RealSparseEquals
private RealSparseEquals()
-
-
Method Details
-
tensorEquals
Checks if two real sparse tensors are real. Assumes the indices of each sparse tensor are sorted.- Parameters:
a
- First tensor in the equality check.b
- Second tensor in the equality check.- Returns:
- True if the tensors are equal. False otherwise.
-
matrixEquals
Checks if two real sparse matrices are real. Assumes the indices of each sparse matrix are sorted.- Parameters:
a
- First matrix in the equality check.b
- Second matrix in the equality check.- Returns:
- True if the matrices are equal. False otherwise.
-
vectorEquals
Checks if two real sparse vectors are real. Assumes the indices of each sparse vector are sorted.- 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
Checks that all non-zero entries are "close" according toRealProperties.allClose(double[], double[])
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
Checks that all non-zero entries are "close" according toRealProperties.allClose(double[], double[], double, double)
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
Checks that all non-zero entries are "close" according toRealProperties.allClose(double[], double[])
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.
-