25#include "hiopInterface.hpp"
26#include "hiopNlpFormulation.hpp"
44 const hiop::size_type ntdofs_loc, m_total;
45 hiop::size_type ntdofs_glob;
52 bool constr_info_is_current;
53 void UpdateConstrValsGrads(
const Vector x);
58 ntdofs_loc(
prob.input_size), m_total(
prob.GetNumConstraints()),
59 ntdofs_glob(ntdofs_loc),
61 constr_vals(m_total), constr_grads(m_total, ntdofs_loc),
62 constr_info_is_current(false)
66 comm = MPI_COMM_WORLD;
75 ntdofs_loc(
prob.input_size), m_total(
prob.GetNumConstraints()),
78 constr_vals(m_total), constr_grads(m_total, ntdofs_loc),
79 constr_info_is_current(false)
81 MPI_Allreduce(&ntdofs_loc, &ntdofs_glob, 1, MPI_HIOP_SIZE_TYPE, MPI_SUM, comm);
89 virtual bool get_prob_sizes(hiop::size_type& n, hiop::size_type& m);
95 using hiop::hiopInterfaceBase::get_starting_point;
97 virtual bool get_vars_info(
const hiop::size_type &n,
double *xlow,
double* xupp,
98 NonlinearityType* type);
102 virtual bool get_cons_info(
const hiop::size_type &m,
double *clow,
double *cupp,
103 NonlinearityType* type);
107 virtual bool eval_f(
const hiop::size_type &n,
const double *x,
bool new_x,
111 virtual bool eval_grad_f(
const hiop::size_type &n,
const double *x,
bool new_x,
136 virtual bool eval_cons(
const hiop::size_type &n,
const hiop::size_type &m,
137 const hiop::size_type &num_cons,
138 const hiop::index_type *idx_cons,
139 const double *x,
bool new_x,
double *cons);
141 using hiop::hiopInterfaceBase::eval_cons;
154 virtual bool eval_Jac_cons(
const hiop::size_type &n,
const hiop::size_type &m,
155 const hiop::size_type &num_cons,
156 const hiop::index_type *idx_cons,
157 const double *x,
bool new_x,
double *Jac);
159 using hiop::hiopInterfaceDenseConstraints::eval_Jac_cons;
168 hiop::index_type *cols);
177 const double *lambda,
182 double logbar_obj_value,
191 const double *lambda,
224 const double *lambda,
225 double obj_value)
const
231 double logbar_obj_value,
240 const double *lambda,
Data type dense matrix using column-major storage.
Users can inherit this class to access to HiOp-specific functionality.
virtual bool IterateCallback(int iter, double obj_value, double logbar_obj_value, int n, const double *x, const double *z_L, const double *z_U, int m_ineq, const double *s, int m, const double *g, const double *lambda, double inf_pr, double inf_du, double onenorm_pr_, double mu, double alpha_du, double alpha_pr, int ls_trials) const
See hiopInterfaceBase::iterate_callback(...).
HiOpProblem(int insize, const Operator *C_, const Operator *D_)
virtual void SolutionCallback(hiop::hiopSolveStatus status, hiop::size_type n, const double *x, const double *z_L, const double *z_U, hiop::size_type m, const double *g, const double *lambda, double obj_value) const
See hiopInterfaceBase::solution_callback(...).
Adapts the HiOp functionality to the MFEM OptimizationSolver interface.
virtual void Mult(const Vector &xt, Vector &x) const
Solves the optimization problem with xt as initial guess.
virtual ~HiopNlpOptimizer()
virtual void SetOptimizationProblem(const OptimizationProblem &prob)
HiopOptimizationProblem * hiop_problem
Internal class - adapts the OptimizationProblem class to HiOp's interface.
virtual bool get_cons_info(const hiop::size_type &m, double *clow, double *cupp, NonlinearityType *type)
virtual bool eval_grad_f(const hiop::size_type &n, const double *x, bool new_x, double *gradf)
void setStartingPoint(const Vector &x0)
virtual bool iterate_callback(int iter, double obj_value, double logbar_obj_value, int n, const double *x, const double *z_L, const double *z_U, int m_ineq, const double *s, int m, const double *g, const double *lambda, double inf_pr, double inf_du, double onenorm_pr_, double mu, double alpha_du, double alpha_pr, int ls_trials)
HiopOptimizationProblem(const OptimizationProblem &prob)
virtual bool get_prob_sizes(hiop::size_type &n, hiop::size_type &m)
HiopOptimizationProblem(const MPI_Comm &comm_, const OptimizationProblem &prob)
virtual bool eval_f(const hiop::size_type &n, const double *x, bool new_x, double &obj_value)
virtual bool get_vecdistrib_info(hiop::size_type global_n, hiop::index_type *cols)
virtual bool get_MPI_comm(MPI_Comm &comm_out)
virtual bool get_starting_point(const hiop::size_type &n, double *x0)
virtual void solution_callback(hiop::hiopSolveStatus status, hiop::size_type n, const double *x, const double *z_L, const double *z_U, hiop::size_type m, const double *g, const double *lambda, double obj_value)
virtual bool eval_cons(const hiop::size_type &n, const hiop::size_type &m, const hiop::size_type &num_cons, const hiop::index_type *idx_cons, const double *x, bool new_x, double *cons)
virtual bool eval_Jac_cons(const hiop::size_type &n, const hiop::size_type &m, const hiop::size_type &num_cons, const hiop::index_type *idx_cons, const double *x, bool new_x, double *Jac)
virtual bool get_vars_info(const hiop::size_type &n, double *xlow, double *xupp, NonlinearityType *type)
Abstract solver for OptimizationProblems.