R/017_lin_ops_LinOpVector.R

Defines functions CVXcanon.LinOpVector

#####
## DO NOT EDIT THIS FILE!! EDIT THE SOURCE INSTEAD: rsrc_tree/lin_ops/LinOpVector.R
#####

## R-SPECIFIC: LinOpVector closure-based wrapper over C++ external pointers
## LinOpVector class shadowing CPP class
##
## Direct `.Call` per ADR D_PERF.6; each site names its generated equivalent so
## the signature is visible at the call (`.Call` is positional and coerces
## silently). Checked by `scripts/validate_rcpp_bridge.R`.
CVXcanon.LinOpVector <- function() {
  linOps <- list()
  ## wrapper: .LinOpVector__new()
  ptr <- .Call("_CVXR_LinOpVector__new", PACKAGE = "CVXR")
  getXPtr <- function() ptr
  getList <- function() linOps
  push_back <- function(linop_ptr) {
    n <- length(linOps)
    linOps[[n + 1L]] <- linop_ptr          ## R-side keep-alive for GC
    ## wrapper: .LinOpVector__push_back(ptr, linop_ptr)
    .Call("_CVXR_LinOpVector__push_back", ptr, linop_ptr, PACKAGE = "CVXR")
  }
  list(getXPtr = getXPtr,
       getList = getList,
       push_back = push_back)
}

Try the CVXR package in your browser

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

CVXR documentation built on Aug. 24, 2026, 9:10 a.m.