Class ComplexCsrEquals
java.lang.Object
org.flag4j.operations.sparse.csr.complex.ComplexCsrEquals
This class contains methods to check equality or approximate equality between two complex sparse CSR matrices.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
allClose
(CsrCMatrix src1, CsrCMatrix src2, double relTol, double absTol) Checks if all entries of this tensor are close to the entries of the argumenttensor
.private static void
removeCloseToZero
(CsrCMatrix src, List<CNumber> entries, int[] rowPointers, List<Integer> colIndices, double aTol) Removes entries insrc
which are withinatol
in absolute value from zero.
-
Constructor Details
-
ComplexCsrEquals
private ComplexCsrEquals()
-
-
Method Details
-
allClose
Checks if all entries of this tensor are close to the entries of the argumenttensor
.- Parameters:
src1
- First matrix in the comparison.src2
- Second matrix in the comparison.relTol
- Relative tolerance.absTol
- Absolute tolerance.- Returns:
- True if the
src1
matrix is the same shape as thesrc2
matrix and all entries are 'close', i.e. elementsa
andb
at the same positions in the two matrices respectively satisfy|a-b| <= (absTol + relTol*|b|)
. Otherwise, returns false.
-
removeCloseToZero
private static void removeCloseToZero(CsrCMatrix src, List<CNumber> entries, int[] rowPointers, List<Integer> colIndices, double aTol) Removes entries insrc
which are withinatol
in absolute value from zero.- Parameters:
src
- Source CSR matrix.entries
- List to store value insrc
which are not withinatol
in absolute value from zero.rowPointers
- Row pointers for entries.colIndices
- Column indices of entries.aTol
- Absolute tolerance for value to be considered close to zero.
-