3#include <IpIpoptCalculatedQuantities.hpp>
19 throw std::invalid_argument(
20 "All problem matrices should use the same index convention");
22 throw std::invalid_argument(
23 "Sparse matrix indices should start at 0 or 1");
28 throw std::invalid_argument(
"Hessian matrix should be symmetric");
97 throw std::logic_error(
"Missing required function: eval_jac_g");
98 if (values ==
nullptr) {
113 throw std::logic_error(
"Missing required function: eval_hess_L");
114 if (values ==
nullptr) {
118 auto eval_hess_L = [&](
rvec v) {
131 const Ipopt::IpoptData *
ip_data,
132 Ipopt::IpoptCalculatedQuantities *
ip_cq) {
IpoptAdapter(const Problem &problem)
vec initial_guess_bounds_multipliers
bool eval_g(Index n, const Number *x, bool new_x, Index m, Number *g) override
bool eval_grad_f(Index n, const Number *x, bool new_x, Number *grad_f) override
SparsityConv cvt_sparsity_jac_g
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) override
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) override
bool get_bounds_info(Index n, Number *x_l, Number *x_u, Index m, Number *g_l, Number *g_u) override
struct alpaqa::IpoptAdapter::Results results
bool eval_f(Index n, const Number *x, bool new_x, Number &obj_value) override
bool get_nlp_info(Index &n, Index &m, Index &nnz_jac_g, Index &nnz_h_lag, IndexStyleEnum &index_style) override
bool eval_jac_g(Index n, const Number *x, bool new_x, Index m, Index nele_jac, Index *iRow, Index *jCol, Number *values) override
vec initial_guess_multipliers
void finalize_solution(Ipopt::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, const Ipopt::IpoptData *ip_data, Ipopt::IpoptCalculatedQuantities *ip_cq) override
SparsityConv cvt_sparsity_hess_L
bool provides_eval_hess_L() const
Returns true if the problem provides an implementation of eval_hess_L.
const Box & get_box_D() const
[Optional] Get the rectangular constraint set of the general constraint function, .
void eval_jac_g(crvec x, rvec J_values) const
[Optional] Function that evaluates the nonzero values of the Jacobian matrix of the constraints,
bool provides_eval_jac_g() const
Returns true if the problem provides an implementation of eval_jac_g.
length_t get_n() const
[Required] Number of decision variables.
length_t get_m() const
[Required] Number of constraints.
void eval_grad_f(crvec x, rvec grad_fx) const
[Required] Function that evaluates the gradient of the cost,
real_t eval_f(crvec x) const
[Required] Function that evaluates the cost,
void eval_g(crvec x, rvec gx) const
[Required] Function that evaluates the constraints,
void eval_hess_L(crvec x, crvec y, real_t scale, rvec H_values) const
[Optional] Function that evaluates the nonzero values of the Hessian of the Lagrangian,
const Box & get_box_C() const
[Optional] Get the rectangular constraint set of the decision variables, .
Symmetry
Describes the symmetry of matrices.
typename Conf::cmvec cmvec
Ipopt::SolverReturn status