Skip to content

Commit

Permalink
Renaming
Browse files Browse the repository at this point in the history
- ImplSparseSparseMult was a bad name since it included sparse-sparse and sparse-dense
  • Loading branch information
lessthanoptimal committed Nov 4, 2020
1 parent 9289440 commit 09db214
Show file tree
Hide file tree
Showing 13 changed files with 71 additions and 71 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2020, Peter Abeles. All Rights Reserved.
* Copyright (c) 2020, Peter Abeles. All Rights Reserved.
*
* This file is part of Efficient Java Matrix Library (EJML).
*
Expand All @@ -25,7 +25,7 @@
import org.ejml.data.IGrowArray;
import org.ejml.ops.DSemiRing;
import org.ejml.sparse.csc.misc.ImplCommonOpsWithSemiRing_DSCC;
import org.ejml.sparse.csc.mult.ImplSparseSparseMultWithSemiRing_DSCC;
import org.ejml.sparse.csc.mult.ImplMultiplicationWithSemiRing_DSCC;
import org.jetbrains.annotations.Nullable;

import static org.ejml.UtilEjml.reshapeOrDeclare;
Expand Down Expand Up @@ -54,7 +54,7 @@ public static DMatrixSparseCSC mult(DMatrixSparseCSC A, DMatrixSparseCSC B, @Nul
throw new MatrixDimensionException("Inconsistent matrix shapes. " + stringShapes(A, B));
output = reshapeOrDeclare(output, A, A.numRows, B.numCols);

ImplSparseSparseMultWithSemiRing_DSCC.mult(A, B, output, semiRing, gw, gx);
ImplMultiplicationWithSemiRing_DSCC.mult(A, B, output, semiRing, gw, gx);

return output;
}
Expand All @@ -73,7 +73,7 @@ public static DMatrixRMaj mult(DMatrixSparseCSC A, DMatrixRMaj B, @Nullable DMat

output = reshapeOrDeclare(output, A.numRows, B.numCols);

ImplSparseSparseMultWithSemiRing_DSCC.mult(A, B, output, semiRing);
ImplMultiplicationWithSemiRing_DSCC.mult(A, B, output, semiRing);

return output;
}
Expand All @@ -85,7 +85,7 @@ public static void multAdd(DMatrixSparseCSC A, DMatrixRMaj B, DMatrixRMaj output
if (A.numRows != output.numRows || B.numCols != output.numCols)
throw new IllegalArgumentException("Inconsistent matrix shapes. " + stringShapes(A, B, output));

ImplSparseSparseMultWithSemiRing_DSCC.multAdd(A, B, output, semiRing);
ImplMultiplicationWithSemiRing_DSCC.multAdd(A, B, output, semiRing);
}

