Mercurial > hg > ishara
annotate sequences/split.m @ 2:7357e1dc2ad6
Simplified scheduler library with new schedule representation.
author | samer |
---|---|
date | Sat, 22 Dec 2012 16:17:51 +0000 |
parents | 672052bd81f8 |
children |
rev | line source |
---|---|
samer@0 | 1 function [h,t]=split(dim,n,s) |
samer@0 | 2 % split - gather first n elements and return with rest of sequence |
samer@0 | 3 % |
samer@0 | 4 % split :: D:natural, N:natural, seq A -> [[N]->A], seq A |
samer@0 | 5 |
samer@0 | 6 h=[]; |
samer@0 | 7 for i=1:n, x=head(s); h=cat(dim,h,x); s=next(s); end |
samer@0 | 8 t=s; |
samer@0 | 9 |
samer@0 | 10 |
samer@0 | 11 |