solnp_problem_suite: Retrieve Implemented Test Problems for the SOLNP Suite

View source: R/benchmark_suite.R

solnp_problem_suiteR Documentation

Retrieve Implemented Test Problems for the SOLNP Suite

Description

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).

Usage

solnp_problem_suite(
  suite = "Hock-Schittkowski",
  number = 1,
  return_all = FALSE
)

Arguments

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.

Details

  • 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.

Value

If one problem is requested and implemented, the evaluated problem object is returned directly. Otherwise, an unnamed list of evaluated problem objects is returned.

See Also

solnp_problems_table()

Examples

## 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)


Rsolnp documentation built on June 20, 2025, 5:07 p.m.