- Main Page
- Namespaces
- Classes
- Files

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# Ipopt::StdInterfaceTNLP Class Reference

Implementation of a TNLP for the Standard C interface. More...

`#include <IpStdInterfaceTNLP.hpp>`

Inheritance diagram for Ipopt::StdInterfaceTNLP:

[legend]
Collaboration diagram for Ipopt::StdInterfaceTNLP:

[legend]
List of all members.

## Public Member Functions
Constructors/Destructors
| StdInterfaceTNLP (Index n_var, const Number *x_L, const Number *x_U, Index n_con, const Number *g_L, const Number *g_U, Index nele_jac, Index nele_hess, Index index_style, const Number *start_x, const Number *start_lam, const Number *start_z_L, const Number *start_z_U, 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, Number *x_sol, Number *z_L_sol, Number *z_U_sol, Number *g_sol, Number *lam_sol, Number *obj_sol, UserDataPtr user_data)
| Constructor, given dimensions of problem, function pointers for evaluation callback functions, and starting points.
virtual | ~StdInterfaceTNLP ()
| Default destructor.
methods to gather information about the NLP. These methods are
overloaded from TNLP. See TNLP for their more detailed documentation.
virtual bool | get_nlp_info (Index &n, Index &m, Index &nnz_jac_g, Index &nnz_h_lag, IndexStyleEnum &index_style)
| returns dimensions of the nlp.
virtual bool | get_bounds_info (Index n, Number *x_l, Number *x_u, Index m, Number *g_l, Number *g_u)
| returns bounds of the nlp.
virtual bool | get_starting_point (Index n, bool init_x, Number *x, bool init_z, Number *z_L, Number *z_U, Index m, bool init_lambda, Number *lambda)
| provides a starting point for the nlp variables.
virtual bool | eval_f (Index n, const Number *x, bool new_x, Number &obj_value)
| evaluates the objective value for the nlp.
virtual bool | eval_grad_f (Index n, const Number *x, bool new_x, Number *grad_f)
| evaluates the gradient of the objective for the nlp.
virtual bool | eval_g (Index n, const Number *x, bool new_x, Index m, Number *g)
| evaluates the constraint residuals for the nlp.
virtual bool | eval_jac_g (Index n, const Number *x, bool new_x, Index m, Index nele_jac, Index *iRow, Index *jCol, Number *values)
| specifies the jacobian structure (if values is NULL) and evaluates the jacobian values (if values is not NULL) for the nlp.
virtual bool | eval_h (Index n, const Number *x, bool new_x, Number obj_factor, Index m, const Number *lambda, bool new_lambda, Index nele_hess, Index *iRow, Index *jCol, Number *values)
| specifies the structure of the hessian of the lagrangian (if values is NULL) and evaluates the values (if values is not NULL).
Solution Methods
virtual void | finalize_solution (SolverReturn status, Index n, const Number *x, const Number *z_L, const Number *z_U, Index m, const Number *g, const Number *lambda, Number obj_value)
| This method is called when the algorithm is complete so the TNLP can store/write the solution.
## Private Member Functions
void | apply_new_x (bool new_x, Index n, const Number *x)
| Internal function to update the internal and ampl state if the x value changes.
Default Compiler Generated Methods
(Hidden to avoid implicit creation/calling). These methods are not implemented and we do not want the compiler to implement them for us, so we declare them private and do not define them. This ensures that they will not be implicitly created/called.
| StdInterfaceTNLP ()
| Default Constructor.
| StdInterfaceTNLP (const StdInterfaceTNLP &)
| Copy Constructor.
void | operator= (const StdInterfaceTNLP &)
| Overloaded Equals Operator.
## Private Attributes
SmartPtr< const Journalist > | jnlst_
| Journlist.
Number * | non_const_x_
| A non-const copy of x - this is kept up-to-date in apply_new_x.
Number * | x_sol_
| Pointers to the user provided vectors for solution.
Number * | z_L_sol_
Number * | z_U_sol_
Number * | g_sol_
Number * | lambda_sol_
Number * | obj_sol_
Information about the problem
const Index | n_var_
| Number of variables.
const Index | n_con_
| Number of constraints.
const Number * | x_L_
| Pointer to Number array containing lower bounds for variables.
const Number * | x_U_
| Pointer to Number array containing upper bounds for variables.
const Number * | g_L_
| Pointer to Number array containing lower bounds for constraints.
const Number * | g_U_
| Pointer to Number array containing upper bounds for constraints.
const Index | nele_jac_
| Number of non-zero elements in the constraint Jacobian.
const Index | nele_hess_
| Number of non-zero elements in the Hessian.
const Index | index_style_
| Starting value of the iRow and jCol parameters for matrices.
const Number * | start_x_
| Pointer to Number array containing starting point for variables.
const Number * | start_lam_
| Poitner to Number array containing starting values for constraint multipliers.
const Number * | start_z_L_
| Pointer to Number array containing starting values for lower bound multipliers.
const Number * | start_z_U_
| Pointer to Number array containing starting values for upper bound multipliers.
Eval_F_CB | eval_f_
| Pointer to callback function evaluating value of objective function.
Eval_G_CB | eval_g_
| Pointer to callback function evaluating value of constraints.
Eval_Grad_F_CB | eval_grad_f_
| Pointer to callback function evaluating gradient of objective function.
Eval_Jac_G_CB | eval_jac_g_
| Pointer to callback function evaluating Jacobian of constraints.
Eval_H_CB | eval_h_
| Pointer to callback function evaluating Hessian of Lagrangian.
UserDataPtr | user_data_
| Pointer to user data.

