This is a basis function used in simulation algorithms on the Ising
and Potts models. It counts how many of the four neighbours
of
xneig4(x, a, b, col)
integer between 0 and 4 giving the number of neighbours with the same colour
grid of coloured pixels
row index
column index
current or proposed colour
pottsgibbs
,
sumising
data(Laichedata)
xneig4(Laichedata,2,3,1)
xneig4(Laichedata,2,3,0)
Run the code above in your browser using DataLab