[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #45461] binornd inefficient, patch attached
From: |
anonymous |
Subject: |
[Octave-bug-tracker] [bug #45461] binornd inefficient, patch attached |
Date: |
Thu, 02 Jul 2015 11:55:20 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:23.0) Gecko/20100101 Firefox/23.0 |
URL:
<http://savannah.gnu.org/bugs/?45461>
Summary: binornd inefficient, patch attached
Project: GNU Octave
Submitted by: None
Submitted on: Thu 02 Jul 2015 11:55:19 AM UTC
Category: Octave Function
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Performance
Status: None
Assigned to: None
Originator Name: Michael Leitner
Originator Email: address@hidden
Open/Closed: Open
Discussion Lock: Any
Release: dev
Operating System: Any
_______________________________________________________
Details:
The present implementation of binornd is very inefficient. For non-scalar N it
computes max(N(:))*numel(N) random values (and uses memory on the same order
of magnitude). The attached patch uses only sum(N(:)) random values. Of
course, the algorithm is still inefficient (one could work via the cdf), but
for a range of use cases it is perfectly usable in contrast to the old
implementation.
Demonstration:
N=ones(10000,1);N(1)=10000;
tic;binornd(N,.5);toc
takes 2.4 s for the old and 0.008 s for the new one.
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Thu 02 Jul 2015 11:55:19 AM UTC Name: patch Size: 1kB By: None
<http://savannah.gnu.org/bugs/download.php?file_id=34360>
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?45461>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Octave-bug-tracker] [bug #45461] binornd inefficient, patch attached,
anonymous <=