16 #include "../config/config.hpp"
17 #include "../general/globals.hpp"
20 #include "operator.hpp"
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);
204 #endif //MFEM_USE_HIOP
205 #endif //MFEM_HIOP guard
virtual void SetOptimizationProblem(const OptimizationProblem &prob)
void setStartingPoint(const Vector &x0)
Data type dense matrix using column-major storage.
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 get_cons_info(const hiop::size_type &m, double *clow, double *cupp, NonlinearityType *type)
virtual void Mult(const Vector &xt, Vector &x) const
Solves the optimization problem with xt as initial guess.
virtual ~HiopNlpOptimizer()
virtual bool get_MPI_comm(MPI_Comm &comm_out)
virtual bool get_vars_info(const hiop::size_type &n, double *xlow, double *xupp, NonlinearityType *type)
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_starting_point(const hiop::size_type &n, double *x0)
virtual bool get_vecdistrib_info(hiop::size_type global_n, hiop::index_type *cols)
Adapts the HiOp functionality to the MFEM OptimizationSolver interface.
virtual bool eval_grad_f(const hiop::size_type &n, const double *x, bool new_x, double *gradf)
Abstract solver for OptimizationProblems.
HiopOptimizationProblem(const MPI_Comm &comm_, const OptimizationProblem &prob)
virtual bool get_prob_sizes(hiop::size_type &n, hiop::size_type &m)
virtual bool eval_f(const hiop::size_type &n, const double *x, bool new_x, double &obj_value)
HiopOptimizationProblem * hiop_problem
HiopOptimizationProblem(const OptimizationProblem &prob)
Internal class - adapts the OptimizationProblem class to HiOp's interface.