Nothing
.reduce_transitivity_legacy <- function(M) {
D <- Matrix::Diagonal(n = ncol(M))
adj <- M - D
transitivity <- adj %*% adj
transitivity@x[transitivity@x > 0] <- 1
return(adj - transitivity)
}
# Wrapper en R
#' @importFrom methods new
.reduce_transitivity <- function(M) {
# Asegurar dgCMatrix
if (!inherits(M, "nMatrix")) M <- methods::as(M, "nMatrix")
# Llamada C++
L <- reduce_transitivity_cpp(M@i, M@p, M@Dim)
# Reconstruir objeto
new("ngCMatrix",
i = L$i,
p = L$p,
Dim = L$Dim)
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.