R/funFiltration.R

Defines functions funFiltration

Documented in funFiltration

funFiltration <- function(FUNvalues, cmplx, sublevel = TRUE) {

  if (!is.numeric(FUNvalues)) {
    stop("FUNvalues should be a vector")
  }

  if (!is.list(cmplx)) {
    stop("cmplx should be a numeric list")
  }

  if (!is.logical(sublevel)) {
    stop("sublevel should be logical")
  }

  if (sublevel == FALSE) {
    FUNvalues <- -FUNvalues
  }

  funOut <-
      FunFiltration(FUNvalues = FUNvalues, cmplx = cmplx)

  if (sublevel == TRUE) {
    out <- list(
        "cmplx" = funOut[[1]], "values" = funOut[[2]], "increasing" = sublevel)
  } else {
    out <- list(
        "cmplx" = funOut[[1]], "values" = -funOut[[2]], "increasing" = sublevel)
  }

  return (out)
}

Try the TDA package in your browser

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

TDA documentation built on March 30, 2021, 5:10 p.m.