View source: R/benchmark_suite.R
solnp_problem_suite | R Documentation |
Returns a list (or a single object) of implemented test problems corresponding to a selected suite. Problem functions must follow the naming convention ‘problem_name_problem’ and return a list describing the optimization problem (e.g., objective, constraints, bounds).
solnp_problem_suite(
suite = "Hock-Schittkowski",
number = 1,
return_all = FALSE
)
suite |
Character. The test suite to draw from. Must be one of “Hock-Schittkowski” or “Other”. Default is “Hock-Schittkowski”. |
number |
Integer or vector of integers. One or more problem numbers to retrieve. Ignored if return_all = TRUE. |
return_all |
Logical. If TRUE, returns all implemented problems in the specified suite. Default is FALSE. |
Problems are matched by number within the selected suite, using the table from solnp_problems_table()
.
If a requested problem is valid but not yet implemented (i.e., the corresponding function does not exist), a message will inform the user.
If a problem number exceeds the allowable range (e.g., > 306 for Hock-Schittkowski), an error is raised.
If one problem is requested and implemented, the evaluated problem object is returned directly. Otherwise, an unnamed list of evaluated problem objects is returned.
solnp_problems_table()
## Not run:
# Retrieve a single HS problem
prob <- solnp_problem_suite(number = 1)
# Retrieve multiple HS problems
probs <- solnp_problem_suite(number = c(1, 2, 3))
# Retrieve problem in "Other" suite
other_prob <- solnp_problem_suite(suite = "Other", number = 1)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.