R/RcppExports.R

Defines functions ring_lattice_cpp is_symmetric_cpp check_adjacency_cpp edges_from_adjacency_cpp ecdf_cpp components_in_adjacency

Documented in check_adjacency_cpp components_in_adjacency ecdf_cpp edges_from_adjacency_cpp is_symmetric_cpp ring_lattice_cpp

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

#' C++ implementation to obtain connected components in a graph.
#' 
#' @param adj An adjacency matrix.
#' @return Returns a matrix with 2 columns containing the indicies in the
#' lower-triangle of the matrix that are nonzero.
#' @export
components_in_adjacency <- function(adj) {
    .Call('_SeqNet_components_in_adjacency', PACKAGE = 'SeqNet', adj)
}

#' C++ implementation of empirical CDF
#' 
#' Constructs the empirical CDF, F, for a set of observations, x, and 
#' returns F(x).
#' @param x The observation to construct the empirical CDF from.
#' @return Returns the values for F(x).
#' @export
ecdf_cpp <- function(x) {
    .Call('_SeqNet_ecdf_cpp', PACKAGE = 'SeqNet', x)
}

#' C++ implementation for obtaining an edge list from adjacency matrix
#' 
#' @param adj An adjacency matrix.
#' @return Returns a matrix with 2 columns containing the indicies in the
#' lower-triangle of the matrix that are nonzero.
#' @export
edges_from_adjacency_cpp <- function(adj) {
    .Call('_SeqNet_edges_from_adjacency_cpp', PACKAGE = 'SeqNet', adj)
}

#' C++ implementation to check if a matrix is an adjacency matrix
#' 
#' @param m A matrix to check.
#' @return Returns 0 if the matrix is an adjacency matrix. If the matrix is 
#' not square, returns 1; if the diagonal entries are not all zero, returns 2; 
#' if the matrix is not symmetric, returns 3; if the matrix contains values
#' other than 0 or 1, returns 4.
#' @export
check_adjacency_cpp <- function(m) {
    .Call('_SeqNet_check_adjacency_cpp', PACKAGE = 'SeqNet', m)
}

#' C++ implementation to check if a matrix is symmetric
#' 
#' @param m A matrix to check.
#' @param tol A Numeric scalar >= 0. Differences smaller than tol are ignored.
#' @return Returns TRUE if the matrix is symmetric and FALSE otherwise.
#' @export
is_symmetric_cpp <- function(m, tol = 1e-12) {
    .Call('_SeqNet_is_symmetric_cpp', PACKAGE = 'SeqNet', m, tol)
}

#' C++ implementation for creating a ring lattice
#' 
#' @param p The number of nodes in the lattice.
#' @param neig_size The neighborhood side within which nodes are connected.
#' @return Returns the adjacency matrix for the ring lattice.
#' @export
ring_lattice_cpp <- function(p, neig_size) {
    .Call('_SeqNet_ring_lattice_cpp', PACKAGE = 'SeqNet', p, neig_size)
}

Try the SeqNet package in your browser

Any scripts or data that you put into this service are public.

SeqNet documentation built on July 9, 2021, 9:08 a.m.