R/zdd0.R

Defines functions terminal_node zdd0

Documented in zdd0

#' zdd0
#'
#' @return the constant-0 elementary zdd (the so-called "empty set")
#' @examples zddr:::zdd0()
zdd0 <- function() {
  return(
    terminal_node(hash = '00000000000000000000000000000000',
                  order = c(),
                  minimum_order = NULL,
                  maximum_order = NULL,
                  count = 0L)
  )
}

terminal_node <- function(hash, order, minimum_order, maximum_order, count) {
  res <- structure(.Data = hash,
                   class = 'zdd',
                   order = order,
                   minimum_order = minimum_order,
                   maximum_order = maximum_order,
                   protected = TRUE,
                   count = as.integer(count))
  if(!zdd_exists(res)) register_zdd(res)
  return(res)
}
jordagaman/zddr documentation built on June 29, 2021, 4:23 a.m.