R/update_coneproj.R

Defines functions update_coneproj

################################################################################
#
# Wrapper for coneproj alpha update
#
################################################################################

update_coneproj <- function(Dmat, dvec, Cmat, bvec, qp_pars){
  # Fit
  res <- coneproj::qprog(q = Dmat, c = dvec, amat = Cmat, b = bvec,
    msg = qp_pars$msg)
  # Use all.equal for "near equality" due to potential precision errors
  isactive <- mapply(all.equal, Cmat %*% res$thetahat - bvec, 0)
  list(alpha = drop(res$thetahat), active = which(isactive))
}

Try the cgaim package in your browser

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

cgaim documentation built on June 30, 2025, 9:07 a.m.