Skip to content

Commit 312fab6

Browse files
committed
docs
1 parent 6a57fd0 commit 312fab6

File tree

4 files changed

+25
-4
lines changed

4 files changed

+25
-4
lines changed

src/main/java/org/apache/sysds/runtime/frame/data/columns/ACompressedArray.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,11 @@ public void setM(Map<T, Integer> map, AMapToData m, int i) {
159159
throw new NotImplementedException();
160160
}
161161

162+
@Override
163+
public void setM(Map<T, Integer> map, int si, AMapToData m, int i) {
164+
throw new NotImplementedException();
165+
}
166+
162167
@Override
163168
protected void mergeRecodeMaps(Map<T, Integer> target, Map<T, Integer> from) {
164169
throw new DMLCompressionException("Invalid to change sub compressed array");

src/main/java/org/apache/sysds/runtime/frame/data/columns/Array.java

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public synchronized final Map<T, Integer> getRecodeMap(int estimate) {
103103
* column.
104104
*
105105
* @param estimate the estimated number of unique.
106-
* @param pool An executor pool to be used for parallel execution
106+
* @param pool An executor pool to be used for parallel execution
107107
* @return A recode map
108108
*/
109109
public synchronized final Map<T, Integer> getRecodeMap(int estimate, ExecutorService pool) {
@@ -986,10 +986,27 @@ public double[] minMax(int l, int u) {
986986
return new double[] {min, max};
987987
}
988988

989+
/**
990+
* Set the index i in the map given based on the mapping provided. The map should be guaranteed to contain all unique
991+
* values.
992+
*
993+
* @param map Map containing all unique values of this array
994+
* @param m The array mapping to set the value part of the Map<T,Integer> from
995+
* @param i The index to set in m
996+
*/
989997
public void setM(Map<T, Integer> map, AMapToData m, int i) {
990998
m.set(i, map.get(getInternal(i)).intValue() - 1);
991999
}
9921000

1001+
/**
1002+
* Set the index i in the map given based on the mapping provided. The map should be guaranteed to contain all unique
1003+
* values except null. Therefore in case of null we set the provided si value.
1004+
*
1005+
* @param map Map containing all unique values of this array
1006+
* @param si The default value to use in m if this Array contains null at index i
1007+
* @param m The array mapping to set the value part of the Map<T,Integer> from
1008+
* @param i The index to set in m
1009+
*/
9931010
public void setM(Map<T, Integer> map, int si, AMapToData m, int i) {
9941011
try {
9951012
final T v = getInternal(i);

src/main/java/org/apache/sysds/runtime/transform/encode/CompressedEncode.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ private <T> AMapToData createMappingAMapToData(Array<T> a, Map<T, Integer> map,
448448
if(containsNull)
449449
return createMappingAMapToDataWithNull(a, map, si, m, start, end);
450450
else
451-
return createMappingAMapToDataNoNull(a, map, si, m, start, end);
451+
return createMappingAMapToDataNoNull(a, map, m, start, end);
452452

453453
}));
454454

@@ -459,7 +459,7 @@ private <T> AMapToData createMappingAMapToData(Array<T> a, Map<T, Integer> map,
459459
return m;
460460
}
461461

462-
private static <T> AMapToData createMappingAMapToDataNoNull(Array<T> a, Map<T, Integer> map, int si, AMapToData m,
462+
private static <T> AMapToData createMappingAMapToDataNoNull(Array<T> a, Map<T, Integer> map, AMapToData m,
463463
int start, int end) {
464464
for(int i = start; i < end; i++)
465465
a.setM(map, m, i);

src/main/java/org/apache/sysds/runtime/transform/encode/MultiColumnEncoder.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,6 @@ private static ArrayList<int[]> outputMatrixPreProcessing(MatrixBlock output, Ca
714714
}
715715
}
716716
else { // csr
717-
final int size = (int) nnz;
718717
// Manually fill the row pointers based on nnzs/row (= #cols in the input)
719718
// Not using the set() methods to 1) avoid binary search and shifting,
720719
// 2) reduce thread contentions on the arrays

0 commit comments

Comments
 (0)