R/select.solution.q

select.solution <- function(lprec, solution)
{
  n.solutions <- .Call(RlpSolve_get_solutioncount, lprec)

  if(!missing(solution)) {
    solution <- as.integer(solution)

    if(solution < 1 || solution > n.solutions)
      stop("the value of ", sQuote("solution"), " is not valid")

    .Call(RlpSolve_set_solutionlimit, lprec, solution)
  }

  n.solutions
}

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.