This is an automated email from the ASF dual-hosted git repository.

baunsgaard pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/systemds.git


The following commit(s) were added to refs/heads/main by this push:
     new bee4232d3f [MINOR] avoid counting non-zeros in sequence datagen
bee4232d3f is described below

commit bee4232d3f65b5dca5cebc81db7fc4b86a61641c
Author: Sebastian Baunsgaard <baunsga...@apache.org>
AuthorDate: Wed Aug 14 12:07:17 2024 +0200

    [MINOR] avoid counting non-zeros in sequence datagen
---
 .../org/apache/sysds/runtime/matrix/data/LibMatrixDatagen.java     | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git 
a/src/main/java/org/apache/sysds/runtime/matrix/data/LibMatrixDatagen.java 
b/src/main/java/org/apache/sysds/runtime/matrix/data/LibMatrixDatagen.java
index 18e6b8f0de..c934ca02ad 100644
--- a/src/main/java/org/apache/sysds/runtime/matrix/data/LibMatrixDatagen.java
+++ b/src/main/java/org/apache/sysds/runtime/matrix/data/LibMatrixDatagen.java
@@ -373,7 +373,12 @@ public class LibMatrixDatagen
                        cur += incr;
                }
                
-               out.recomputeNonZeros();
+               if((incr > 0 && from > 0) || (incr < 0 && from < 0))
+                       out.nonZeros = rows;
+               else if(from == 0 && incr != 0)
+                       out.nonZeros = rows - 1;
+               else
+                       out.recomputeNonZeros();
        }
 
        /**

Reply via email to