## Detailed Description

Implementation of a TNLP for the Standard C interface.

The standard C interface is exposed to the user as a single C function that is given problem dimension, starting points, and pointers for functions that evaluate objective function etc.

Definition at line 30 of file IpStdInterfaceTNLP.hpp.

## Constructor & Destructor Documentation

Ipopt::StdInterfaceTNLP::StdInterfaceTNLP | ( | Index | n_var,
|  | const Number * | x_L,
|  | const Number * | x_U,
|  | Index | n_con,
|  | const Number * | g_L,
|  | const Number * | g_U,
|  | Index | nele_jac,
|  | Index | nele_hess,
|  | Index | index_style,
|  | const Number * | start_x,
|  | const Number * | start_lam,
|  | const Number * | start_z_L,
|  | const Number * | start_z_U,
|  | 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,
|  | Number * | x_sol,
|  | Number * | z_L_sol,
|  | Number * | z_U_sol,
|  | Number * | g_sol,
|  | Number * | lam_sol,
|  | Number * | obj_sol,
|  | UserDataPtr | user_data |
| ) |  |  |

Constructor, given dimensions of problem, function pointers for evaluation callback functions, and starting points.

Note that the constrctor does not make a copy of any of the Number arrays, i.e. it is up to the called to keep them around.

virtual Ipopt::StdInterfaceTNLP::~StdInterfaceTNLP | ( |  | ) | `[virtual]`

Default destructor.

Ipopt::StdInterfaceTNLP::StdInterfaceTNLP | ( |  | ) | `[private]`

Default Constructor.

Ipopt::StdInterfaceTNLP::StdInterfaceTNLP | ( | const StdInterfaceTNLP & |  | ) | `[private]`

Copy Constructor.

## Member Function Documentation

virtual bool Ipopt::StdInterfaceTNLP::get_nlp_info | ( | Index & | n,
|  | Index & | m,
|  | Index & | nnz_jac_g,
|  | Index & | nnz_h_lag,
|  | IndexStyleEnum & | index_style |
| ) |  |  | `[virtual]`

returns dimensions of the nlp.

Overloaded from TNLP

virtual bool Ipopt::StdInterfaceTNLP::get_bounds_info | ( | Index | n,
|  | Number * | x_l,
|  | Number * | x_u,
|  | Index | m,
|  | Number * | g_l,
|  | Number * | g_u |
| ) |  |  | `[virtual]`

returns bounds of the nlp.

Overloaded from TNLP

Implements Ipopt::TNLP.

virtual bool Ipopt::StdInterfaceTNLP::get_starting_point | ( | Index | n,
|  | bool | init_x,
|  | Number * | x,
|  | bool | init_z,
|  | Number * | z_L,
|  | Number * | z_U,
|  | Index | m,
|  | bool | init_lambda,
|  | Number * | lambda |
| ) |  |  | `[virtual]`

provides a starting point for the nlp variables.

Overloaded from TNLP

Implements Ipopt::TNLP.

