Skip to content

Commit ecf7873

Browse files
committed
[skip ci] reverts
1 parent fbcbbb7 commit ecf7873

File tree

7 files changed

+14
-25
lines changed

7 files changed

+14
-25
lines changed

src/main/java/org/apache/sysds/runtime/matrix/operators/ScalarOperator.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,4 @@ protected static boolean isSparseSafeStatic(ValueFunction fn) {
9393
|| fn instanceof Builtin && ((Builtin)fn).getBuiltinCode()==BuiltinCode.LOG_NZ)
9494
|| fn instanceof BitwShiftL || fn instanceof BitwShiftR;
9595
}
96-
97-
@Override
98-
public String toString(){
99-
StringBuilder sb = new StringBuilder();
100-
sb.append(this.getClass().getSimpleName());
101-
sb.append(" ");
102-
sb.append(fn);
103-
sb.append(" Value: ");
104-
sb.append(_constant);
105-
return sb.toString();
106-
}
10796
}

src/main/java/org/apache/sysds/runtime/util/DataConverter.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -880,10 +880,7 @@ private static String dfFormat(DecimalFormat df, double value) {
880880
if (Double.isNaN(value) || Double.isInfinite(value)){
881881
return Double.toString(value);
882882
} else {
883-
if(value == (long) value)
884-
return Long.toString(((long)(value)));
885-
else
886-
return df.format(value);
883+
return df.format(value);
887884
}
888885
}
889886

@@ -1131,7 +1128,7 @@ public static String toString(FrameBlock fb, boolean sparse, String separator, S
11311128
sb.append("nrow = " + fb.getNumRows() + ", ");
11321129
sb.append("ncol = " + fb.getNumColumns() + lineseparator);
11331130

1134-
// print column names
1131+
//print column names
11351132
sb.append("#"); sb.append(separator);
11361133
for( int j=0; j<colLength; j++ ) {
11371134
sb.append(fb.getColumnNames()[j]);

src/main/java/org/apache/sysds/runtime/util/HDFSTool.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,15 @@ public static String metaDataToString(ValueType vt, ValueType[] schema, DataType
524524

525525
return mtd.toString(4); // indent with 4 spaces
526526
}
527+
528+
public static double[][] readMatrixFromHDFS(String dir, FileFormat fmt, long rlen, long clen, int blen)
529+
throws IOException, DMLRuntimeException
530+
{
531+
MatrixReader reader = MatrixReaderFactory.createMatrixReader(fmt);
532+
long estnnz = (rlen <= 0 || clen <= 0) ? -1 : rlen * clen;
533+
MatrixBlock mb = reader.readMatrixFromHDFS(dir, rlen, clen, blen, estnnz);
534+
return DataConverter.convertToDoubleMatrix(mb);
535+
}
527536

528537
public static double[] readColumnVectorFromHDFS(String dir, FileFormat fmt, long rlen, long clen, int blen)
529538
throws IOException, DMLRuntimeException

src/test/java/org/apache/sysds/test/component/compress/TestBase.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import org.apache.sysds.runtime.compress.CompressionSettings;
2929
import org.apache.sysds.runtime.compress.CompressionSettingsBuilder;
3030
import org.apache.sysds.runtime.compress.colgroup.AColGroup.CompressionType;
31-
import org.apache.sysds.runtime.compress.lib.CLALibReshape;
3231
import org.apache.sysds.runtime.matrix.data.MatrixBlock;
3332
import org.apache.sysds.test.TestUtils;
3433
import org.apache.sysds.test.component.compress.TestConstants.MatrixTypology;
@@ -58,10 +57,6 @@ public class TestBase {
5857
// Input
5958
protected MatrixBlock mb;
6059

61-
static {
62-
CLALibReshape.COMPRESSED_RESHAPE_THRESHOLD = 10;
63-
}
64-
6560
public TestBase(SparsityType sparType, ValueType valType, ValueRange valueRange,
6661
CompressionSettingsBuilder compressionSettings, MatrixTypology MatrixTypology, OverLapping ov,
6762
Collection<CompressionType> ct) {
@@ -103,8 +98,8 @@ public TestBase(SparsityType sparType, ValueType valType, ValueRange valueRange,
10398
Math.min((max - min), 10), max, min, sparsity, seed, false);
10499
break;
105100
case UNBALANCED_SPARSE:
106-
mb = CompressibleInputGenerator.getUnbalancedSparseMatrix(rows, cols, Math.min((max - min), 10), max,
107-
min, seed);
101+
mb = CompressibleInputGenerator.getUnbalancedSparseMatrix(rows, cols, Math.min((max - min), 10),
102+
max, min, seed);
108103
cols = mb.getNumColumns();
109104
break;
110105
case ONE_HOT:

src/test/java/org/apache/sysds/test/component/compress/dictionary/CombineTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ public void twoBothSidesFilter() {
176176
IDictionary b = Dictionary.create(new double[] {1.4, 1.5});
177177
HashMapLongInt filter = new HashMapLongInt(3);
178178
filter.putIfAbsent(0, 0);
179+
179180
IDictionary c = DictionaryFactory.combineFullDictionaries(a, 1, b, 1, filter);
180181

181182
assertEquals(1, c.getNumberOfValues(2));

src/test/java/org/apache/sysds/test/component/compress/util/CountTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ public void sort1() {
4242

4343
try {
4444
DCounts hs = h.sort();
45-
4645
assertEquals(4, hs.count);
4746
}
4847
catch(Exception e) {

src/test/java/org/apache/sysds/test/component/frame/array/FrameArrayTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2577,7 +2577,6 @@ public static String[] generateRandomHash32OptNUnique(int size, int seed, int nU
25772577
return ret;
25782578
}
25792579

2580-
25812580
public static Character[] generateRandomCharacterNUniqueLengthOpt(int size, int seed, int nUnique) {
25822581
Character[] rands = generateRandomCharacterOpt(nUnique, seed);
25832582

0 commit comments

Comments
 (0)