help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: parcellfun and rand


From: Jaroslav Hajek
Subject: Re: parcellfun and rand
Date: Sat, 4 Sep 2010 14:23:50 +0200

On Sat, Sep 4, 2010 at 6:55 AM, Muhali <address@hidden> wrote:
>
> Unlike cellfun, parcellfun appears to re-initialize the rand function in each
> call. This is counter-intuitive.
>
> octave:1> disp(parcellfun(1, @(x) rand, cell(1,1), "UniformOutput", false,
> "verboselevel", 0))
> {
>  [1,1] =  0.32068
> }
> octave:2> disp(parcellfun(1, @(x) rand, cell(1,1), "UniformOutput", false,
> "verboselevel", 0))
> {
>  [1,1] =  0.32068
> }
> octave:3> disp(cellfun(@(x) rand, cell(1,1), "UniformOutput", false))
> {
>  [1,1] =  0.32068
> }
> octave:4> disp(cellfun(@(x) rand, cell(1,1), "UniformOutput", false))
> {
>  [1,1] =  0.26259
> }
>

This has been already fixed; please upgrade your package. Parcellfun
now broadcasts the original seed to each forked process and
reinitializes based on that and the thread number. Unfortunately,
there is no feasible way to make parcellfun behave identically to
cellfun in this regard.

hth
-- 
RNDr. Jaroslav Hajek, PhD
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz



reply via email to

[Prev in Thread] Current Thread [Next in Thread]