Skip to content

Latest commit

 

History

History
62 lines (53 loc) · 2.93 KB

File metadata and controls

62 lines (53 loc) · 2.93 KB

OptimizationProblems.jl problem classification

It is possible to access information on the problems implemented in OptimizationProblems.jl without loading the problems using the package's own classification. ​

using OptimizationProblems

Each problem has its own metadata structure, and there is a global metadata structure regrouping all the information.

Problem's metadata

Each problem's metadata is accessible with OptimizationProblems.nameoftheproblem_meta and regroups in a Dict most of the essential information regarding each problem.

OptimizationProblems.AMPGO02_meta

See ? OptimizationProblems.meta for more documentation on the various entries and their default values.

This structure is completed by getters to access the number of variables, get_nameoftheproblem_nvar, the number of constraints, get_nameoftheproblem_ncon, the number of linear constraints, get_nameoftheproblem_nlin, the number of nonlinear constraints, get_nameoftheproblem_nnln, the number of equality constraints, get_nameoftheproblem_nequ, and the number of inequality constraints, get_nameoftheproblem_nineq.

OptimizationProblems.get_AMPGO02_nvar()

For scalable problems the entry :variable_nvar (and/or :variable_ncon) is set as true and one can access the number of variables by passing the parameters to the getter functions. By default, the number of variables set in the meta is obtained using OptimizationProblems.default_nvar as a parameter to define the problem.

OptimizationProblems.arglina_meta
OptimizationProblems.get_arglina_nvar(n = 10)
OptimizationProblems.PureJuMP.arglina(n = 10)

Global meta

This package collects all the metadata in a single DataFrame.

OptimizationProblems.meta

Then, it is very simple to filter problems using queries on DataFrame. We refer to the documentation of DataFrames.jl for tutorials. For instance, if one wants to select unconstrained scalable problems and use (:nvar, :name).

meta = OptimizationProblems.meta
names_pb_vars = meta[(meta.variable_nvar .== true) .& (meta.ncon .== 0), [:nvar, :name]]

Then, one can prepare a list of problems using the selected ones.

using ADNLPModels
adproblems = (
  eval(Meta.parse("ADNLPProblems.$(pb[:name])()")) for pb in eachrow(names_pb_vars)
)

Nonlinear Least Squares Problems (NLS)

Problems with :objtype set to :least_squares are nonlinear least squares problems (NLS). For these, you can access the number of NLS equations using a getter like get_nameoftheproblem_nls_nequ().

OptimizationProblems.get_lanczos1_nls_nequ()

To filter all NLS problems in the metadata DataFrame:

nls_problems = OptimizationProblems.meta[OptimizationProblems.meta.objtype .== :least_squares, :name]