virtual bool Ipopt::StdInterfaceTNLP::eval_f | ( | Index | n,
|  | const Number * | x,
|  | bool | new_x,
|  | Number & | obj_value |
| ) |  |  | `[virtual]`

evaluates the objective value for the nlp.

Overloaded from TNLP

Implements Ipopt::TNLP.

virtual bool Ipopt::StdInterfaceTNLP::eval_grad_f | ( | Index | n,
|  | const Number * | x,
|  | bool | new_x,
|  | Number * | grad_f |
| ) |  |  | `[virtual]`

evaluates the gradient of the objective for the nlp.

Overloaded from TNLP

Implements Ipopt::TNLP.

virtual bool Ipopt::StdInterfaceTNLP::eval_g | ( | Index | n,
|  | const Number * | x,
|  | bool | new_x,
|  | Index | m,
|  | Number * | g |
| ) |  |  | `[virtual]`

evaluates the constraint residuals for the nlp.

Overloaded from TNLP

Implements Ipopt::TNLP.

virtual bool Ipopt::StdInterfaceTNLP::eval_jac_g | ( | Index | n,
|  | const Number * | x,
|  | bool | new_x,
|  | Index | m,
|  | Index | nele_jac,
|  | Index * | iRow,
|  | Index * | jCol,
|  | Number * | values |
| ) |  |  | `[virtual]`

specifies the jacobian structure (if values is NULL) and evaluates the jacobian values (if values is not NULL) for the nlp.

Overloaded from TNLP

Implements Ipopt::TNLP.

virtual bool Ipopt::StdInterfaceTNLP::eval_h | ( | Index | n,
|  | const Number * | x,
|  | bool | new_x,
|  | Number | obj_factor,
|  | Index | m,
|  | const Number * | lambda,
|  | bool | new_lambda,
|  | Index | nele_hess,
|  | Index * | iRow,
|  | Index * | jCol,
|  | Number * | values |
| ) |  |  | `[virtual]`

specifies the structure of the hessian of the lagrangian (if values is NULL) and evaluates the values (if values is not NULL).

Overloaded from TNLP

Reimplemented from Ipopt::TNLP.

virtual void Ipopt::StdInterfaceTNLP::finalize_solution | ( | SolverReturn | status,
|  | Index | n,
|  | const Number * | x,
|  | const Number * | z_L,
|  | const Number * | z_U,
|  | Index | m,
|  | const Number * | g,
|  | const Number * | lambda,
|  | Number | obj_value |
| ) |  |  | `[virtual]`

This method is called when the algorithm is complete so the TNLP can store/write the solution.

Implements Ipopt::TNLP.

void Ipopt::StdInterfaceTNLP::apply_new_x | ( | bool | new_x,
|  | Index | n,
|  | const Number * | x |
| ) |  |  | `[private]`

Internal function to update the internal and ampl state if the x value changes.

void Ipopt::StdInterfaceTNLP::operator= | ( | const StdInterfaceTNLP & |  | ) | `[private]`

Overloaded Equals Operator.

## Member Data Documentation

SmartPtr<const Journalist> Ipopt::StdInterfaceTNLP::jnlst_`[private]`

Journlist.

Definition at line 121 of file IpStdInterfaceTNLP.hpp.

const Index Ipopt::StdInterfaceTNLP::n_var_`[private]`

Number of variables.

Definition at line 126 of file IpStdInterfaceTNLP.hpp.

const Index Ipopt::StdInterfaceTNLP::n_con_`[private]`

Number of constraints.

Definition at line 128 of file IpStdInterfaceTNLP.hpp.

const Number* Ipopt::StdInterfaceTNLP::x_L_`[private]`

Pointer to Number array containing lower bounds for variables.

Definition at line 130 of file IpStdInterfaceTNLP.hpp.

const Number* Ipopt::StdInterfaceTNLP::x_U_`[private]`

Pointer to Number array containing upper bounds for variables.

Definition at line 132 of file IpStdInterfaceTNLP.hpp.

const Number* Ipopt::StdInterfaceTNLP::g_L_`[private]`

Pointer to Number array containing lower bounds for constraints.

Definition at line 134 of file IpStdInterfaceTNLP.hpp.

const Number* Ipopt::StdInterfaceTNLP::g_U_`[private]`

