Type: | Package |
Title: | A Solver for 'ompr' that Uses the R Optimization Infrastructure ('ROI') |
Version: | 1.0.2 |
Description: | A solver for 'ompr' based on the R Optimization Infrastructure ('ROI'). The package makes all solvers in 'ROI' available to solve 'ompr' models. Please see the 'ompr' website https://dirkschumacher.github.io/ompr/ and package docs for more information and examples on how to use it. |
License: | MIT + file LICENSE |
RoxygenNote: | 7.2.3 |
Encoding: | UTF-8 |
URL: | https://github.com/dirkschumacher/ompr.roi |
BugReports: | https://github.com/dirkschumacher/ompr.roi/issues |
Depends: | R (≥ 3.5.0) |
Imports: | ROI (≥ 0.3.0), slam, methods, Matrix, ompr (≥ 1.0.1) |
Suggests: | testthat, magrittr, ROI.plugin.glpk |
ByteCompile: | Yes |
NeedsCompilation: | no |
Packaged: | 2023-09-09 10:42:05 UTC; dsp |
Author: | Dirk Schumacher [aut, cre] |
Maintainer: | Dirk Schumacher <mail@dirk-schumacher.net> |
Repository: | CRAN |
Date/Publication: | 2023-09-09 11:10:02 UTC |
A Solver for 'ompr' that Uses the R Optimization Infrastructure ('ROI')
Description
A solver for 'ompr' based on the R Optimization Infrastructure ('ROI'). The package makes all solvers in 'ROI' available to solve 'ompr' models. Please see the 'ompr' website <https://dirkschumacher.github.io/ompr> and package docs for examples on how to use it.
Author(s)
Maintainer: Dirk Schumacher mail@dirk-schumacher.net
See Also
Useful links:
Report bugs at https://github.com/dirkschumacher/ompr.roi/issues
Export to ROI::OP
Description
This function can be used to transform an ompr model to a ROI::OP object.
Usage
as_ROI_model(model)
Arguments
model |
an ompr model |
Value
an object of S3 class 'ROI::OP'
Configures a solver based on 'ROI'
Description
This function makes all solvers in the R package 'ROI' available to solve 'ompr' models.
Usage
with_ROI(solver, ...)
Arguments
solver |
the 'ROI' solver name (character vector of length 1) |
... |
optional parameters passed to ROI_solve Note: it does only support column duals. It currently does not export row duals. |
Value
a function: Model -> Solution that can be used
together with solve_model
. You can find ROI
's
original solver message
and status
information in
<return_value>$ROI
. The ompr
status code is "success"
if ROI
returns code = 0
and is "error"
otherwise.
References
Kurt Hornik, David Meyer, Florian Schwendinger and Stefan Theussl (2016). ROI: R Optimization Infrastructure. <https://CRAN.R-project.org/package=ROI>
Examples
## Not run:
library(magrittr)
library(ompr)
library(ROI)
library(ROI.plugin.glpk)
add_variable(MIPModel(), x, type = "continuous") %>%
set_objective(x, sense = "max") %>%
add_constraint(x <= 5) %>%
solve_model(with_ROI(solver = "glpk", verbose = TRUE))
## End(Not run)