Mercurial > hg > ishara
annotate sequences/@seq/gather.m @ 38:9d24b616bb06
Added function algebra.
author | samer |
---|---|
date | Tue, 29 Jan 2013 15:59:01 +0000 |
parents | 3f77126f7b5f |
children |
rev | line source |
---|---|
samer@3 | 1 % gather - make big array of all arrays in a sequence |
samer@3 | 2 % |
samer@3 | 3 % gather :: N:natural, seq [D] -> [E], seq [D]. |
samer@3 | 4 % gather :: |
samer@3 | 5 % N:natural ~'the dimension along which to collect arrays', |
samer@3 | 6 % seq [D] ~'the seq to gather', |
samer@3 | 7 % options { |
samer@3 | 8 % draw :: boolean /0 ~'whether or not to call plotfn every iteration'; |
samer@3 | 9 % plotfn :: seq [D]->handle ~'plotting function'; |
samer@3 | 10 % save :: natural /0 ~'if >0, then save state every this many interations'; |
samer@3 | 11 % recover:: boolean / 0 ~'if 1, then attempt to restart from saved state'; |
samer@3 | 12 % id :: string /'@gather' ~'file to save state' |
samer@3 | 13 % } |
samer@3 | 14 % -> [E], seq [D]. |
samer@3 | 15 % |
samer@3 | 16 % E is such that E(I) = D(I) if I~=N. The second return |
samer@3 | 17 % is the final object in the sequence |
samer@3 | 18 function Y=gather(dim,X,varargin), Y=gathern(dim,inf,X,varargin{:}); end |