Return-Path: X-Original-To: apmail-mahout-dev-archive@www.apache.org Delivered-To: apmail-mahout-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7A2B511651 for ; Wed, 30 Jul 2014 00:32:39 +0000 (UTC) Received: (qmail 98511 invoked by uid 500); 30 Jul 2014 00:32:38 -0000 Delivered-To: apmail-mahout-dev-archive@mahout.apache.org Received: (qmail 98419 invoked by uid 500); 30 Jul 2014 00:32:38 -0000 Mailing-List: contact dev-help@mahout.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@mahout.apache.org Delivered-To: mailing list dev@mahout.apache.org Received: (qmail 98154 invoked by uid 99); 30 Jul 2014 00:32:38 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Jul 2014 00:32:38 +0000 Date: Wed, 30 Jul 2014 00:32:38 +0000 (UTC) From: "Dmitriy Lyubimov (JIRA)" To: dev@mahout.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (MAHOUT-1599) Add rand() operator to math-scala MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/MAHOUT-1599?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D140= 78693#comment-14078693 ]=20 Dmitriy Lyubimov commented on MAHOUT-1599: ------------------------------------------ ah.sorry. there's no nonZero iterator on matrices, it seems, only on vector= s. So one of (not very efficient) corrections for the above i know of would= be=20 > Add rand() operator to math-scala > --------------------------------- > > Key: MAHOUT-1599 > URL: https://issues.apache.org/jira/browse/MAHOUT-1599 > Project: Mahout > Issue Type: Improvement > Components: Math > Affects Versions: 0.9 > Reporter: Felix Sch=C3=BCler > Priority: Trivial > Labels: dsl, math, operator, random, scala > Attachments: MAHOUT-1599.patch > > > I was looking at the scala-math operators and missed a rand(m, n) operato= r that generates a m x n matrix filled with random numbers. > I wanted random numbers from a uniform distribution over a specific inter= val so I implemented a simple uniform random number generator. > the rand(m, n, r) function takes any AbstractSamplerFunction and fills th= e matrix entries with the numbers generated by its sample() method. -- This message was sent by Atlassian JIRA (v6.2#6252)