R/union_find.R

Defines functions union_find

Documented in union_find

#' UnionFind
#' @aliases union_find 
#' @description Union find structure exposed as an Rcpp Module.
#' @docType class 
#' @section Methods: 
#' \describe{
#'     \item{$\code{print.simplextree}}{ S3 method to print a basic summary of the simplex tree. }
#' }
#' @author Matt Piekenbrock
#' @import methods
#' @param n Number of elements in the set. 
#' @return A disjoint set, as a \code{Rcpp_UnionFind} object (Rcpp module). 
union_find <- function(n = 0L){
  stopifnot((is.numeric(n) && n >= 0) || is.list(n))
  uf <- new(UnionFind, n)
  return(uf)
}

Try the simplextree package in your browser

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

simplextree documentation built on Sept. 13, 2020, 5:06 p.m.