swapInteger_cc: Swap values in an integer matrix

Description Usage Arguments Value See Also Examples

View source: R/RcppExports.R

Description

This function swaps the values in an integer matrix column-wise defined by the index matrix. This function is used mainly for the swapElements()-method of MCMC samples to swap the indicator values.

Usage

1
swapInteger_cc(values, index)

Arguments

values

An integer matrix containing the values to swap.

index

An integer matrix containing the indices by which values should be swapped.

Value

An integer matrix containing the swapped values.

See Also

Examples

1
2
3
values <- matrix(c(2, 4, 1, 3), nrow = 10, ncol = 2)
index <- matrix(c(1, 2), nrow = 10, ncol = 2)
swapInteger_cc(values, index)

simonsays1980/finmix documentation built on Dec. 23, 2021, 2:25 a.m.