/**
Expand All @@ -102,7 +102,7 @@ public static DMatrixRMaj multTransA(DMatrixSparseCSC A, DMatrixRMaj B, @Nullabl

output = reshapeOrDeclare(output, A.numCols, B.numCols);

ImplSparseSparseMultWithSemiRing_DSCC.multTransA(A, B, output, semiRing);
ImplMultiplicationWithSemiRing_DSCC.multTransA(A, B, output, semiRing);

return output;
}
Expand All @@ -114,7 +114,7 @@ public static void multAddTransA(DMatrixSparseCSC A, DMatrixRMaj B, DMatrixRMaj
if (A.numCols != output.numRows || B.numCols != output.numCols)
throw new IllegalArgumentException("Inconsistent matrix shapes. " + stringShapes(A, B, output));

ImplSparseSparseMultWithSemiRing_DSCC.multAddTransA(A, B, output, semiRing);
ImplMultiplicationWithSemiRing_DSCC.multAddTransA(A, B, output, semiRing);
}

/**
Expand All @@ -130,7 +130,7 @@ public static DMatrixRMaj multTransB(DMatrixSparseCSC A, DMatrixRMaj B, @Nullabl
throw new MatrixDimensionException("Inconsistent matrix shapes. " + stringShapes(A, B));
output = reshapeOrDeclare(output, A.numRows, B.numRows);

ImplSparseSparseMultWithSemiRing_DSCC.multTransB(A, B, output, semiRing);
ImplMultiplicationWithSemiRing_DSCC.multTransB(A, B, output, semiRing);

return output;
}
Expand All @@ -142,7 +142,7 @@ public static void multAddTransB(DMatrixSparseCSC A, DMatrixRMaj B, DMatrixRMaj
if (A.numRows != output.numRows || B.numRows != output.numCols)
throw new IllegalArgumentException("Inconsistent matrix shapes. " + stringShapes(A, B, output));

ImplSparseSparseMultWithSemiRing_DSCC.multAddTransB(A, B, output, semiRing);
ImplMultiplicationWithSemiRing_DSCC.multAddTransB(A, B, output, semiRing);
}

/**
Expand All @@ -158,7 +158,7 @@ public static DMatrixRMaj multTransAB(DMatrixSparseCSC A, DMatrixRMaj B, DMatrix
throw new MatrixDimensionException("Inconsistent matrix shapes. " + stringShapes(A, B));
output = reshapeOrDeclare(output, A.numCols, B.numRows);

ImplSparseSparseMultWithSemiRing_DSCC.multTransAB(A, B, output, semiRing);
ImplMultiplicationWithSemiRing_DSCC.multTransAB(A, B, output, semiRing);

return output;
}
Expand All @@ -171,7 +171,7 @@ public static void multAddTransAB(DMatrixSparseCSC A, DMatrixRMaj B, DMatrixRMaj
if (A.numCols != C.numRows || B.numRows != C.numCols)
throw new IllegalArgumentException("Inconsistent matrix shapes. " + stringShapes(A, B, C));

ImplSparseSparseMultWithSemiRing_DSCC.multAddTransAB(A, B, C, semiRing);
ImplMultiplicationWithSemiRing_DSCC.multAddTransAB(A, B, C, semiRing);
}

/**
Expand Down
22 changes: 11 additions & 11 deletions main/ejml-dsparse/src/org/ejml/sparse/csc/CommonOps_DSCC.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import org.ejml.sparse.csc.factory.DecompositionFactory_DSCC;
import org.ejml.sparse.csc.factory.LinearSolverFactory_DSCC;
import org.ejml.sparse.csc.misc.ImplCommonOps_DSCC;
import org.ejml.sparse.csc.mult.ImplSparseSparseMult_DSCC;
import org.ejml.sparse.csc.mult.ImplMultiplication_DSCC;
import org.jetbrains.annotations.Nullable;

import java.util.Arrays;
Expand Down Expand Up @@ -147,7 +147,7 @@ public static DMatrixSparseCSC mult( DMatrixSparseCSC A, DMatrixSparseCSC B,
throw new MatrixDimensionException("Inconsistent matrix shapes. " + stringShapes(A, B));
outputC = reshapeOrDeclare(outputC, A, A.numRows, B.numCols);

ImplSparseSparseMult_DSCC.mult(A, B, outputC, gw, gx);
ImplMultiplication_DSCC.mult(A, B, outputC, gw, gx);

return outputC;
}
Expand All @@ -164,7 +164,7 @@ public static DMatrixRMaj mult( DMatrixSparseCSC A, DMatrixRMaj B, @Nullable DMa
throw new MatrixDimensionException("Inconsistent matrix shapes. " + stringShapes(A, B));
outputC = reshapeOrDeclare(outputC, A.numRows, B.numCols);

ImplSparseSparseMult_DSCC.mult(A, B, outputC);
ImplMultiplication_DSCC.mult(A, B, outputC);

return outputC;
}
Expand All @@ -178,7 +178,7 @@ public static void multAdd( DMatrixSparseCSC A, DMatrixRMaj B, DMatrixRMaj outpu
if (A.numRows != outputC.numRows || B.numCols != outputC.numCols)
throw new MatrixDimensionException("Inconsistent matrix shapes. " + stringShapes(A, B, outputC));

ImplSparseSparseMult_DSCC.multAdd(A, B, outputC);
ImplMultiplication_DSCC.multAdd(A, B, outputC);
}

/**
Expand All @@ -194,7 +194,7 @@ public static DMatrixRMaj multTransA( DMatrixSparseCSC A, DMatrixRMaj B, @Nullab

outputC = reshapeOrDeclare(outputC, A.numCols, B.numCols);

ImplSparseSparseMult_DSCC.multTransA(A, B, outputC);
ImplMultiplication_DSCC.multTransA(A, B, outputC);

return outputC;
}
Expand All @@ -208,7 +208,7 @@ public static void multAddTransA( DMatrixSparseCSC A, DMatrixRMaj B, DMatrixRMaj
if (A.numCols != outputC.numRows || B.numCols != outputC.numCols)
throw new MatrixDimensionException("Inconsistent matrix shapes. " + stringShapes(A, B, outputC));

ImplSparseSparseMult_DSCC.multAddTransA(A, B, outputC);
ImplMultiplication_DSCC.multAddTransA(A, B, outputC);
}

/**
Expand All @@ -223,7 +223,7 @@ public static DMatrixRMaj multTransB( DMatrixSparseCSC A, DMatrixRMaj B, @Nullab
throw new MatrixDimensionException("Inconsistent matrix shapes. " + stringShapes(A, B));
outputC = reshapeOrDeclare(outputC, A.numRows, B.numRows);

ImplSparseSparseMult_DSCC.multTransB(A, B, outputC);
ImplMultiplication_DSCC.multTransB(A, B, outputC);

return outputC;
}
Expand All @@ -237,7 +237,7 @@ public static void multAddTransB( DMatrixSparseCSC A, DMatrixRMaj B, DMatrixRMaj
if (A.numRows != outputC.numRows || B.numRows != outputC.numCols)
throw new MatrixDimensionException("Inconsistent matrix shapes. " + stringShapes(A, B, outputC));

ImplSparseSparseMult_DSCC.multAddTransB(A, B, outputC);
ImplMultiplication_DSCC.multAddTransB(A, B, outputC);
}

/**
Expand All @@ -252,7 +252,7 @@ public static DMatrixRMaj multTransAB( DMatrixSparseCSC A, DMatrixRMaj B, DMatri
throw new MatrixDimensionException("Inconsistent matrix shapes. " + stringShapes(A, B));
outputC = reshapeOrDeclare(outputC, A.numCols, B.numRows);

ImplSparseSparseMult_DSCC.multTransAB(A, B, outputC);
ImplMultiplication_DSCC.multTransAB(A, B, outputC);

return outputC;
}
Expand All @@ -266,7 +266,7 @@ public static void multAddTransAB( DMatrixSparseCSC A, DMatrixRMaj B, DMatrixRMa
if (A.numCols != outputC.numRows || B.numRows != outputC.numCols)
throw new MatrixDimensionException("Inconsistent matrix shapes. " + stringShapes(A, B, outputC));

ImplSparseSparseMult_DSCC.multAddTransAB(A, B, outputC);
ImplMultiplication_DSCC.multAddTransAB(A, B, outputC);
}

/**
Expand Down Expand Up @@ -1505,7 +1505,7 @@ public static void zero( DMatrixSparseCSC A, int row0, int row1, int col0, int c
*/
public static double dotInnerColumns( DMatrixSparseCSC A, int colA, DMatrixSparseCSC B, int colB,
@Nullable IGrowArray gw, @Nullable DGrowArray gx ) {
return ImplSparseSparseMult_DSCC.dotInnerColumns(A, colA, B, colB, gw, gx);
return ImplMultiplication_DSCC.dotInnerColumns(A, colA, B, colB, gw, gx);
}

