I fixed the code for my own script.
rep_hamiltonian:
repeat $! l[$>]
if s>1 to_gray. fi
ge. {avg(im,iM)}
hyp_img={sqrt(sqr(w)+sqr(h))}
n={int(sqrt(($hyp_img^2)/2))}
nn={($n-1)^2}
npts={sqr($n)}
npts_n={$npts-$n}
npts_1={$npts-1}
increment={1/$nn}
incrementValue={-$nn}
zeroV={4*$nn}
unroll *. $incrementValue
$npts,$npts
$npts,5,1,1,"begin(
const inc_v="$incrementValue";
const zv="$zeroV";
initial_pos_x=[0,0,0,1,"$n"];
initial_pos_y=["$n",1,0,0,0];
);
y==2?(
i(#-1,x,x)=zv;
):(
pos_x=x+initial_pos_x[y];
pos_y=x+initial_pos_y[y];
i(#-1,pos_x,pos_y)=i(#-2,0,x);
);"
k..
endl done
I’m still not getting the same result with post-processing made by @grosgood. Everything is suppose to check out. eigen/meigen doesn’t seem to work out.