You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@systemml.apache.org by na...@apache.org on 2017/08/09 05:08:15 UTC
systemml git commit: [SYSTEMML-1816] toString does not print negative
0s anymore
Repository: systemml
Updated Branches:
refs/heads/master e1a762f65 -> 5906682b0
[SYSTEMML-1816] toString does not print negative 0s anymore
Closes #599
Project: http://git-wip-us.apache.org/repos/asf/systemml/repo
Commit: http://git-wip-us.apache.org/repos/asf/systemml/commit/5906682b
Tree: http://git-wip-us.apache.org/repos/asf/systemml/tree/5906682b
Diff: http://git-wip-us.apache.org/repos/asf/systemml/diff/5906682b
Branch: refs/heads/master
Commit: 5906682b0f328a8179c66f960cedb6e68fb8a0e1
Parents: e1a762f
Author: Nakul Jindal <na...@gmail.com>
Authored: Fri Jul 28 17:07:46 2017 -0700
Committer: Nakul Jindal <na...@gmail.com>
Committed: Tue Aug 8 22:06:51 2017 -0700
----------------------------------------------------------------------
.../java/org/apache/sysml/runtime/util/DataConverter.java | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/systemml/blob/5906682b/src/main/java/org/apache/sysml/runtime/util/DataConverter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/util/DataConverter.java b/src/main/java/org/apache/sysml/runtime/util/DataConverter.java
index 10f043b..a758b4d 100644
--- a/src/main/java/org/apache/sysml/runtime/util/DataConverter.java
+++ b/src/main/java/org/apache/sysml/runtime/util/DataConverter.java
@@ -862,11 +862,15 @@ public class DataConverter
else { // Dense Print Format
for (int i=0; i<rowLength; i++){
for (int j=0; j<colLength-1; j++){
- double value = mb.quickGetValue(i, j);
+ Double value = mb.quickGetValue(i, j);
+ if (value.equals(-0.0d))
+ value = 0.0;
sb.append(dfFormat(df, value));
sb.append(separator);
}
- double value = mb.quickGetValue(i, colLength-1);
+ Double value = mb.quickGetValue(i, colLength-1);
+ if (value.equals(-0.0d))
+ value = 0.0;
sb.append(dfFormat(df, value)); // Do not put separator after last element
sb.append(lineseparator);
}