Class RealComplexDenseCooMatOps

java.lang.Object
org.flag4j.linalg.ops.dense_sparse.coo.real_complex.RealComplexDenseCooMatOps

public final class RealComplexDenseCooMatOps extends Object
This class contains low level implementations of ops between real/complex and dense/sparse matrices.
  • Method Details

    • add

      public static CMatrix add(Matrix src1, CooCMatrix src2)
      Adds a real dense matrix to a complex sparse matrix.
      Parameters:
      src1 - First matrix.
      src2 - Second matrix.
      Returns:
      The result of the matrix addition.
      Throws:
      TensorShapeException - If the matrices do not have the same shape.
    • sub

      public static CMatrix sub(Matrix src1, CooCMatrix src2)
      Subtracts a real sparse matrix from a real dense matrix.
      Parameters:
      src1 - First matrix.
      src2 - Second matrix.
      Returns:
      The result of the matrix subtraction.
      Throws:
      TensorShapeException - If the matrices do not have the same shape.
    • sub

      public static CMatrix sub(CooCMatrix src2, Matrix src1)
      Subtracts a real sparse matrix from a real dense matrix.
      Parameters:
      src2 - Second matrix.
      src1 - First matrix.
      Returns:
      The result of the matrix subtraction.
      Throws:
      TensorShapeException - If the matrices do not have the same shape.
    • elemMult

      public static CooCMatrix elemMult(CMatrix src1, CooMatrix src2)
      Computes the element-wise multiplication between a complex dense matrix and a real sparse matrix.
      Parameters:
      src1 - First matrix.
      src2 - Second matrix.
      Returns:
      The result of element-wise multiplication.
      Throws:
      TensorShapeException - If the matrices do not have the same shape.
    • elemMult

      public static CooCMatrix elemMult(Matrix src1, CooCMatrix src2)
      Computes the element-wise multiplication between a complex dense matrix and a real sparse matrix.
      Parameters:
      src1 - First matrix in the element-wise product.
      src2 - Second matrix in the element-wise product.
      Returns:
      The result of element-wise product of src1 with src2.
      Throws:
      TensorShapeException - If the matrices do not have the same shape.
    • elemDiv

      public static CooCMatrix elemDiv(CooMatrix src1, CMatrix src2)
      Computes the element-wise division between a real sparse matrix and a complex dense matrix.

      If the dense matrix contains a zero at the same index the sparse matrix contains a non-zero, the result will be either Double.POSITIVE_INFINITY or Double.NEGATIVE_INFINITY.

      If the dense matrix contains a zero at an index for which the sparse matrix is also zero, the result will be zero. This is done to realize computational benefits from ops with sparse matrices.

      Parameters:
      src1 - Real sparse matrix and numerator in element-wise quotient.
      src2 - Real Dense matrix and denominator in element-wise quotient.
      Returns:
      The element-wise quotient of src1 and src2.
      Throws:
      TensorShapeException - If src1 and src2 do not have the same shape.