src/main/java/org/apache/sysds/runtime/compress/colgroup/ColGroupFactory.java
/**
	 * 
	 * Method for producing the final ColGroupList stored inside the CompressedMatrixBlock.
	 * 
	 * TODO Redesign this method such that it does not utilize the null pointers to decide on which ColGroups should be
	 * incompressable. This is done by changing both this method and compressColGroup inside this class.
	 * 
	 * @param numCols      The number of columns in input matrix
	 * @param colGroups    The colgroups made to assign
	 * @param rawBlock     The (maybe transposed) original MatrixBlock
	 * @param compSettings The Compressionsettings used.
	 * @return return the final ColGroupList.
	 */
Method for producing the final ColGroupList stored inside the CompressedMatrixBlock.



@param numCols      The number of columns in input matrix
@param colGroups    The colgroups made to assign
@param rawBlock     The (maybe transposed) original MatrixBlock
@param compSettings The Compressionsettings used.
@return return the final ColGroupList.
Method for producing the final ColGroupList stored inside the CompressedMatrixBlock . @param numCols The number of columns in input matrix @param colGroups The colgroups made to assign @param rawBlock The ( maybe transposed ) original MatrixBlock @param compSettings The Compressionsettings used . @return return the final ColGroupList .
public static List<ColGroup> assignColumns(int numCols, ColGroup[] colGroups, MatrixBlock rawBlock,
		CompressionSettings compSettings) {
		List<ColGroup> _colGroups = new ArrayList<>();
		HashSet<Integer> remainingCols = seq(0, numCols - 1, 1);
		for(int j = 0; j < colGroups.length; j++) {
			if(colGroups[j] != null) {
				for(int col : colGroups[j].getColIndices())
					remainingCols.remove(col);
				_colGroups.add(colGroups[j]);
			}
		}
		if(!remainingCols.isEmpty()) {
			int[] list = remainingCols.stream().mapToInt(i -> i).toArray();
			ColGroupUncompressed ucgroup = new ColGroupUncompressed(list, rawBlock, compSettings);
			_colGroups.add(ucgroup);
		}
		return _colGroups;
	}
public static List < ColGroup > assignColumns ( int numCols , ColGroup [ ] colGroups , MatrixBlock rawBlock , CompressionSettings compSettings ) { List < ColGroup > _colGroups = new ArrayList < > ( ) ; HashSet < Integer > remainingCols = seq ( 0 , numCols - 1 , 1 ) ; for ( int j = 0 ; j < colGroups . length ; j ++ ) { if ( colGroups [ j ] != null ) { for ( int col : colGroups [ j ] . getColIndices ( ) ) remainingCols . remove ( col ) ; _colGroups . add ( colGroups [ j ] ) ; } } if ( ! remainingCols . isEmpty ( ) ) { int [ ] list = remainingCols . stream ( ) . mapToInt ( i -> i ) . toArray ( ) ; ColGroupUncompressed ucgroup = new ColGroupUncompressed ( list , rawBlock , compSettings ) ; _colGroups . add ( ucgroup ) ; } return _colGroups ; }
Method for producing the final ColGroupList stored inside the CompressedMatrixBlock.
Method for producing the final ColGroupList stored inside the CompressedMatrixBlock .