Class RealSparseEquals
java.lang.Object
org.flag4j.linalg.ops.sparse.coo.real.RealSparseEquals
This class contains methods for checking the equality of real sparse tensors.
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
allCloseMatrix
(CooMatrix src1, CooMatrix src2, double relTol, double absTol) Checks that all non-zero data 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 data 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 data are "close" according toRealProperties.allClose(double[], double[])
and all indices are the same.static boolean
cooMatrixEquals
(CooMatrix src1, CooMatrix src2) Checks if two real sparse matrices are real.static boolean
Checks if two real sparse tensors are real.static boolean
Checks if two real sparse vectors are real.
-
Method Details
-
cooTensorEquals
Checks if two real sparse tensors are real. Assumes the indices of each sparse tensor are sorted. Any explicitly stored zero's will be ignored.- Parameters:
a
- First tensor in the equality check.b
- Second tensor in the equality check.- Returns:
- True if the tensors are equal. False otherwise.
-
cooMatrixEquals
Checks if two real sparse matrices are real. Assumes the indices of each sparse matrix are sorted. Any explicitly stored zero's will be ignored.- Parameters:
src1
- First matrix in the equality check.src2
- Second matrix in the equality check.- Returns:
- True if the matrices are equal. False otherwise.
-
cooVectorEquals
Checks if two real sparse vectors are real. Assumes the indices of each sparse vector are sorted. Any explicitly stored zero's will be ignored.- 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 data 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 data are "close". Otherwise, false.
-
allCloseTensor
Checks that all non-zero data 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 data are "close". Otherwise, false.
-
allCloseVector
Checks that all non-zero data 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 data are "close". Otherwise, false.
-