Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

  • ef126ff
  • /
  • RcppExports.R
Raw File Download

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
content badge
swh:1:cnt:243a67f1aa1b304a422ab0cefef905692a4ed923
directory badge
swh:1:dir:ef126ff5e1fd9e17d2e9614ece8a1a8c5e1a7e31

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
RcppExports.R
# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#' fast Euclidean distance matrix
#'
#' @param x matrix with sample rows for which the distance 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)
}

#' fast centered Euclidean distance matrix
#'
#' @param x matrix with sample rows for which the distance 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)
}

#' for the fast detection of the full dependence structure
#'
#' Returns the row indicies of matrix A which match with B
#'
#' @param A matrix
#' @param B matrix whose rows are subset of A
#'
#' @examples
#' # A = t(utils::combn(10,3))
#' # B = A[sort(sample.int(nrow(A),10)),]
#' # match_rows(A,B)
#'
#' @keywords internal
match_rows <- function(A, B) {
    .Call('_multivariance_match_rows', PACKAGE = 'multivariance', A, B)
}

#' bias corrected double centering
#' # included for speed comparison
#'
#' @keywords internal
doubleCenterBiasCorrected <- function(x) {
    .Call('_multivariance_doubleCenterBiasCorrected', PACKAGE = 'multivariance', x)
}

#' bias corrected double centering with normalizing
#' # included for speed comparison
#'
#' @keywords internal
doubleCenterBiasCorrectedUpper <- function(x) {
    .Call('_multivariance_doubleCenterBiasCorrectedUpper', PACKAGE = 'multivariance', x)
}

#' bias corrected double centering with normalizing constants for upper and lower bound
#'
#' @keywords internal
doubleCenterBiasCorrectedUpperLower <- function(x, n) {
    .Call('_multivariance_doubleCenterBiasCorrectedUpperLower', PACKAGE = 'multivariance', x, n)
}

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API