Permute {GraphAlignment}R Documentation

Permute rows and columns of a matrix

Description

Permute rows and columns of the input matrix using the specified permutation vector. If invertp is TRUE, the inverse permutation will be applied.

Usage

Permute(m, p, invertp=FALSE)

Arguments

m matrix
p permutation vector
invertp apply inverse permutation

Details

The return value is the row- and columnwise Permutation of the elements of the input matrix, so Permute(m, p)[i, j] is equal to m[p[i], p[j]].

Examples

  example <- GenerateExample(10, 10, 1, 0.5, TRUE, 4)
  b <- example$b
  p <- rank(rnorm(10))
  Permute(b, p, TRUE)

[Package GraphAlignment version 1.0-0 Index]