[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: octave_rand::scalar() v. randn
From: |
Michael Creel |
Subject: |
Re: octave_rand::scalar() v. randn |
Date: |
Wed, 23 Feb 2005 09:59:46 +0100 |
User-agent: |
KMail/1.7.2 |
On Wednesday 23 February 2005 03:19, Steve C. Thompson wrote:
> Group,
>
> I've ask about this yesterday, but I will simplify the question.
>
> Say you write a C++ program using the Octave headers (then make it into
> an .oct module) which returns a vector of 1e7 Gaussian distributed
> numbers. Comparing the speed of this to randn(1,1e7), I've found randn
> to be much much faster than calling octave_rand::scalar() many times.
>
> I will be adding more to this later. I've converted a simple simulation
> into C++, made the .oct file, and compared the performance to a
> vectorized m-file-only simulation. The pure m-file simulation runs
> faster! Try to explain that.
>
> I will be following up source code and more explanation. But I thought
> that maybe one of you would know about octave_rand::scalar() v. randn.
>
> Thanks,
> Steve
Do you have octave-forge installed? The randn in octave-forge is already
an .oct file
Michael
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------