ichbinstudent commented on code in PR #2186:
URL: https://github.com/apache/systemds/pull/2186#discussion_r1929771339


##########
src/main/java/org/apache/sysds/runtime/matrix/data/LibMatrixDatagen.java:
##########
@@ -590,13 +602,26 @@ private static void genDense(MatrixBlock out, int clen, 
int blockrows, int block
        }
        
        private static void genFullyDense(DenseBlock c, int blockrows, int 
blockcols, int rowoffset, int coloffset, 
-               double min, double range, PRNGenerator valuePRNG)
+               double min, double range, IPRNGenerator valuePRNG, long[] ctr)
        {
-               for(int i = rowoffset; i < rowoffset+blockrows; i++) {
-                       double[] cvals = c.values(i);
-                       int cix = c.pos(i, coloffset);
-                       for(int j = 0; j < blockcols; j++)
-                               cvals[cix+j] = min + (range * 
valuePRNG.nextDouble());
+               if (valuePRNG instanceof PRNGenerator) {
+                       for(int i = rowoffset; i < rowoffset+blockrows; i++) {

Review Comment:
   I changed it to a solution using iterators. This removes the duplicate code. 
What do you think?



-- 
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