R/set.bounds.q

set.bounds <- function(lprec, lower = NULL, upper = NULL, columns = 1:n)
{
  n <- dim(lprec)[2]
  ncol <- length(columns)

  if(!is.null(lower)) {
    if(length(lower) != ncol)
      stop(sQuote("lower"), " must contain one element for each column",
           " in the model")

    .Call(RlpSolve_set_lowbo, lprec, as.integer(columns), as.double(lower))
  }

  if(!is.null(upper)) {
    if(length(upper) != ncol)
      stop(sQuote("upper"), " must contain one element for each column",
           " in the model")

    .Call(RlpSolve_set_upbo, lprec, as.integer(columns), as.double(upper))
  }

  invisible()
}

Try the lpSolveAPI package in your browser

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

lpSolveAPI documentation built on May 2, 2019, 6:50 p.m.