R/fwd_bck_graded.R

Defines functions is.backward.graded is.forward.graded

Documented in is.backward.graded is.forward.graded

## Check for forward- and backward-gradedness

is.forward.graded <- function(K) {
  sapply(colnames(K), function(q) {
           K.plus <- K
           K.plus[, q] <- 1
           all(as.pattern(K.plus) %in% as.pattern(K))
         })
}


is.backward.graded <- function(K) {
  sapply(colnames(K), function(q) {
           K.minus <- K
           K.minus[, q] <- 0
           all(as.pattern(K.minus) %in% as.pattern(K))
         })
}

Try the pks package in your browser

Any scripts or data that you put into this service are public.

pks documentation built on May 29, 2017, 11:26 p.m.