#include "IpStdCInterface.h"
#include "IpStdInterfaceTNLP.hpp"
#include "IpOptionsList.hpp"
#include "IpIpoptApplication.hpp"
Classes | |
struct | IpoptProblemInfo |
Functions | |
IpoptProblem | CreateIpoptProblem (Index n, Number *x_L, Number *x_U, Index m, Number *g_L, Number *g_U, Index nele_jac, Index nele_hess, Index index_style, Eval_F_CB eval_f, Eval_G_CB eval_g, Eval_Grad_F_CB eval_grad_f, Eval_Jac_G_CB eval_jac_g, Eval_H_CB eval_h) |
Function for creating a new Ipopt Problem object. | |
void | FreeIpoptProblem (IpoptProblem ipopt_problem) |
Method for freeing a previously created IpoptProblem. | |
Bool | AddIpoptStrOption (IpoptProblem ipopt_problem, const char *keyword, const char *val) |
Function for adding a string option. | |
Bool | AddIpoptNumOption (IpoptProblem ipopt_problem, const char *keyword, Number val) |
Function for adding a Number option. | |
Bool | AddIpoptIntOption (IpoptProblem ipopt_problem, const char *keyword, Int val) |
Function for adding an Int option. | |
Bool | OpenIpoptOutputFile (IpoptProblem ipopt_problem, char *file_name, Int print_level) |
Function for opening an output file for a given name with given printlevel. | |
enum ApplicationReturnStatus | IpoptSolve (IpoptProblem ipopt_problem, Number *x, Number *g, Number *obj_val, Number *mult_g, Number *mult_x_L, Number *mult_x_U, UserDataPtr user_data) |
Function calling the Ipopt optimization algorithm for a problem previously defined with CreateIpoptProblem. |
Bool AddIpoptIntOption | ( | IpoptProblem | ipopt_problem, | |
const char * | keyword, | |||
Int | val | |||
) |
Function for adding an Int option.
Returns FALSE the option could not be set (e.g., if keyword is unknown)
References IpoptProblemInfo::app.
Referenced by F77_FUNC().
Bool AddIpoptNumOption | ( | IpoptProblem | ipopt_problem, | |
const char * | keyword, | |||
Number | val | |||
) |
Function for adding a Number option.
Returns FALSE the option could not be set (e.g., if keyword is unknown)
References IpoptProblemInfo::app.
Referenced by F77_FUNC().
Bool AddIpoptStrOption | ( | IpoptProblem | ipopt_problem, | |
const char * | keyword, | |||
const char * | val | |||
) |
Function for adding a string option.
Returns FALSE the option could not be set (e.g., if keyword is unknown)
References IpoptProblemInfo::app.
Referenced by F77_FUNC().
IpoptProblem CreateIpoptProblem | ( | Index | n, | |
Number * | x_L, | |||
Number * | x_U, | |||
Index | m, | |||
Number * | g_L, | |||
Number * | g_U, | |||
Index | nele_jac, | |||
Index | nele_hess, | |||
Index | index_style, | |||
Eval_F_CB | eval_f, | |||
Eval_G_CB | eval_g, | |||
Eval_Grad_F_CB | eval_grad_f, | |||
Eval_Jac_G_CB | eval_jac_g, | |||
Eval_H_CB | eval_h | |||
) |
Function for creating a new Ipopt Problem object.
This function returns an object that can be passed to the IpoptSolve call. It contains the basic definition of the optimization problem, such as number of variables and constraints, bounds on variables and constraints, information about the derivatives, and the callback function for the computation of the optimization problem functions and derivatives. During this call, the options file PARAMS.DAT is read as well.
If NULL is returned, there was a problem with one of the inputs or reading the options file.
n | Number of optimization variables |
x_L | Lower bounds on variables. This array of size n is copied internally, so that the caller can change the incoming data after return without that IpoptProblem is modified. Any value less or equal than the number specified by option 'nlp_lower_bound_inf' is interpreted to be minus infinity. |
x_U | Upper bounds on variables. This array of size n is copied internally, so that the caller can change the incoming data after return without that IpoptProblem is modified. Any value greater or equal than the number specified by option 'nlp_upper_bound_inf' is interpreted to be plus infinity. |
m | Number of constraints. |
g_L | Lower bounds on constraints. This array of size m is copied internally, so that the caller can change the incoming data after return without that IpoptProblem is modified. Any value less or equal than the number specified by option 'nlp_lower_bound_inf' is interpreted to be minus infinity. |
g_U | Upper bounds on constraints. This array of size m is copied internally, so that the caller can change the incoming data after return without that IpoptProblem is modified. Any value greater or equal than the number specified by option 'nlp_upper_bound_inf' is interpreted to be plus infinity. |
nele_jac | Number of non-zero elements in constraint Jacobian. |
nele_hess | Number of non-zero elements in Hessian of Lagrangian. |
index_style | indexing style for iRow & jCol, 0 for C style, 1 for Fortran style |
eval_f | Callback function for evaluating objective function |
eval_g | Callback function for evaluating constraint functions |
eval_grad_f | Callback function for evaluating gradient of objective function |
eval_jac_g | Callback function for evaluating Jacobian of constraint functions |
eval_h | Callback function for evaluating Hessian of Lagrangian function |
References IpoptProblemInfo::app, IpoptProblemInfo::eval_f, IpoptProblemInfo::eval_g, IpoptProblemInfo::eval_grad_f, IpoptProblemInfo::eval_h, IpoptProblemInfo::eval_jac_g, IpoptProblemInfo::g_L, IpoptProblemInfo::g_U, fkinkryx::i, IpoptProblemInfo::index_style, IpoptProblemInfo::m, IpoptProblemInfo::n, IpoptProblemInfo::nele_hess, IpoptProblemInfo::nele_jac, IpoptProblemInfo::x_L, and IpoptProblemInfo::x_U.
Referenced by F77_FUNC().
void FreeIpoptProblem | ( | IpoptProblem | ipopt_problem | ) |
Method for freeing a previously created IpoptProblem.
After freeing an IpoptProblem, it cannot be used anymore.
References IpoptProblemInfo::app, IpoptProblemInfo::g_L, IpoptProblemInfo::g_U, IpoptProblemInfo::m, IpoptProblemInfo::x_L, and IpoptProblemInfo::x_U.
Referenced by F77_FUNC().
enum ApplicationReturnStatus IpoptSolve | ( | IpoptProblem | ipopt_problem, | |
Number * | x, | |||
Number * | g, | |||
Number * | obj_val, | |||
Number * | mult_g, | |||
Number * | mult_x_L, | |||
Number * | mult_x_U, | |||
UserDataPtr | user_data | |||
) |
Function calling the Ipopt optimization algorithm for a problem previously defined with CreateIpoptProblem.
The return specified outcome of the optimization procedure (e.g., success, failure etc).
ipopt_problem | Problem that is to be optimized. Ipopt will use the options previously specified with AddIpoptOption (etc) for this problem. |
x | Input: Starting point Output: Optimal solution |
g | Values of constraint at final point (output only - ignored if set to NULL) |
obj_val | Final value of objective function (output only - ignored if set to NULL) |
mult_g | Final multipliers for constraints (output only - ignored if set to NULL) |
mult_x_L | Final multipliers for lower variable bounds (output only - ignored if set to NULL) |
mult_x_U | Final multipliers for upper variable bounds (output only - ignored if set to NULL) |
user_data | Pointer to user data. This will be passed unmodified to the callback functions. |
References IpoptProblemInfo::app, IpoptProblemInfo::eval_f, IpoptProblemInfo::eval_g, IpoptProblemInfo::eval_grad_f, IpoptProblemInfo::eval_h, IpoptProblemInfo::eval_jac_g, IpoptProblemInfo::g_L, IpoptProblemInfo::g_U, fkinkryx::i, IpoptProblemInfo::index_style, Ipopt::Invalid_Problem_Definition, Ipopt::J_ERROR, IpoptProblemInfo::m, IpoptProblemInfo::n, IpoptProblemInfo::nele_hess, IpoptProblemInfo::nele_jac, IpoptProblemInfo::x_L, and IpoptProblemInfo::x_U.
Referenced by F77_FUNC().
Bool OpenIpoptOutputFile | ( | IpoptProblem | ipopt_problem, | |
char * | file_name, | |||
Int | print_level | |||
) |
Function for opening an output file for a given name with given printlevel.
Returns false, if there was a problem opening the file.
References IpoptProblemInfo::app.
Referenced by F77_FUNC().