Class RealComplexCsrDenseOps
java.lang.Object
org.flag4j.linalg.ops.dense_sparse.csr.real_complex.RealComplexCsrDenseOps
This class contains low-level ops which act on a real/complex dense and a complex/real
sparse
CSR matrix.-
Method Summary
Modifier and TypeMethodDescriptionstatic CMatrixadd(CsrCMatrix a, Matrix b) Computes the element-wise sum of two matrices.static CMatrixapplyBinOpp(Matrix src1, CsrCMatrix src2, BiFunction<Double, Complex128, Complex128> opp) Applies the specified binary operator element-wise to the two matrices.static CMatrixapplyBinOpp(CsrCMatrix src1, Matrix src2, BiFunction<Complex128, Double, Complex128> opp, UnaryOperator<Double> uOpp) Applies the specified binary operator element-wise to the two matrices.static CMatrixapplyBinOpp(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.static CMatrixsub(Matrix a, CsrCMatrix b) Computes the element-wise difference of two matrices.static CMatrixsub(CsrCMatrix a, Matrix b) Computes the element-wise difference of two matrices.
-
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 benull. If the binary operation is not commutative, it needs to be decomposable to one commutative binary operationoppand one unary operationuOppsuch that it is equivalent toopp.apply(x, uOpp.apply(y)).- Returns:
- A matrix containing the result from applying
oppelement-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
oppelement-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 benull. If the binary operation is not commutative, it needs to be decomposable to one commutative binary operationoppand one unary operationuOppsuch that it is equivalent toopp.apply(x, uOpp.apply(y)).- Returns:
- A matrix containing the result from applying
oppelement-wise to the two matrices.
-
add
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
aandb.
-
sub
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
aandb.
-
sub
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
aandb.
-