optiprofiler.problem_libs.s2mpj.s2mpj_load#
- optiprofiler.problem_libs.s2mpj.s2mpj_load(problem_name, *args, library_options=None)[source]#
Convert an S2MPJ problem name to a Problem instance.
- Parameters:
- problem_namestr
Name of the problem in the S2MPJ collection. More details about S2MPJ can be found at the official repository.
- library_optionsdict, optional
Validated S2MPJ options supplied by OptiProfiler. They currently affect problem selection rather than loading, but accepting the same mapping keeps selector and worker behavior explicit.
- Returns:
- optiprofiler.Problem
A
Probleminstance corresponding to the named problem.
See also
s2mpj_selectSelect problems from S2MPJ by criteria.
Notes
There are two ways to obtain the
problem_nameyou want:Use
s2mpj_selectto get the problem names that satisfy your criteria.Look for the CSV file
probinfo_python.csvin the same directory as this module. It contains information about all problems in S2MPJ.
The problem name may appear in the form
'PROBLEMNAME_n_m'wherenis the dimension andmis the number of linear and nonlinear constraints. This happens when a problem accepts extra arguments to change its dimension or number of constraints. This information is stored in theprobinfo_python.csvfile.Invalid native metadata fails closed: wrong shapes, NaN entries and impossible or crossed bounds raise ValueError, and a linear constraint whose values or Jacobian cannot be read at
x0raises RuntimeError with the original cause. No constraint is dropped and no NaN matrix is built. Problems without linear constraints need no Jacobian probe at load time.Examples
from optiprofiler.problem_libs.s2mpj import s2mpj_load problem = s2mpj_load('ROSENBR') print(problem.n) # 2