R/get.constr.value.R

Defines functions get.constr.value

Documented in get.constr.value

get.constr.value <- function(lprec, side = c("rhs", "lhs"), constraints = 1:m)
{
  m <- dim(lprec)[1]
  side <- match.arg(side)

  if(m < 1)
    constraints <- integer(0)

  value <- .Call(RlpSolve_get_rh, lprec, as.integer(constraints))

  if(side == "lhs") {
    constr.types <- get.constr.type(lprec, constraints = constraints,
                                    as.char = FALSE)
    range <- .Call(RlpSolve_get_rh_range, lprec, as.integer(constraints))
    range[constr.types == 1] <- -range[constr.types == 1]
    value <- value + range
  }

  value
}

Try the lpSolveAPI package in your browser

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

lpSolveAPI documentation built on Sept. 3, 2023, 5:07 p.m.