16 #include "../config/config.hpp"
17 #include "../general/globals.hpp"
25 #include "hiopInterface.hpp"
26 #include "hiopNlpFormulation.hpp"
44 const long long ntdofs_loc, m_total;
45 long long 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_LONG_LONG_INT,
96 virtual bool get_vars_info(
const long long& n,
double *xlow,
double* xupp,
97 NonlinearityType* type);
101 virtual bool get_cons_info(
const long long &m,
double *clow,
double *cupp,
102 NonlinearityType* type);
106 virtual bool eval_f(
const long long& n,
const double *x,
bool new_x,
110 virtual bool eval_grad_f(
const long long &n,
const double *x,
bool new_x,
135 virtual bool eval_cons(
const long long &n,
const long long &m,
136 const long long &num_cons,
const long long *idx_cons,
137 const double *x,
bool new_x,
double *cons);
149 virtual bool eval_Jac_cons(
const long long &n,
const long long &m,
150 const long long &num_cons,
151 const long long *idx_cons,
152 const double *x,
bool new_x,
double **Jac);
196 #endif //MFEM_USE_HIOP
197 #endif //MFEM_HIOP guard
virtual void SetOptimizationProblem(const OptimizationProblem &prob)
void setStartingPoint(const Vector &x0)
Data type dense matrix using column-major storage.
virtual void Mult(const Vector &xt, Vector &x) const
Solves the optimization problem with xt as initial guess.
HiopOptimizationProblem(const MPI_Comm &_comm, const OptimizationProblem &prob)
virtual ~HiopNlpOptimizer()
virtual bool get_MPI_comm(MPI_Comm &comm_out)
virtual bool eval_grad_f(const long long &n, const double *x, bool new_x, double *gradf)
virtual bool get_cons_info(const long long &m, double *clow, double *cupp, NonlinearityType *type)
virtual bool get_vars_info(const long long &n, double *xlow, double *xupp, NonlinearityType *type)
virtual bool get_prob_sizes(long long int &n, long long int &m)
virtual bool get_starting_point(const long long &n, double *x0)
Adapts the HiOp functionality to the MFEM OptimizationSolver interface.
Abstract solver for OptimizationProblems.
virtual bool get_vecdistrib_info(long long global_n, long long *cols)
virtual bool eval_cons(const long long &n, const long long &m, const long long &num_cons, const long long *idx_cons, const double *x, bool new_x, double *cons)
virtual bool eval_f(const long long &n, const double *x, bool new_x, double &obj_value)
HiopOptimizationProblem * hiop_problem
HiopOptimizationProblem(const OptimizationProblem &prob)
virtual bool eval_Jac_cons(const long long &n, const long long &m, const long long &num_cons, const long long *idx_cons, const double *x, bool new_x, double **Jac)
Internal class - adapts the OptimizationProblem class to HiOp's interface.