[ https://issues.apache.org/jira/browse/MAHOUT1599?page=com.atlassian.jira.plugin.system.issuetabpanels:commenttabpanel&focusedCommentId=14078693#comment14078693
]
Dmitriy Lyubimov edited comment on MAHOUT1599 at 7/30/14 12:32 AM:

ah.sorry. there's no nonZero iterator on matrices, it seems, only on vectors. So one of (not
very efficient) corrections for the above i know of would be
{code}
for (row < m; el < row.nonZero) el = 5.0 + el
{code}
was (Author: dlyubimov):
ah.sorry. there's no nonZero iterator on matrices, it seems, only on vectors. So one of (not
very efficient) corrections for the above i know of would be
> Add rand() operator to mathscala
> 
>
> Key: MAHOUT1599
> URL: https://issues.apache.org/jira/browse/MAHOUT1599
> Project: Mahout
> Issue Type: Improvement
> Components: Math
> Affects Versions: 0.9
> Reporter: Felix SchÃ¼ler
> Priority: Trivial
> Labels: dsl, math, operator, random, scala
> Attachments: MAHOUT1599.patch
>
>
> I was looking at the scalamath operators and missed a rand(m, n) operator that generates
a m x n matrix filled with random numbers.
> I wanted random numbers from a uniform distribution over a specific interval so I implemented
a simple uniform random number generator.
> the rand(m, n, r) function takes any AbstractSamplerFunction and fills the matrix entries
with the numbers generated by its sample() method.

This message was sent by Atlassian JIRA
(v6.2#6252)
