Description Usage Arguments Details
swap_mult
is used to swap elements of multiple binary chains if doing
so maintains the same number of transitions between the two states of those
chains.
1 | swap_mult(bin_chains, m)
|
bin_chains |
A two dimensional integer vector with binary values. |
m |
A positive nonzero integer value for the attempted number of swaps
to attempt on |
swap_mult
works by taking a two dimensional integer vector
bin_chains
and m
, a number of times to attempt swaps. It
generates random integers which are valid indices of the two dimensional
vector bin_chains
and tries to swap the elements of the vector at
the indices that it generates, only doing so if this preserves the total
number of transitions between states. After attempting m
swaps,
swap_mult
returns the new, freshly swapped two dimensional vector of
binary chains.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.