src/main/java/org/apache/sysds/runtime/compress/lib/LibRightMultBy.java
/**
	 * Right multiply by matrix. Meaning a left hand side compressed matrix is multiplied with a right hand side
	 * uncompressed matrix.
	 * 
	 * @param colGroups	All Column groups in the compression
	 * @param that		 The right hand side matrix
	 * @param ret		  The MatrixBlock to return.
	 * @param k			The parallelization degree to use.
	 * @param v			The Precalculated counts and Maximum number of tuple entries in the column groups.
	 * @param allowOverlap Allow the multiplication to return an overlapped matrix.
	 * @return The Result Matrix, modified from the ret parameter.
	 */
Right multiply by matrix. Meaning a left hand side compressed matrix is multiplied with a right hand side
uncompressed matrix.

@param colGroups     All Column groups in the compression
@param that           The right hand side matrix
@param ret             The MatrixBlock to return.
@param k                     The parallelization degree to use.
@param v                     The Precalculated counts and Maximum number of tuple entries in the column groups.
@param allowOverlap Allow the multiplication to return an overlapped matrix.
@return The Result Matrix, modified from the ret parameter.
Right multiply by matrix . Meaning a left hand side compressed matrix is multiplied with a right hand side uncompressed matrix . @param colGroups All Column groups in the compression @param that The right hand side matrix @param ret The MatrixBlock to return . @param k The parallelization degree to use . @param v The Precalculated counts and Maximum number of tuple entries in the column groups . @param allowOverlap Allow the multiplication to return an overlapped matrix . @return The Result Matrix modified from the ret parameter .
public static MatrixBlock rightMultByMatrix(List<ColGroup> colGroups, MatrixBlock that, MatrixBlock ret, int k,
		Pair<Integer, int[]> v, boolean allowOverlap) {
		if(that instanceof CompressedMatrixBlock){
			LOG.info("Decompression Right matrix");
		}
		that = that instanceof CompressedMatrixBlock ? ((CompressedMatrixBlock) that).decompress() : that;
		boolean containsUncompressable = false;
		int distinctCount = 0;
		for(ColGroup g : colGroups) {
			if(g instanceof ColGroupValue) {
				distinctCount += ((ColGroupValue) g).getNumValues();
			}
			else {
				containsUncompressable = true;
			}
		}
		int rl = colGroups.get(0).getNumRows();
		int cl = that.getNumColumns();
		if(!allowOverlap || (containsUncompressable || distinctCount >= rl )) {
			if(ret == null)
				ret = new MatrixBlock(rl, cl, false, rl * cl);
			else if(!(ret.getNumColumns() == cl && ret.getNumRows() == rl && ret.isAllocated()))
				ret.reset(rl, cl, false, rl * cl);
			ret.allocateDenseBlock();
			if(that.isInSparseFormat()) {
				ret = rightMultBySparseMatrix(colGroups, that, ret, k, v);
			}
			else {
				ret = rightMultByDenseMatrix(colGroups, that, ret, k, v);
			}
			ret.setNonZeros(ret.getNumColumns() * ret.getNumRows());
		}
		else {
			ret = new CompressedMatrixBlock(true);
			ret.setNumColumns(cl);
			ret.setNumRows(rl);
			CompressedMatrixBlock retC = (CompressedMatrixBlock) ret;
			retC.setOverlapping(true);
			if(that.isInSparseFormat()) {
				ret = rightMultBySparseMatrixCompressed(colGroups, that, retC, k, v);
			}
			else {
				ret = rightMultByDenseMatrixCompressed(colGroups, that, retC, k, v);
			}
		}
		return ret;
	}
public static MatrixBlock rightMultByMatrix ( List < ColGroup > colGroups , MatrixBlock that , MatrixBlock ret , int k , Pair < Integer , int [ ] > v , boolean allowOverlap ) { if ( that instanceof CompressedMatrixBlock ) { LOG . info ( "Decompression Right matrix" ) ; } that = that instanceof CompressedMatrixBlock ? ( ( CompressedMatrixBlock ) that ) . decompress ( ) : that ; boolean containsUncompressable = false ; int distinctCount = 0 ; for ( ColGroup g : colGroups ) { if ( g instanceof ColGroupValue ) { distinctCount += ( ( ColGroupValue ) g ) . getNumValues ( ) ; } else { containsUncompressable = true ; } } int rl = colGroups . get ( 0 ) . getNumRows ( ) ; int cl = that . getNumColumns ( ) ; if ( ! allowOverlap || ( containsUncompressable || distinctCount >= rl ) ) { if ( ret == null ) ret = new MatrixBlock ( rl , cl , false , rl * cl ) ; else if ( ! ( ret . getNumColumns ( ) == cl && ret . getNumRows ( ) == rl && ret . isAllocated ( ) ) ) ret . reset ( rl , cl , false , rl * cl ) ; ret . allocateDenseBlock ( ) ; if ( that . isInSparseFormat ( ) ) { ret = rightMultBySparseMatrix ( colGroups , that , ret , k , v ) ; } else { ret = rightMultByDenseMatrix ( colGroups , that , ret , k , v ) ; } ret . setNonZeros ( ret . getNumColumns ( ) * ret . getNumRows ( ) ) ; } else { ret = new CompressedMatrixBlock ( true ) ; ret . setNumColumns ( cl ) ; ret . setNumRows ( rl ) ; CompressedMatrixBlock retC = ( CompressedMatrixBlock ) ret ; retC . setOverlapping ( true ) ; if ( that . isInSparseFormat ( ) ) { ret = rightMultBySparseMatrixCompressed ( colGroups , that , retC , k , v ) ; } else { ret = rightMultByDenseMatrixCompressed ( colGroups , that , retC , k , v ) ; } } return ret ; }
Right multiply by matrix.
Right multiply by matrix .
// Create an overlapping compressed Matrix Block.