|
Pipal
1.2.0
Penalty Interior-Point ALgorithm
|
Wrapper class for the Problem class. More...
#include <Problem.hxx>
Inherits Pipal::Problem< Real >.
Public Types | |
| using | ObjectiveFunc = std::function<bool(Vector<Real> const &, Real &)> |
| using | ConstraintsFunc = std::function<bool(Vector<Real> const &, Vector<Real> &)> |
| using | ObjectiveGradientFunc = std::function<bool(Vector<Real> const &, Vector<Real> &)> |
| using | ConstraintsJacobianFunc = std::function<bool(Vector<Real> const &, SparseMatrix<Real> &)> |
| using | LagrangianHessianFunc = std::function<bool(Vector<Real> const &, Vector<Real> const &, SparseMatrix<Real> &)> |
| using | BoundsFunc = std::function<bool(Vector<Real> &)> |
| Public Types inherited from Pipal::Problem< Real > | |
| using | UniquePtr = std::unique_ptr<Problem> |
Public Member Functions | |
| ProblemWrapper (std::string const &t_name, ObjectiveFunc const &t_objective, ObjectiveGradientFunc const &t_objective_gradient, ConstraintsFunc const &t_constraints, ConstraintsJacobianFunc const &t_constraints_jacobian, LagrangianHessianFunc const &t_lagrangian_hessian, BoundsFunc const &t_primal_lower_bounds, BoundsFunc const &t_primal_upper_bounds, BoundsFunc const &t_constraints_lower_bounds, BoundsFunc const &t_constraints_upper_bounds) | |
| Constructor for the ProblemWrapper class (without the Hessian of the Lagrangian). | |
| ~ProblemWrapper () override | |
| Default destructor for the ProblemWrapper class. | |
| ObjectiveFunc & | objective () |
| Get the objective function. | |
| void | objective (ObjectiveFunc const &objective) |
| Set the objective function. | |
| ObjectiveGradientFunc & | objective_gradient () |
| Get the gradient of the objective function. | |
| void | objective_gradient (ObjectiveGradientFunc const &objective_gradient) |
| Set the gradient of the objective function. | |
| ConstraintsFunc & | constraints () |
| Get the constraints function. | |
| void | constraints (ConstraintsFunc const &constraints) |
| Set the constraints function. | |
| ConstraintsJacobianFunc & | constraints_jacobian () |
| Get the Jacobian of the constraints function. | |
| void | constraints_jacobian (ConstraintsJacobianFunc const &constraints_jacobian) |
| Set the Jacobian of the constraints function. | |
| BoundsFunc & | primal_lower_bounds () |
| Get the lower bounds on the primal variables function. | |
| void | primal_lower_bounds (BoundsFunc const &primal_lower_bounds) |
| Set the lower bounds on the primal variables function. | |
| BoundsFunc & | primal_upper_bounds () |
| Get the upper bounds on the primal variables function. | |
| void | primal_upper_bounds (BoundsFunc const &primal_upper_bounds) |
| Set the upper bounds on the primal variables function. | |
| BoundsFunc & | constraints_lower_bounds () |
| Get the lower bounds on the constraints function. | |
| void | constraints_lower_bounds (BoundsFunc const &constraints_lower_bounds) |
| Set the lower bounds on the constraints function. | |
| BoundsFunc & | constraints_upper_bounds () |
| Get the upper bounds on the constraints function. | |
| void | constraints_upper_bounds (BoundsFunc const &constraints_upper_bounds) |
| Set the upper bounds on the constraints function. | |
| LagrangianHessianFunc & | lagrangian_hessian () |
| Get the Hessian of the Lagrangian function. | |
| void | lagrangian_hessian (LagrangianHessianFunc const &lagrangian_hessian) |
| Set the Hessian of the Lagrangian function. | |
| bool | objective (Vector< Real > const &x, Real &out) const override |
| Evaluate the objective function. | |
| bool | objective_gradient (Vector< Real > const &x, Vector< Real > &out) const override |
| Evaluate the gradient of the objective function. | |
| bool | constraints (Vector< Real > const &x, Vector< Real > &out) const override |
| Evaluate the constraints function. | |
| bool | constraints_jacobian (Vector< Real > const &x, SparseMatrix< Real > &out) const override |
| Evaluate the Jacobian of the constraints function. | |
| bool | lagrangian_hessian (Vector< Real > const &x, Vector< Real > const &l, SparseMatrix< Real > &out) const override |
| Evaluate the Hessian of the Lagrangian function. | |
| bool | primal_lower_bounds (Vector< Real > &out) const override |
| Lower bounds on the primal variables. | |
| bool | primal_upper_bounds (Vector< Real > &out) const override |
| Upper bounds on the primal variables. | |
| bool | constraints_lower_bounds (Vector< Real > &out) const override |
| Lower bounds on the constraints. | |
| bool | constraints_upper_bounds (Vector< Real > &out) const override |
| Upper bounds on the constraints. | |
| Public Member Functions inherited from Pipal::Problem< Real > | |
| Problem ()=default | |
| Default constructor. | |
| Problem (std::string t_name) | |
| Problem constructor. | |
| Problem (Problem const &)=delete | |
| Deleted copy constructor. | |
| Problem & | operator= (Problem const &)=delete |
| Deleted assignment operator. | |
| Problem (Problem &&)=delete | |
| Deleted move constructor. | |
| Problem & | operator= (Problem &&)=delete |
| Deleted move assignment operator. | |
| virtual | ~Problem ()=default |
| Default destructor. | |
| std::string const & | name () const |
| Get the name of the optimization problem. | |
| void | name (std::string const &t_name) |
| Set the name of the optimization problem. | |
Private Attributes | |
| ObjectiveFunc | m_objective {nullptr} |
| ObjectiveGradientFunc | m_objective_gradient {nullptr} |
| ConstraintsFunc | m_constraints {nullptr} |
| ConstraintsJacobianFunc | m_constraints_jacobian {nullptr} |
| LagrangianHessianFunc | m_lagrangian_hessian {nullptr} |
| BoundsFunc | m_primal_lower_bounds {nullptr} |
| BoundsFunc | m_primal_upper_bounds {nullptr} |
| BoundsFunc | m_constraints_lower_bounds {nullptr} |
| BoundsFunc | m_constraints_upper_bounds {nullptr} |
The ProblemWrapper class is a simple wrapper around the Problem class. It inherits from the Problem class and can be used to define optimization problems through function handles.
| Real | The real number type. |
| using Pipal::ProblemWrapper< Real >::BoundsFunc = std::function<bool(Vector<Real> &)> |
| using Pipal::ProblemWrapper< Real >::ConstraintsFunc = std::function<bool(Vector<Real> const &, Vector<Real> &)> |
| using Pipal::ProblemWrapper< Real >::ConstraintsJacobianFunc = std::function<bool(Vector<Real> const &, SparseMatrix<Real> &)> |
| using Pipal::ProblemWrapper< Real >::LagrangianHessianFunc = std::function<bool(Vector<Real> const &, Vector<Real> const &, SparseMatrix<Real> &)> |
| using Pipal::ProblemWrapper< Real >::ObjectiveFunc = std::function<bool(Vector<Real> const &, Real &)> |
| using Pipal::ProblemWrapper< Real >::ObjectiveGradientFunc = std::function<bool(Vector<Real> const &, Vector<Real> &)> |
|
inline |
Initializes the problem with the provided objective, gradient, constraints, and Jacobian functions.
| [in] | t_name | Name of the optimization problem. |
| [in] | t_objective | Objective function handle. |
| [in] | t_objective_gradient | Gradient of the objective function handle. |
| [in] | t_constraints | Constraints function handle. |
| [in] | t_constraints_jacobian | Jacobian of the constraints function handle. |
| [in] | t_lagrangian_hessian | Hessian of the Lagrangian function handle. |
| [in] | t_primal_lower_bounds | Lower bounds on the primal variables function handle. |
| [in] | t_primal_upper_bounds | Upper bounds on the primal variables function handle. |
| [in] | t_constraints_lower_bounds | Lower bounds on the constraints function handle. |
| [in] | t_constraints_upper_bounds | Upper bounds on the constraints function handle. |
|
inlineoverride |
|
inline |
|
inline |
| [in] | constraints | The constraints function to set. |
|
inlineoverridevirtual |
| [in] | x | Primal variables. |
| [out] | out | The value of the constraints function. |
Implements Pipal::Problem< Real >.
|
inline |
|
inline |
| [in] | constraints_jacobian | The Jacobian of the constraints function to set. |
|
inlineoverridevirtual |
| [in] | x | Primal variables. |
| [out] | out | The Jacobian matrix of the constraints function. |
Implements Pipal::Problem< Real >.
|
inline |
|
inline |
| [in] | constraints_lower_bounds | The lower bounds on the constraints function to set. |
|
inlineoverridevirtual |
| [out] | out | The lower bounds on the constraints. |
Implements Pipal::Problem< Real >.
|
inline |
|
inline |
| [in] | constraints_upper_bounds | The upper bounds on the constraints function to set. |
|
inlineoverridevirtual |
| [out] | out | The upper bounds on the constraints. |
Implements Pipal::Problem< Real >.
|
inline |
|
inline |
| [in] | lagrangian_hessian | The Hessian of the Lagrangian function to set. |
|
inlineoverridevirtual |
| [in] | x | Primal variables. |
| [in] | l | Dual variables. |
| [out] | out | The Hessian matrix of the Lagrangian function. |
Implements Pipal::Problem< Real >.
|
inline |
|
inline |
| [in] | objective | The objective function to set. |
|
inlineoverridevirtual |
| [in] | x | Primal variables. |
| [out] | out | The objective function. |
Implements Pipal::Problem< Real >.
|
inline |
|
inline |
| [in] | objective_gradient | The gradient of the objective function to set. |
|
inlineoverridevirtual |
| [in] | x | Primal variables. |
| [out] | out | The gradient of the objective function. |
Implements Pipal::Problem< Real >.
|
inline |
|
inline |
| [in] | primal_lower_bounds | The lower bounds on the primal variables function to set. |
|
inlineoverridevirtual |
| [out] | out | The lower bounds on the primal variables. |
Implements Pipal::Problem< Real >.
|
inline |
|
inline |
| [in] | primal_upper_bounds | The upper bounds on the primal variables function to set. |
|
inlineoverridevirtual |
| [out] | out | The upper bounds on the primal variables. |
Implements Pipal::Problem< Real >.
|
private |
Constraints function.
|
private |
Jacobian of the constraints.
|
private |
Lower bounds on the constraints.
|
private |
Upper bounds on the constraints.
|
private |
Hessian of the Lagrangian.
|
private |
Objective function.
|
private |
Gradient of the objective function.
|
private |
Lower bounds on the primal variables.
|
private |
Upper bounds on the primal variables.