|
From: | Doug Stewart |
Subject: | Re: Fast random numbers |
Date: | Mon, 25 Jul 2016 04:53:25 -0400 |
Thank you for your fast reply. Below you can find a script showing two scenarios. The script also shows that the runtime is not due to memory assignment or writing.
#!/usr/bin/octave --no-init-file
n = 4.6E7;
k = 0.72*n;
tic(); randperm(n, k); toc() #1.7 seconds
tic(); 1337 + zeros(1, k); toc() #0.2 seconds
n = 10000;
tic(); rand(n); toc() #1.7
tic(); 1337 + zeros(n); toc() #0.7
Sincerely
Max Görner
--
PGP: https://wwwpub.zih.tu-dresden.de/~maxgoern/2FE6023F.asc
_______________________________________________
Help-octave mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/help-octave
[Prev in Thread] | Current Thread | [Next in Thread] |