Nothing
# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
#' Sparse Cholesky decomposition with sparse representation
#'
#' Sparse Cholesky decomposition with sparse representation
#'
#' @details
#' Generates the LDL decomposition of a symmetric, sparse matrix using the method
#' described by Timothy Davis (see references). Required input is a matrix
#' in sparse format from the matrix package, see \link[Matrix]{sparseMatrix}, or the
#' package function \link[SparseChol]{dense_to_sparse}. To instead use a matrix directly, see \link[SparseChol]{sparse_chol}.
#' @param n Integer specifying the dimension of the matrix
#' @param Ai Integer vector specifying the row positions of the non-zero values of the matrix
#' @param Ap numeric (integer valued) vector of pointers, one for each column (or row), to the initial (zero-based) index of elements in the column (or row).
#' @param Ax values of the non-zero matrix entries
#' @return A list with elements n, Ai, Ap, Ax (corresponding to above arguments) for matrix L, and element D, which
#' contains the diagonal values of matrix D.
#' @examples
#' n <- 10
#' Ap <- c(0, 1, 2, 3, 4, 6, 7, 9, 11, 15, 19)
#' Ai <- c(1, 2, 3, 4, 2,5, 6, 5,7, 5,8, 1,5,8,9, 2,5,7,10)
#' Ax <- c(1.7, 1., 1.5, 1.1, .02,2.6, 1.2, .16,1.3, .09,1.6,
#' .13,.52,.11,1.4, .01,.53,.56,3.1)
#' out <-sparse_chol_crs(n,Ap,Ai,Ax)
#' sparse_L(out)
#' sparse_D(out)
sparse_chol_crs <- function(n, Ap, Ai, Ax) {
.Call(`_SparseChol_sparse_chol_crs`, n, Ap, Ai, Ax)
}
#' Sparse Cholesky decomposition
#'
#' Sparse Cholesky decomposition
#'
#' @details
#' Generates the LDL decomposition of a symmetric, sparse matrix using the method
#' described by Timothy Davis (see references). This function accepts a standard matrix,
#' converts to sparse format, generates the LDL decomposition and returns the Cholesky
#' decomposition LD^0.5.
#' @param mat A matrix
#' @return A lower-triangular matrix.
#' @examples
#' M <- diag(10)
#' #put a few random values in
#' M[lower.tri(M)][seq(1,45,by=5)] <- c(0.1,0.5,0.9,0.6,0.8,0.9,0.2,0.3,0.1)
#' M[upper.tri(M)][seq(1,45,by=5)] <- c(0.1,0.5,0.9,0.6,0.8,0.9,0.2,0.3,0.1)
#' L <- sparse_chol(M)
sparse_chol <- function(mat) {
.Call(`_SparseChol_sparse_chol`, mat)
}
#' AMD ordering
#'
#' AMD ordering
#'
#' @details
#' Generates the approximate minimum degree ordering of the matrix for use in efficient
#' Cholesky decomposition of PAP^T.
#' @param mat A matrix
#' @return A list with the permutation vector and it's inverse.
amd_order <- function(mat) {
.Call(`_SparseChol_amd_order`, mat)
}
#' Generate sparse matrix representation of a matrix
#'
#' Generate sparse matrix representation of a matrix
#'
#' @param mat A matrix
#' @return A list with the matrix in compressed row storage format.
#' @examples
#' M <- diag(10)
#' #put a few random values in
#' M[lower.tri(M)][seq(1,45,by=5)] <- c(0.1,0.5,0.9,0.6,0.8,0.9,0.2,0.3,0.1)
#' M[upper.tri(M)][seq(1,45,by=5)] <- c(0.1,0.5,0.9,0.6,0.8,0.9,0.2,0.3,0.1)
#' L <- dense_to_sparse(M)
dense_to_sparse <- function(mat) {
.Call(`_SparseChol_dense_to_sparse`, mat)
}
testSparse <- function() {
invisible(.Call(`_SparseChol_testSparse`))
}
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.