View source: R/141_problems_problem.R
| psolve | R Documentation |
Solves the problem and returns the optimal objective value. After solving,
variable values can be retrieved with value, constraint
dual values with dual_value, and solver information with
solver_stats.
psolve(
problem,
solver = NULL,
gp = FALSE,
qcp = FALSE,
verbose = FALSE,
warm_start = FALSE,
requires_grad = FALSE,
nlp = FALSE,
enforce_dpp = FALSE,
ignore_dpp = FALSE,
solver_path = NULL,
...
)
problem |
A |
solver |
Character string naming the solver to use (e.g.,
|
gp |
Logical; if |
qcp |
Logical; if |
verbose |
Logical; if |
warm_start |
Logical; if |
requires_grad |
Logical; if |
nlp |
Logical; if |
enforce_dpp |
Logical; if |
ignore_dpp |
Logical; if |
solver_path |
Optional fallback chain. A character vector of
solver names or a list whose entries are either character names or
length-2 |
... |
Solver options passed to |
The optimal objective value (numeric scalar), or Inf /
-Inf for infeasible / unbounded problems.
Problem, status,
solver_stats, solver_default_param
x <- Variable()
prob <- Problem(Minimize(x), list(x >= 5))
result <- psolve(prob, solver = "CLARABEL")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.