1 function t1=sfire_simple_mat(rr,t0,mask,ncycles)
3 % rr structure with 2d fields r11...r33
5 % mask if not 0, update
7 % t1 updated ignition times
9 persistent r11 r12 r13 r21 r23 r31 r32 r33
28 t=min(t,t0(i-1,j)+r32(i-1,j));
29 t=min(t,t0(i+1,j)+r12(i+1,j));
30 t=min(t,t0(i,j-1)+r23(i,j-1));
31 t=min(t,t0(i,j+1)+r21(i,j+1));
32 t=min(t,t0(i-1,j-1)+r33(i-1,j-1));
33 t=min(t,t0(i+1,j-1)+r13(i+1,j-1));
34 t=min(t,t0(i-1,j+1)+r31(i-1,j+1));
35 t=min(t,t0(i+1,j+1)+r11(i+1,j+1));