https://github.com/cran/multivariance
Raw File
Tip revision: 2ffcc6849222a41d7684515fd823120c29cfa0e2 authored by Björn Böttcher on 06 February 2019, 12:30:06 UTC
version 2.0.0
Tip revision: 2ffcc68
RcppExports.R
# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#' fast euclidean distance matrix computation
#'
#' @param x matrix with sample rows which the distanc matrix is computed (to use with vectors, use \code{as.matrix(x)})
#' @examples
#' #require(microbenchmark)
#' #x = rnorm(100)
#' #microbenchmark(fastdist(as.matrix(x)),as.matrix(dist(x)))
#' @export
fastdist <- function(x) {
    .Call('_multivariance_fastdist', PACKAGE = 'multivariance', x)
}

#' double center a symmetric matrix
#'
#' @param x symmetric matrix
#' @param normalize boolean. If \code{TRUE} the matrix will be normalized to mean 1.
#' @keywords internal
doubleCenterSymMat <- function(x, normalize) {
    .Call('_multivariance_doubleCenterSymMat', PACKAGE = 'multivariance', x, normalize)
}

#' double centered Euclidean distance matrix
#'
#' @param x matrix with sample rows which the distanc matrix is computed (to use with vectors, use \code{as.matrix(x)})
#' @param normalize boolean. If \code{TRUE} the matrix will be normalized to mean 1.
#' @export
fastEuclideanCdm <- function(x, normalize) {
    .Call('_multivariance_fastEuclideanCdm', PACKAGE = 'multivariance', x, normalize)
}

back to top