powered by
transform Potts model data from integer matrix to raw vector and vice versa.
packPotts(x, ncolor) inspectPotts(raw) unpackPotts(raw)
for packPotts a vector of type "raw". for inspectPotts a list containing components
packPotts
"raw"
inspectPotts
ncolor, nrow, and ncol. for unpackPotts an integer matrix.
ncolor
nrow
ncol
unpackPotts
integer matrix containing Potts model data. Colors are coded from one to ncolor.
integer scalar, number of colors.
vector of type "raw".
x <- matrix(sample(4, 2 * 3, replace = TRUE), nrow = 2) x foo <- packPotts(x, ncolor = 4) foo inspectPotts(foo) unpackPotts(foo)
Run the code above in your browser using DataLab