R/RcppExports.R

Defines functions jaccard_coeff

Documented in jaccard_coeff

# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#' Compute jaccard coefficient between nearest-neighbor sets
#'
#' Weights of both i->j and j->i are recorded if they have intersection. In this case
#' w(i->j) should be equal to w(j->i). In some case i->j has weights while j<-i has no
#' intersections, only w(i->j) is recorded. This is determinded in code `if(u>0)`.
#' In this way, the undirected graph is symmetrized by halfing the weight
#' in code `weights(r, 2) = u/(2.0*ncol - u)/2`.
#'
#' Author: Chen Hao, Date: 25/09/2015
#' Copied from https://github.com/JinmiaoChenLab/Rphenograph/blob/master/src/jaccard_coeff.cpp
#' for use in briDiscovr on 200611 under the Artistic-2.0 license
#' @param idx NumericMatrix
#' @return NumericMatrix
#' @export
jaccard_coeff <- function(idx) {
    .Call('_briDiscovr_jaccard_coeff', PACKAGE = 'briDiscovr', idx)
}
BenaroyaResearch/briDiscovr documentation built on March 15, 2024, 12:31 a.m.