vlad-ponomarenko commented on code in PR #1833:
URL: https://github.com/apache/systemds/pull/1833#discussion_r1210743449


##########
src/main/java/org/apache/sysds/runtime/compress/colgroup/ColGroupDeltaDDC.java:
##########
@@ -19,11 +19,271 @@
 
 package org.apache.sysds.runtime.compress.colgroup;
 
+
+import org.apache.commons.lang.NotImplementedException;
+import org.apache.sysds.runtime.compress.colgroup.dictionary.ADictionary;
+import org.apache.sysds.runtime.compress.colgroup.dictionary.DeltaDictionary;
+import org.apache.sysds.runtime.compress.colgroup.indexes.IColIndex;
+import org.apache.sysds.runtime.compress.colgroup.mapping.AMapToData;
+import org.apache.sysds.runtime.compress.colgroup.scheme.ICLAScheme;
+import org.apache.sysds.runtime.compress.cost.ComputationCostEstimator;
+import org.apache.sysds.runtime.data.DenseBlock;
+import org.apache.sysds.runtime.data.SparseBlock;
+import org.apache.sysds.runtime.functionobjects.Builtin;
+import org.apache.sysds.runtime.instructions.cp.CM_COV_Object;
+import org.apache.sysds.runtime.matrix.data.MatrixBlock;
+import org.apache.sysds.runtime.matrix.operators.BinaryOperator;
+import org.apache.sysds.runtime.matrix.operators.CMOperator;
+import org.apache.sysds.runtime.matrix.operators.ScalarOperator;
+import org.apache.sysds.runtime.matrix.operators.UnaryOperator;
+
 /**
  * Class to encapsulate information about a column group that is first delta 
encoded then encoded with dense dictionary
  * encoding (DeltaDDC).
  */
-public class ColGroupDeltaDDC  { // extends ColGroupDDC
+public class ColGroupDeltaDDC extends AColGroupCompressed implements 
AMapToDataGroup  {
+
+    private static final long serialVersionUID = -1045556313148564147L;
+    private AMapToData _data;
+    private DeltaDictionary _dict;
+    //TODO Confirm if casting from ADictionary to DeltaDictionary is reasonable
+    private ColGroupDeltaDDC(IColIndex colIndexes, ADictionary dict, 
AMapToData data) {
+        super(colIndexes);
+        _data = data;
+        _dict = (DeltaDictionary) dict;
+    }
+
+    //TODO Confirm if other parameters for constructors are required, such as 
cachedCounts
+    public static AColGroup create(IColIndex colIndexes, ADictionary dict, 
AMapToData data) {
+        if(data.getUnique() == 1)
+            return ColGroupConst.create(colIndexes, dict);
+        else if(dict == null)
+            return new ColGroupEmpty(colIndexes);

Review Comment:
   Should I also considerer a case where every element in a column is the same? 
In a column (-3,-3,-3,-3), the first delta would  be -3 and all other deltas 0. 
In that case I would check if the first delta value is 0 and all other deltas 
are the same, then it would be possible to create a constant column group? Or 
have I misunderstunt the definition of a constant column group? 
   
    if (dict.getValues().length == 1 && dict.getValue(0)==0), that would 
represent not an empty Matrix, but a Matrix that only contains zeros, 
therefore, my recent code is invalid I suppose. 
   
   The definition of an empty matrix in this context is a matrix with only 
zeroes or is it a matrix with at least one dimension that is equal to zero? 
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@systemds.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to