Package org.ejml.sparse.csc.mult
Class ImplMultiplication_DSCC
java.lang.Object
org.ejml.sparse.csc.mult.ImplMultiplication_DSCC
Implementation of single thread sparse matrix multiplication. Most functions should be
invoked through
CommonOps_DSCC
. This code is focused on the implementation and does not
check the contract or properly initialize input data structures.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addRowsInAInToC
(DMatrixSparseCSC A, int colA, DMatrixSparseCSC C, int colC, int[] w) Adds rows to C[*,colC] that are in A[*,colA] as long as they are marked in w.static double
dotInnerColumns
(DMatrixSparseCSC A, int colA, DMatrixSparseCSC B, int colB, @Nullable IGrowArray gw, @Nullable DGrowArray gx) Computes the inner product of two column vectors taken from the input matrices.static void
mult
(DMatrixSparseCSC A, DMatrixRMaj B, DMatrixRMaj C) Invoke throughCommonOps_DSCC
static void
mult
(DMatrixSparseCSC A, DMatrixSparseCSC B, DMatrixSparseCSC C, @Nullable IGrowArray gw, @Nullable DGrowArray gx) Performs matrix multiplication.static void
multAdd
(DMatrixSparseCSC A, DMatrixRMaj B, DMatrixRMaj C) Invoke throughCommonOps_DSCC
static void
multAddColA
(DMatrixSparseCSC A, int colA, double alpha, DMatrixSparseCSC C, int mark, double[] x, int[] w) Performs the operation x = x + A(:,i)*alphastatic void
multAddTransA
(DMatrixSparseCSC A, DMatrixRMaj B, DMatrixRMaj C, DGrowArray workArray) Invoke throughCommonOps_DSCC
static void
Invoke throughCommonOps_DSCC
static void
multAddTransB
(DMatrixSparseCSC A, DMatrixRMaj B, DMatrixRMaj C, DGrowArray workArray) Invoke throughCommonOps_DSCC
static void
multTransA
(DMatrixSparseCSC A, DMatrixRMaj B, DMatrixRMaj C, DGrowArray workArray) Invoke throughCommonOps_DSCC
static void
multTransA
(DMatrixSparseCSC A, DMatrixRMaj B, DMatrixRMaj C, DGrowArray workArray, DOperatorBinary op) Invoke throughCommonOps_DSCC
static void
Invoke throughCommonOps_DSCC
static void
multTransB
(DMatrixSparseCSC A, DMatrixRMaj B, DMatrixRMaj C, DGrowArray workArray) Invoke throughCommonOps_DSCC
-
Constructor Details
-
ImplMultiplication_DSCC
public ImplMultiplication_DSCC()
-
-
Method Details
-
mult
public static void mult(DMatrixSparseCSC A, DMatrixSparseCSC B, DMatrixSparseCSC C, @Nullable @Nullable IGrowArray gw, @Nullable @Nullable DGrowArray gx) Performs matrix multiplication. C = A*BInvoke through
CommonOps_DSCC
- Parameters:
A
- MatrixB
- MatrixC
- Storage for results. Array size is increased if needed.gw
- (Optional) Storage for internal workspace. Can be null.gx
- (Optional) Storage for internal workspace. Can be null.
-
multAddColA
public static void multAddColA(DMatrixSparseCSC A, int colA, double alpha, DMatrixSparseCSC C, int mark, double[] x, int[] w) Performs the operation x = x + A(:,i)*alphaNOTE: This is the same as cs_scatter() in csparse.
-
addRowsInAInToC
public static void addRowsInAInToC(DMatrixSparseCSC A, int colA, DMatrixSparseCSC C, int colC, int[] w) Adds rows to C[*,colC] that are in A[*,colA] as long as they are marked in w. This is used to grow C and colC must be the last filled in column in C.NOTE: This is the same as cs_scatter if x is null.
- Parameters:
A
- MatrixcolA
- The column in A that is being examinedC
- MatrixcolC
- Column in C that rows in A are being added to.w
- An array used to indicate if a row in A should be added to C. if w[i] < colC AND i is a row in A[*,colA] then it will be added.
-
mult
Invoke through
CommonOps_DSCC
-
multAdd
Invoke through
CommonOps_DSCC
-
multTransA
public static void multTransA(DMatrixSparseCSC A, DMatrixRMaj B, DMatrixRMaj C, DGrowArray workArray) Invoke through
CommonOps_DSCC
-
multAddTransA
public static void multAddTransA(DMatrixSparseCSC A, DMatrixRMaj B, DMatrixRMaj C, DGrowArray workArray) Invoke through
CommonOps_DSCC
-
multTransA
public static void multTransA(DMatrixSparseCSC A, DMatrixRMaj B, DMatrixRMaj C, DGrowArray workArray, DOperatorBinary op) Invoke through
CommonOps_DSCC
-
multTransB
public static void multTransB(DMatrixSparseCSC A, DMatrixRMaj B, DMatrixRMaj C, DGrowArray workArray) Invoke through
CommonOps_DSCC
-
multAddTransB
public static void multAddTransB(DMatrixSparseCSC A, DMatrixRMaj B, DMatrixRMaj C, DGrowArray workArray) Invoke through
CommonOps_DSCC
-
multTransAB
Invoke through
CommonOps_DSCC
-
multAddTransAB
Invoke through
CommonOps_DSCC
-
dotInnerColumns
public static double dotInnerColumns(DMatrixSparseCSC A, int colA, DMatrixSparseCSC B, int colB, @Nullable @Nullable IGrowArray gw, @Nullable @Nullable DGrowArray gx) Computes the inner product of two column vectors taken from the input matrices.dot = A(:,colA)'*B(:,colB)
Invoke through
CommonOps_DSCC
- Parameters:
A
- MatrixcolA
- Column in AB
- MatrixcolB
- Column in B- Returns:
- Dot product
-