CUTEst.jl relies on SIF files to create a CUTEstModel. Three sets of SIF files are available on Bitbucket. We can easily switch between these sets using the function set_mastsif.

CUTEst.set_mastsifFunction
set_mastsif(set::String="sifcollection")

Set the environment variable MASTSIF to point to a set of SIF problems. The supported sets are:

  • "sifcollection": the CUTEst NLP test set;
  • "maros-meszaros": the Maros-Meszaros QP test set;
  • "netlib-lp": the Netlib LP test set.
source
Note

If the environment variable MASTSIF is not set, using CUTEst will automatically load the set "sifcollection".

To have the list of SIF problems available in the current set, use the function list_sif_problems.

CUTEst.list_sif_problemsFunction
problems = list_sif_problems()

Output

  • problems::Vector{String}: A list of SIF problems (without the extension .SIF) available in the current set.

See set_mastsif for more details about how to change the set of SIF files.

source

Given a problem name in the defined set, we need to decode the SIF files, which will generate corresponding Fortran files.

CUTEst.sifdecoderFunction
sifdecoder(name::String, args...; verbose::Bool=false, precision::Symbol=:double,
           outsdif::String=_name_outsdif(name, precision), libsif_folder=libsif_path)

Decodes a SIF problem, converting it into a format suitable for further processing.

Arguments

  • name::String: The path or name of the SIF problem, with or without the extension .SIF.
  • args...: Additional arguments passed directly to the SIF decoder. Relevant for problems with variable sizes.
  • verbose::Bool: If true, enables verbose output during the decoding process. Defaults to false.
  • precision::Symbol: The desired precision for the problem. Can be :single, :double (default), or :quadruple.
  • outsdif::String: The name of the file OUTSDIF.d required for automatic differentiation. Defaults to "OUTSDIF_sifname_precision.d", where sifname and precision are replaced with the problem name and chosen precision.
  • libsif_folder::String: The directory where the generated files (*.f and *.d) will be stored. Defaults to libsif_path.
sifdecoder("HS1.SIF", precision=:single)
sifdecoder("DIXMAANJ", "-param", "M=30"; precision=:double, verbose=true)
sifdecoder("/home/alexis/CUTEst/BROWNDEN.SIF", precision=:quadruple)
source

Next, we need to compile these Fortran files and create a shared library linked with a CUTEst library for a given precision (single, double, or quadruple). The CUTEst library provides generic routines to evaluate objectives, constraints, gradients, Jacobians, Hessians, etc.

CUTEst.build_libsifFunction
build_libsif(name::String; precision::Symbol=:double, libsif_folder::String=libsif_path)

Builds a shared library from a decoded SIF problem.

Arguments

  • name::String: The path or name of the SIF problem, with or without the extension .SIF.
  • precision::Symbol: The desired precision of the problem. Can be :single, :double (default), or :quadruple.
  • libsif_folder::String: The directory where the compiled library will be stored. Defaults to libsif_path.
Warning

We expect that the SIF problem has been decoded in libsif_folder and contains the generated files (*.f and *.d).

build_libsif("HS1.SIF", precision=:single)
build_libsif("DIXMAANJ", precision=:double)
build_libsif("/home/alexis/CUTEst/BROWNDEN.SIF", precision=:quadruple)
source
Note

When creating a CUTEstModel, the functions sifdecoder and build_libsif are called automatically.

These additional files are generated in the folder deps/files at the root of the installation directory of CUTEst.jl . The path to this folder is available via CUTEst.libsif_path. We provide two functions to delete these files:

CUTEst.manage_libsifFunction
manage_libsif(; sort_by::Symbol=:name, rev::Bool=false)

Opens a prompt allowing the user to selectively remove compiled libraries for SIF problems. Data files OUTSDIF_*.d, which store preprocessed information required for automatic differentiation within CUTEst, are also removed.

By default, the problems are sorted by name. Alternatively, you can sort them by file size on disk by specifying sort_by=:size. Use rev=true to reverse the sort order.

source
CUTEst.clear_libsifFunction
clear_libsif()

Removes all compiled libraries and data files associated with SIF problems.

source