Class RealCsrEquals

java.lang.Object
org.flag4j.linalg.ops.sparse.csr.real.RealCsrEquals

public final class RealCsrEquals extends Object
This class contains methods to check equality or approximate equality between two sparse CSR matrices.
  • Method Details

    • allClose

      public static boolean allClose(CsrMatrix src1, CsrMatrix src2, double relTol, double absTol)
      Checks if all data of this tensor are close to the data of the argument tensor.
      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 the src2 matrix and all data are 'close', i.e. elements a and b at the same positions in the two matrices respectively satisfy |a-b| <= (absTol + relTol*|b|). Otherwise, returns false.