annotate general/algo/bracket_it.m @ 58:ba866ae124c6

Now accepts single color index for all points.
author samer
date Fri, 09 Oct 2015 13:01:37 +0100
parents f7fb679637ff
children
rev   line source
samer@10 1 % bracket_it - Bracket iterator with pre and post actions
samer@10 2 %
samer@10 3 % bracket_it ::
samer@10 4 % iterator(A) ~'an iterator',
samer@10 5 % (A=>void) ~'action to perform before calling iterator',
samer@10 6 % (A=>void) ~'action to perform after calling iterator'
samer@10 7 % -> iterator(A) ~'new iterator incorporating pre and post actions'.
samer@10 8 function it=bracket_it(it,pre,post)
samer@10 9 f=it{1}; it{1}=@bf;
samer@10 10 function x=bf(x), pre(x); x=f(x); post(x); end
samer@10 11 end