Pointer to Number array containing upper bounds for constraints.

Definition at line 136 of file IpStdInterfaceTNLP.hpp.

const Index Ipopt::StdInterfaceTNLP::nele_jac_`[private]`

Number of non-zero elements in the constraint Jacobian.

Definition at line 138 of file IpStdInterfaceTNLP.hpp.

const Index Ipopt::StdInterfaceTNLP::nele_hess_`[private]`

Number of non-zero elements in the Hessian.

Definition at line 140 of file IpStdInterfaceTNLP.hpp.

const Index Ipopt::StdInterfaceTNLP::index_style_`[private]`

Starting value of the iRow and jCol parameters for matrices.

Definition at line 142 of file IpStdInterfaceTNLP.hpp.

const Number* Ipopt::StdInterfaceTNLP::start_x_`[private]`

Pointer to Number array containing starting point for variables.

Definition at line 144 of file IpStdInterfaceTNLP.hpp.

const Number* Ipopt::StdInterfaceTNLP::start_lam_`[private]`

Poitner to Number array containing starting values for constraint multipliers.

Definition at line 147 of file IpStdInterfaceTNLP.hpp.

const Number* Ipopt::StdInterfaceTNLP::start_z_L_`[private]`

Pointer to Number array containing starting values for lower bound multipliers.

Definition at line 150 of file IpStdInterfaceTNLP.hpp.

const Number* Ipopt::StdInterfaceTNLP::start_z_U_`[private]`

Pointer to Number array containing starting values for upper bound multipliers.

Definition at line 153 of file IpStdInterfaceTNLP.hpp.

Eval_F_CB Ipopt::StdInterfaceTNLP::eval_f_`[private]`

Pointer to callback function evaluating value of objective function.

Definition at line 155 of file IpStdInterfaceTNLP.hpp.

Eval_G_CB Ipopt::StdInterfaceTNLP::eval_g_`[private]`

Pointer to callback function evaluating value of constraints.

Definition at line 157 of file IpStdInterfaceTNLP.hpp.

Eval_Grad_F_CB Ipopt::StdInterfaceTNLP::eval_grad_f_`[private]`

Pointer to callback function evaluating gradient of objective function.

Definition at line 160 of file IpStdInterfaceTNLP.hpp.

Eval_Jac_G_CB Ipopt::StdInterfaceTNLP::eval_jac_g_`[private]`

Pointer to callback function evaluating Jacobian of constraints.

Definition at line 162 of file IpStdInterfaceTNLP.hpp.

Eval_H_CB Ipopt::StdInterfaceTNLP::eval_h_`[private]`

Pointer to callback function evaluating Hessian of Lagrangian.

Definition at line 164 of file IpStdInterfaceTNLP.hpp.

UserDataPtr Ipopt::StdInterfaceTNLP::user_data_`[private]`

Pointer to user data.

Definition at line 166 of file IpStdInterfaceTNLP.hpp.

Number* Ipopt::StdInterfaceTNLP::non_const_x_`[private]`

A non-const copy of x - this is kept up-to-date in apply_new_x.

Definition at line 171 of file IpStdInterfaceTNLP.hpp.

Number* Ipopt::StdInterfaceTNLP::x_sol_`[private]`

Pointers to the user provided vectors for solution.

Definition at line 174 of file IpStdInterfaceTNLP.hpp.

Number* Ipopt::StdInterfaceTNLP::z_L_sol_`[private]`

Definition at line 175 of file IpStdInterfaceTNLP.hpp.

Number* Ipopt::StdInterfaceTNLP::z_U_sol_`[private]`

Definition at line 176 of file IpStdInterfaceTNLP.hpp.

Number* Ipopt::StdInterfaceTNLP::g_sol_`[private]`

Definition at line 177 of file IpStdInterfaceTNLP.hpp.

Number* Ipopt::StdInterfaceTNLP::lambda_sol_`[private]`

Definition at line 178 of file IpStdInterfaceTNLP.hpp.

Number* Ipopt::StdInterfaceTNLP::obj_sol_`[private]`

Definition at line 179 of file IpStdInterfaceTNLP.hpp.

The documentation for this class was generated from the following file:

- /home/coin/SVN-release/Ipopt-3.2.1/Ipopt/src/Interfaces/IpStdInterfaceTNLP.hpp