R/012_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
CVXcanon.LinOpVector <- function() {
  linOps <- list()
  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
    .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 March 6, 2026, 9:10 a.m.