[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
octave_rand::scalar() v. randn
From: |
Steve C. Thompson |
Subject: |
octave_rand::scalar() v. randn |
Date: |
Tue, 22 Feb 2005 18:19:17 -0800 |
User-agent: |
Mutt/1.3.28i |
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
-------------------------------------------------------------
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
-------------------------------------------------------------
- octave_rand::scalar() v. randn,
Steve C. Thompson <=