12 #ifndef ROOT_Math_IpoptMinimizer 13 #define ROOT_Math_IpoptMinimizer 28 #include <coin/IpTNLP.hpp> 29 #include <coin/IpSmartPtr.hpp> 32 #include <coin/IpIpoptApplication.hpp> 33 #include <coin/IpSolveStatistics.hpp> 84 using Ipopt::SolverReturn;
85 using Ipopt::IpoptData;
86 using Ipopt::IpoptCalculatedQuantities;
90 Ipopt::SmartPtr<Ipopt::IpoptApplication>
fIpotApp;
125 virtual bool get_nlp_info(Index &n, Index &
m, Index &nnz_jac_g, Index &nnz_h_lag, IndexStyleEnum &index_style);
147 virtual bool get_bounds_info(Index n, Number *x_l, Number *x_u, Index
m, Number *g_l, Number *g_u);
179 virtual bool get_starting_point(Index n,
bool init_x, Number *
x,
bool init_z, Number *z_L, Number *z_U, Index
m,
180 bool init_lambda, Number *lambda);
199 virtual bool eval_f(Index n,
const Number *
x,
bool new_x, Number &obj_value);
219 virtual bool eval_grad_f(Index n,
const Number *
x,
bool new_x, Number *grad_f);
239 virtual bool eval_g(Index n,
const Number *
x,
bool new_x, Index
m, Number *g);
273 virtual bool eval_jac_g(Index n,
const Number *
x,
bool new_x, Index
m, Index nele_jac, Index *iRow, Index *jCol,
294 virtual bool eval_h(Index n,
const Number *
x,
bool new_x, Number obj_factor, Index
m,
const Number *lambda,
295 bool new_lambda, Index nele_hess, Index *iRow, Index *jCol, Number *values);
335 virtual void finalize_solution(SolverReturn status, Index n,
const Number *
x,
const Number *z_L,
336 const Number *z_U, Index
m,
const Number *g,
const Number *lambda,
337 Number obj_value,
const IpoptData *ip_data, IpoptCalculatedQuantities *ip_cq);
405 virtual double Edm()
const {
return 0; }
417 virtual const double *
Errors()
const {
return 0; }
423 virtual double CovMatrix(
unsigned int,
unsigned int)
const {
return 0; }
IpoptMinimizer(const IpoptMinimizer &)
Copy constructor.
IpoptMinimizer * fMinimizer
Interface (abstract class) for multi-dimensional functions providing a gradient calculation.
Namespace for new ROOT classes and functions.
InternalTNLP & operator=(const InternalTNLP &)
Number nlp_lower_bound_inf
InternalTNLP(IpoptMinimizer *minimizer)
friend class IpoptMinimizer
virtual void SetOptionStringValue(const char *var, const char *value)
virtual ~IpoptMinimizer()
Destructor.
Number nlp_upper_bound_inf
Base Minimizer class, which defines the basic funcionality of various minimizer implementations (apar...
virtual void finalize_solution(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 IpoptData *ip_data, IpoptCalculatedQuantities *ip_cq)
This method is called by IPOPT after the algorithm has finished (successfully or even with most error...
virtual void SetNNZerosHessian(UInt_t nzeros)
virtual ~InternalTNLP()
default destructor
virtual bool eval_jac_g(Index n, const Number *x, bool new_x, Index m, Index nele_jac, Index *iRow, Index *jCol, Number *values)
Return either the sparsity structure of the Jacobian of the constraints, or the values for the Jacobi...
virtual void SetFunction(const ROOT::Math::IMultiGradFunction &func)
set the function to minimize
IpoptMinimizer & operator=(const IpoptMinimizer &rhs)
Assignment operator.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t Int_t m
virtual bool eval_grad_f(Index n, const Number *x, bool new_x, Number *grad_f)
Return the gradient of the objective function at the point .
Documentation for the abstract class IBaseFunctionMultiDim.
virtual double Edm() const
return expected distance reached from the minimum
virtual bool get_bounds_info(Index n, Number *x_l, Number *x_u, Index m, Number *g_l, Number *g_u)
Give IPOPT the value of the bounds on the variables and constraints.
virtual bool Minimize()
method to perform the minimization
virtual 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)
Return either the sparsity structure of the Hessian of the Lagrangian, or the values of the Hessian o...
virtual double CovMatrix(unsigned int, unsigned int) const
return covariance matrices elements if the variable is fixed the matrix is zero The ordering of the v...
virtual void SetFunction(const ROOT::Math::IMultiGenFunction &func)
set the function to minimize
virtual bool eval_f(Index n, const Number *x, bool new_x, Number &obj_value)
Return the value of the objective function at the point .
virtual bool ProvidesError() const
return pointer to gradient values at the minimum
virtual bool get_nlp_info(Index &n, Index &m, Index &nnz_jac_g, Index &nnz_h_lag, IndexStyleEnum &index_style)
Give IPOPT the information about the size of the problem (and hence, the size of the arrays that it n...
* x
Deprecated and error prone model selection interface.
EIpoptMinimizerSolver
enumeration specifying the types of Ipopt solvers
virtual const double * Errors() const
return errors at the minimum
Ipopt::SmartPtr< Ipopt::IpoptApplication > fIpotApp
virtual void SetFunction(const ROOT::Math::IMultiGenFunction &func)
set the function to minimize
Namespace for new Math classes and functions.
Ipopt::SmartPtr< InternalTNLP > fInternalTNLP
virtual 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)
Give IPOPT the starting point before it begins iterating.
virtual void SetNNZerosJacobian(UInt_t nzeros)
virtual bool eval_g(Index n, const Number *x, bool new_x, Index m, Number *g)
Return the value of the constraint function at the point .
Internal class to create a TNLP object, required for Ipopt minimization in c++, every method is overl...