File: perm.R

package info (click to toggle)
rmatrix 1.7-4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,096 kB
  • sloc: ansic: 97,203; makefile: 280; sh: 165
file content (15 lines) | stat: -rw-r--r-- 585 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
invertPerm <- function(p, off = 1L, ioff = 1L)
    .Call(R_invertPerm, as.integer(p), as.integer(off), as.integer(ioff))

signPerm <- function(p, off = 1L)
    .Call(R_signPerm, as.integer(p), as.integer(off))

isPerm <- function(p, off = 1L)
    .Call(R_isPerm, as.integer(p), as.integer(off))

asPerm <- function(pivot, off = 1L, ioff = 1L, n = length(pivot))
    .Call(R_asPerm, as.integer(pivot), as.integer(off), as.integer(ioff),
          as.integer(n))

invPerm <- function(p, zero.p = FALSE, zero.res = FALSE)
    invertPerm(p, if(zero.p) 0L else 1L, if(zero.res) 0L else 1L)