R/linearAlgebra-positive_definite-check-dot.R

Defines functions .check_positive_definite

#' Sanity Checks for Positive Definite Matrix
#'
#' @author Ivan Jacob Agaloos Pesigan
#'
#' @param eigen Eigen decomposition of a matrix.
#'   Output of the [base::eigen()] function.
#' @param tol Numeric. Tolerance.
#' @family Linear Algebra Functions
#' @keywords linearAlgebra test check
#' @noRd
.check_positive_definite <- function(eigen,
                                     tol = 1e-6) {
  stopifnot(
    !any(
      eigen$values <= tol
    )
  )
}
jeksterslab/linearAlgebra documentation built on Dec. 20, 2021, 10:10 p.m.