Class RealSparseEquals

java.lang.Object
org.flag4j.linalg.ops.sparse.coo.real.RealSparseEquals

public final class RealSparseEquals extends Object
This class contains methods for checking the equality of real sparse tensors.
  • Method Details

    • cooTensorEquals

      public static boolean cooTensorEquals(CooTensor a, CooTensor b)
      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

      public static boolean cooMatrixEquals(CooMatrix src1, CooMatrix src2)
      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

      public static boolean cooVectorEquals(CooVector a, CooVector b)
      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

      public static boolean allCloseMatrix(CooMatrix src1, CooMatrix src2, double relTol, double absTol)
      Checks that all non-zero data are "close" according to RealProperties.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

      public static boolean allCloseTensor(CooTensor src1, CooTensor src2, double relTol, double absTol)
      Checks that all non-zero data are "close" according to RealProperties.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

      public static boolean allCloseVector(CooVector src1, CooVector src2, double relTol, double absTol)
      Checks that all non-zero data are "close" according to RealProperties.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.