/**
Expand Down
16 changes: 8 additions & 8 deletions main/ejml-dsparse/src/org/ejml/sparse/csc/CommonOps_MT_DSCC.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import org.ejml.data.DMatrixRMaj;
import org.ejml.data.DMatrixSparseCSC;
import org.ejml.sparse.csc.misc.ImplCommonOps_MT_DSCC;
import org.ejml.sparse.csc.mult.ImplSparseSparseMult_MT_DSCC;
import org.ejml.sparse.csc.mult.ImplMultiplication_MT_DSCC;
import org.ejml.sparse.csc.mult.Workspace_MT_DSCC;
import org.jetbrains.annotations.Nullable;
import pabeles.concurrency.GrowArray;
Expand Down Expand Up @@ -56,7 +56,7 @@ public static DMatrixSparseCSC mult( DMatrixSparseCSC A, DMatrixSparseCSC B, @Nu
throw new MatrixDimensionException("Inconsistent matrix shapes. " + stringShapes(A, B));
outputC = reshapeOrDeclare(outputC, A, A.numRows, B.numCols);

ImplSparseSparseMult_MT_DSCC.mult(A, B, outputC, listWork);
ImplMultiplication_MT_DSCC.mult(A, B, outputC, listWork);

return outputC;
}
Expand Down Expand Up @@ -98,7 +98,7 @@ public static DMatrixRMaj mult( DMatrixSparseCSC A, DMatrixRMaj B, @Nullable DMa
throw new MatrixDimensionException("Inconsistent matrix shapes. " + stringShapes(A, B));
outputC = reshapeOrDeclare(outputC, A.numRows, B.numCols);

ImplSparseSparseMult_MT_DSCC.mult(A, B, outputC, listWork);
ImplMultiplication_MT_DSCC.mult(A, B, outputC, listWork);

return outputC;
}
Expand All @@ -113,7 +113,7 @@ public static void multAdd( DMatrixSparseCSC A, DMatrixRMaj B, DMatrixRMaj outpu
if (A.numRows != outputC.numRows || B.numCols != outputC.numCols)
throw new MatrixDimensionException("Inconsistent matrix shapes. " + stringShapes(A, B, outputC));

ImplSparseSparseMult_MT_DSCC.multAdd(A, B, outputC, listWork);
ImplMultiplication_MT_DSCC.multAdd(A, B, outputC, listWork);
}

/**
Expand All @@ -129,7 +129,7 @@ public static DMatrixRMaj multTransA( DMatrixSparseCSC A, DMatrixRMaj B, @Nullab

outputC = reshapeOrDeclare(outputC, A.numCols, B.numCols);

ImplSparseSparseMult_MT_DSCC.multTransA(A, B, outputC);
ImplMultiplication_MT_DSCC.multTransA(A, B, outputC);

return outputC;
}
Expand All @@ -143,7 +143,7 @@ public static void multAddTransA( DMatrixSparseCSC A, DMatrixRMaj B, DMatrixRMaj
if (A.numCols != outputC.numRows || B.numCols != outputC.numCols)
throw new MatrixDimensionException("Inconsistent matrix shapes. " + stringShapes(A, B, outputC));

ImplSparseSparseMult_MT_DSCC.multAddTransA(A, B, outputC);
ImplMultiplication_MT_DSCC.multAddTransA(A, B, outputC);
}

/**
Expand All @@ -159,7 +159,7 @@ public static DMatrixRMaj multTransB( DMatrixSparseCSC A, DMatrixRMaj B, @Nullab
throw new MatrixDimensionException("Inconsistent matrix shapes. " + stringShapes(A, B));
outputC = reshapeOrDeclare(outputC, A.numRows, B.numRows);

ImplSparseSparseMult_MT_DSCC.multTransB(A, B, outputC, listWork);
ImplMultiplication_MT_DSCC.multTransB(A, B, outputC, listWork);

return outputC;
}
Expand All @@ -174,6 +174,6 @@ public static void multAddTransB( DMatrixSparseCSC A, DMatrixRMaj B, DMatrixRMaj
if (A.numRows != outputC.numRows || B.numRows != outputC.numCols)
throw new MatrixDimensionException("Inconsistent matrix shapes. " + stringShapes(A, B, outputC));

ImplSparseSparseMult_MT_DSCC.multAddTransB(A, B, outputC, listWork);
ImplMultiplication_MT_DSCC.multAddTransB(A, B, outputC, listWork);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2020, Peter Abeles. All Rights Reserved.
* Copyright (c) 2020, Peter Abeles. All Rights Reserved.
*
* This file is part of Efficient Java Matrix Library (EJML).
*
Expand Down Expand Up @@ -27,7 +27,7 @@
import org.ejml.sparse.ComputePermutation;
import org.ejml.sparse.csc.CommonOps_DSCC;
import org.ejml.sparse.csc.misc.ApplyFillReductionPermutation_DSCC;
import org.ejml.sparse.csc.mult.ImplSparseSparseMult_DSCC;
import org.ejml.sparse.csc.mult.ImplMultiplication_DSCC;
import org.jetbrains.annotations.Nullable;

import java.util.Arrays;
Expand Down Expand Up @@ -150,7 +150,7 @@ private void performDecomposition( DMatrixSparseCSC A ) {
R.nz_values[R.nz_length++] = x[i];
x[i] = 0;
if (parent[i] == k) {
ImplSparseSparseMult_DSCC.addRowsInAInToC(V, i, V, k, w);
ImplMultiplication_DSCC.addRowsInAInToC(V, i, V, k, w);
}
}
for (int p = p1; p < V.nz_length; p++) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2020, Peter Abeles. All Rights Reserved.
* Copyright (c) 2020, Peter Abeles. All Rights Reserved.
*
* This file is part of Efficient Java Matrix Library (EJML).
*
Expand Down Expand Up @@ -27,7 +27,7 @@
import java.util.Arrays;

import static org.ejml.UtilEjml.adjust;
import static org.ejml.sparse.csc.mult.ImplSparseSparseMultWithSemiRing_DSCC.multAddColA;
import static org.ejml.sparse.csc.mult.ImplMultiplicationWithSemiRing_DSCC.multAddColA;

/**
* based on ImplCommonOps_DSCC
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2020, Peter Abeles. All Rights Reserved.
* Copyright (c) 2020, Peter Abeles. All Rights Reserved.
*
* This file is part of Efficient Java Matrix Library (EJML).
*
Expand Down Expand Up @@ -28,7 +28,7 @@
import java.util.Arrays;

import static org.ejml.UtilEjml.adjust;
import static org.ejml.sparse.csc.mult.ImplSparseSparseMult_DSCC.multAddColA;
import static org.ejml.sparse.csc.mult.ImplMultiplication_DSCC.multAddColA;

/**
* Implementation class. Not recommended for direct use. Instead use {@link CommonOps_DSCC}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
import pabeles.concurrency.GrowArray;

import static org.ejml.UtilEjml.adjust;
import static org.ejml.sparse.csc.mult.ImplSparseSparseMult_DSCC.multAddColA;
import static org.ejml.sparse.csc.mult.ImplSparseSparseMult_MT_DSCC.stitchMatrix;
import static org.ejml.sparse.csc.mult.ImplMultiplication_DSCC.multAddColA;
import static org.ejml.sparse.csc.mult.ImplMultiplication_MT_DSCC.stitchMatrix;

/**
* Concurrent implementations of {@link ImplCommonOps_DSCC}.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2020, Peter Abeles. All Rights Reserved.
* Copyright (c) 2020, Peter Abeles. All Rights Reserved.
*
* This file is part of Efficient Java Matrix Library (EJML).
*
Expand Down Expand Up @@ -30,7 +30,7 @@
/**
* based on ImplSparseSparseGraphMult_DSCC
*/
public class ImplSparseSparseMultWithSemiRing_DSCC {
public class ImplMultiplicationWithSemiRing_DSCC {

/**
* Performs matrix multiplication. C = A*B
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2020, Peter Abeles. All Rights Reserved.
* Copyright (c) 2020, Peter Abeles. All Rights Reserved.
*
* This file is part of Efficient Java Matrix Library (EJML).
*
Expand Down Expand Up @@ -31,7 +31,7 @@
/**
* @author Peter Abeles
*/
public class ImplSparseSparseMult_DSCC {
public class ImplMultiplication_DSCC {

/**
* Performs matrix multiplication. C = A*B
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@
import java.util.Arrays;

import static org.ejml.UtilEjml.adjust;
import static org.ejml.sparse.csc.mult.ImplSparseSparseMult_DSCC.multAddColA;
import static org.ejml.sparse.csc.mult.ImplMultiplication_DSCC.multAddColA;

/**
* Concurrent matrix multiplication for DSCC matrices.
*
* @author Peter Abeles
*/
public class ImplSparseSparseMult_MT_DSCC {
public class ImplMultiplication_MT_DSCC {
/**
* Performs matrix multiplication. C = A*B. The problem is broken up into as many "blocks" as there are threads
* available. Each block will process a set of columns independently. After running results from independent
Expand Down
Loading

0 comments on commit 09db214

Please sign in to comment.