From: <hi...@us...> - 2010-09-09 19:01:50
|
Revision: 7694 http://octave.svn.sourceforge.net/octave/?rev=7694&view=rev Author: highegg Date: 2010-09-09 19:01:41 +0000 (Thu, 09 Sep 2010) Log Message: ----------- use for instead of cellfun to workaround 3.2.4 cellfun bug Modified Paths: -------------- trunk/octave-forge/main/general/inst/parcellfun.m Modified: trunk/octave-forge/main/general/inst/parcellfun.m =================================================================== --- trunk/octave-forge/main/general/inst/parcellfun.m 2010-09-09 14:28:07 UTC (rev 7693) +++ trunk/octave-forge/main/general/inst/parcellfun.m 2010-09-09 19:01:41 UTC (rev 7694) @@ -62,6 +62,9 @@ function varargout = parcellfun (nproc, fun, varargin) + ## The list of functions to be seeded in each slave. + persistent random_func_list = {@rand, @randn, @rande, @randp, @randg}; + if (nargin < 3 || ! isscalar (nproc) || nproc <= 0) print_usage (); endif @@ -207,9 +210,10 @@ try ## re-seed random number states, adjusted for each process seed *= iproc*bitmax; - ## make rfh return a value to work around a bug in Octave 3.2.4's cellfun - rfh = @(r) zeros (feval (r, "state", seed)); - cellfun (rfh, {@rand, @randn, @rande, @randp, @randg}); + ## FIXME: use cellfun when 3.4. is a requirement + for rf = random_func_list + rf{1}("state", seed); + endfor ## child process. indicate ready state. fwrite (statw, -iproc, "double"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |