Nothing
#####
## DO NOT EDIT THIS FILE!! EDIT THE SOURCE INSTEAD: rsrc_tree/reductions/solvers/solver.R
#####
## CVXPY SOURCE: reductions/solvers/solver.py
## Solver -- abstract base class for solver reductions
# -- Solver constants ----------------------------------------------
## CVXPY SOURCE: solver.py lines 28-43
SOLVER_VAR_ID <- "var_id"
SOLVER_DUAL_VAR_ID <- "dual_var_id"
SOLVER_EQ_CONSTR <- "eq_constr"
SOLVER_NEQ_CONSTR <- "other_constr"
# -- Solver base class --------------------------------------------
## CVXPY SOURCE: solver.py lines 24-90
Solver <- new_class("Solver", parent = Reduction, package = "CVXR",
properties = list(
MIP_CAPABLE = new_property(class_logical, default = FALSE),
BOUNDED_VARIABLES = new_property(class_logical, default = FALSE)
),
constructor = function(MIP_CAPABLE = FALSE, BOUNDED_VARIABLES = FALSE) {
new_object(S7_object(),
.cache = new.env(parent = emptyenv()),
MIP_CAPABLE = MIP_CAPABLE,
BOUNDED_VARIABLES = BOUNDED_VARIABLES
)
}
)
## name: subclasses must override
method(solver_name, Solver) <- function(x) {
cli_abort("Class {.cls {class(x)[[1L]]}} must implement {.fn solver_name}.")
}
## import_solver: check if solver package is installed
solver_import <- function(x) {
cli_abort("Class {.cls {class(x)[[1L]]}} must implement {.fn solver_import}.")
}
## is_installed: check if solver R package is available
solver_is_installed <- function(solver) {
tryCatch({
solver_import(solver)
TRUE
}, error = function(e) FALSE)
}
## solve_via_data: subclasses must override
method(solve_via_data, Solver) <- function(x, data, warm_start = FALSE, verbose = FALSE,
solver_opts = list(), ...) {
cli_abort("Class {.cls {class(x)[[1L]]}} must implement {.fn solve_via_data}.")
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.