| Title: | Call Optimization Solvers with .nl Files |
|---|---|
| Description: | The purpose of this library is to to call different optimization solvers (such as Gonzalez Rodriguez et al. (2022) <doi:10.1007/s10898-022-01229-w>, Tawarmalani and Sahinidis (2005) <doi:10.1007/s10107-005-0581-8>, and Byrd et al. (2006) <doi:10.1007/0-387-30065-1_4>) to solve problems given by a standard nl file. |
| Authors: | Brais Gonzalez-Rodriguez [aut, cre] |
| Maintainer: | Brais Gonzalez-Rodriguez <[email protected]> |
| License: | GPL-3 |
| Version: | 0.1.1 |
| Built: | 2026-05-11 06:30:54 UTC |
| Source: | https://github.com/cran/nlopt |
Function that checks if the solver exists and it can be run without any issue
check_solver(solver)check_solver(solver)
solver |
name of the solver (it has to be in the PATH) |
TRUE if the solver exists and FALSE otherwise
check_solver(solver = "ipopt")check_solver(solver = "ipopt")
Function that returns an example.sol file
example_sol_file()example_sol_file()
An example.sol file
example_sol_file()example_sol_file()
Function that gets a vector with all the available options for a solver
get_available_options(solver)get_available_options(solver)
solver |
name of the solver (it has to be in the PATH) |
vector with all the available options for a solver
get_available_options(solver = "ipopt")get_available_options(solver = "ipopt")
Function that gets the corresponding problem from MINLPLib library
get_minlplib_problem(name)get_minlplib_problem(name)
name |
name of the problem |
TRUE if there is no error getting the problem and FALSE otherwise
get_minlplib_problem(name = "alkyl")get_minlplib_problem(name = "alkyl")
Function that calls the corresponding solver with custom options to solve the problem given by the .nl file
optimize(solver, file, options)optimize(solver, file, options)
solver |
name of the solver (it has to be in the PATH) |
file |
.nl file with the optimization problem. If the name of the file starts with MINLPLib:: then the problem will be downloaded from MINLPLib library |
options |
list with the options for the solver |
list with a string of the output given by the solver (output), the optimal value of the problem (objective), the status returned by the solver (status), the optimal primal solution (primal_solution), and the optimal dual solution (dual_solution)
optimize(solver = "ipopt", file = "MINLPLib::alkyl", options=list(max_cpu_time=300, outlev=3))optimize(solver = "ipopt", file = "MINLPLib::alkyl", options=list(max_cpu_time=300, outlev=3))
Function that prints the available options of the solver
print_available_options(solver)print_available_options(solver)
solver |
name of the solver (it has to be in the PATH) |
No return value
print_available_options(solver = "ipopt")print_available_options(solver = "ipopt")
Function that prints the help of the solver
print_help(solver)print_help(solver)
solver |
name of the solver (it has to be in the PATH) |
No return value
print_help(solver = "ipopt")print_help(solver = "ipopt")
Function that prints the version of the solver
print_solver_version(solver)print_solver_version(solver)
solver |
name of the solver (it has to be in the PATH) |
No return value
print_solver_version(solver = "ipopt")print_solver_version(solver = "ipopt")
Function that reads the corresponding .sol file
read_sol_file(solfile)read_sol_file(solfile)
solfile |
.sol file with the solution |
list with a string of the output given by the solver (output), the optimal value of the problem (objective), the status returned by the solver (status), the optimal primal solution (primal_solution), and the optimal dual solution (dual_solution)
read_sol_file(solfile = "example.sol")read_sol_file(solfile = "example.sol")