R/000-wrappers.R

Defines functions clarabel_solve .savvy_extract_ptr

# Generated by savvy: do not edit by hand
#
# Note:
#   This wrapper file is named as `000-wrappers.R` so that this file is loaded
#   first, which allows users to override the functions defined here (e.g., a
#   print() method for an enum).

#' @useDynLib clarabel, .registration = TRUE
#' @keywords internal
NULL

# Check class and extract the external pointer embedded in the environment
.savvy_extract_ptr <- function(e, class) {
  if(is.null(e)) {
    return(NULL)
  }

  if(inherits(e, class)) {
    e$.ptr
  } else {
    msg <- paste0("Expected ", class, ", got ", class(e)[1])
    stop(msg, call. = FALSE)
  }
}


clarabel_solve <- function(m, n, Ai, Ap, Ax, b, q, Pi, Pp, Px, cone_spec, r_settings) {
  .Call(savvy_clarabel_solve__impl, m, n, Ai, Ap, Ax, b, q, Pi, Pp, Px, cone_spec, r_settings)
}

Try the clarabel package in your browser

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

clarabel documentation built on April 12, 2025, 1:53 a.m.