Class RealComplexCsrDenseOps

java.lang.Object
org.flag4j.linalg.ops.dense_sparse.csr.real_complex.RealComplexCsrDenseOps

public final class RealComplexCsrDenseOps extends Object
This class contains low-level ops which act on a real/complex dense and a complex/real sparse CSR matrix.
  • Method Details

    • applyBinOpp

      public static CMatrix applyBinOpp(CsrCMatrix src1, Matrix src2, BiFunction<Complex128,Double,Complex128> opp, UnaryOperator<Double> uOpp)
      Applies the specified binary operator element-wise to the two matrices.
      Parameters:
      src1 - First matrix in element-wise binary operation.
      src2 - Second matrix in element-wise binary operation.
      opp - Binary operator to apply element-wise to the two matrices.
      uOpp - Unary operator for use with binary ops which are not commutative such as subtraction. If the operation is commutative this should be null. If the binary operation is not commutative, it needs to be decomposable to one commutative binary operation opp and one unary operation uOpp such that it is equivalent to opp.apply(x, uOpp.apply(y)).
      Returns:
      A matrix containing the result from applying opp element-wise to the two matrices.
    • applyBinOpp

      public static CMatrix applyBinOpp(Matrix src1, CsrCMatrix src2, BiFunction<Double,Complex128,Complex128> opp)
      Applies the specified binary operator element-wise to the two matrices.
      Parameters:
      src1 - First matrix in element-wise binary operation.
      src2 - Second matrix in element-wise binary operation.
      opp - Binary operator to apply element-wise to the two matrices.
      Returns:
      A matrix containing the result from applying opp element-wise to the two matrices.
    • applyBinOpp

      public static CMatrix applyBinOpp(CsrMatrix src1, Complex128 b, BiFunction<Double,Complex128,Complex128> opp, UnaryOperator<Complex128> uOpp)
      Applies the specified binary operator element-wise to a matrix and a scalar.
      Parameters:
      src1 - First matrix in element-wise binary operation.
      b - Scalar to apply element-wise using the specified operation.
      opp - Binary operator to apply element-wise to the two matrices.
      uOpp - Unary operator for use with binary ops which are not commutative such as subtraction. If the operation is commutative this should be null. If the binary operation is not commutative, it needs to be decomposable to one commutative binary operation opp and one unary operation uOpp such that it is equivalent to opp.apply(x, uOpp.apply(y)).
      Returns:
      A matrix containing the result from applying opp element-wise to the two matrices.
    • add

      public static CMatrix add(CsrCMatrix a, Matrix b)
      Computes the element-wise sum of two matrices.
      Parameters:
      a - First matrix in sum.
      b - Second matrix in sum.
      Returns:
      The element-wise sum of a and b.
    • sub

      public static CMatrix sub(CsrCMatrix a, Matrix b)
      Computes the element-wise difference of two matrices.
      Parameters:
      a - First matrix in difference.
      b - Second matrix in difference.
      Returns:
      The element-wise difference of a and b.
    • sub

      public static CMatrix sub(Matrix a, CsrCMatrix b)
      Computes the element-wise difference of two matrices.
      Parameters:
      a - First matrix in difference.
      b - Second matrix in difference.
      Returns:
      The element-wise difference of a and b.