samer@3: % gather - make big array of all arrays in a sequence samer@3: % samer@3: % gather :: N:natural, seq [D] -> [E], seq [D]. samer@3: % gather :: samer@3: % N:natural ~'the dimension along which to collect arrays', samer@3: % seq [D] ~'the seq to gather', samer@3: % options { samer@3: % draw :: boolean /0 ~'whether or not to call plotfn every iteration'; samer@3: % plotfn :: seq [D]->handle ~'plotting function'; samer@3: % save :: natural /0 ~'if >0, then save state every this many interations'; samer@3: % recover:: boolean / 0 ~'if 1, then attempt to restart from saved state'; samer@3: % id :: string /'@gather' ~'file to save state' samer@3: % } samer@3: % -> [E], seq [D]. samer@3: % samer@3: % E is such that E(I) = D(I) if I~=N. The second return samer@3: % is the final object in the sequence samer@3: function Y=gather(dim,X,varargin), Y=gathern(dim,inf,X,varargin{:}); end