################################################################################
##                         Chen and Friedman (2016)                           ##
##                                                                            ##
################################################################################
CF <- function(X1, X2, dist.fun = stats::dist, graph.fun = MST5, 
               n.perm = 0, dist.args = NULL, graph.args = NULL, seed = NULL) {
  dname <- c(deparse1(substitute(X1)), deparse1(substitute(X2)))
  gTestWrapper(X1, X2, dist.fun, graph.fun, n.perm, dist.args, graph.args, 
               type = "generalized", seed = seed, dname = dname)
}

CF_cat <- function(X1, X2, dist.fun, agg.type = "u", graph.type = "mstree",
                   K = 5, n.perm = 0, seed = NULL) {
  dname <- c(deparse1(substitute(X1)), deparse1(substitute(X2)))
  gTestWrapperCat(X1, X2, dist.fun, agg.type, graph.type, K, n.perm, 
                  type = "generalized", seed = seed, dname = dname)
}