R/CVXcanon.R

Defines functions CVXcanon.build_matrix

CVXcanon.build_matrix <- function(constraints, id_to_col, constr_offsets) {
  ## Returns a ProblemData object
  ptr <- NA
  if (missing(constr_offsets)) {
    ptr <- .Call('_CVXR_build_matrix_0',
                 constraints$getXPtr(),
                 id_to_col,
                 PACKAGE = 'CVXR')
  } else {
    ptr <- .Call('_CVXR_build_matrix_1',
                 constraints$getXPtr(),
                 id_to_col,
                 constr_offsets,
                 PACKAGE = 'CVXR')
  }
  getV <- function() {
    .Call('_CVXR_ProblemData__get_V', ptr, PACKAGE = "CVXR")
  }

  getI <- function() {
    .Call('_CVXR_ProblemData__get_I', ptr, PACKAGE = "CVXR")
  }

  getJ <- function() {
    .Call('_CVXR_ProblemData__get_J', ptr, PACKAGE = "CVXR")
  }

  getConstVec <- function() {
    .Call('_CVXR_ProblemData__get_const_vec', ptr, PACKAGE = "CVXR")
  }
  list(getV = getV, getI = getI, getJ = getJ, getConstVec = getConstVec)
}

Try the CVXR package in your browser

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

CVXR documentation built on April 4, 2025, 1:08 a.m.