diff --git a/ChangeLog.md b/ChangeLog.md index d352a3bbb..5bb6850ff 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -11,6 +11,8 @@ More detailed information about incremental changes can be found in the - Added option grad_f_constant to specify that objective function is linear. If set, the gradient of the objective will be requested by NLP only once. [#597] +- Added `OrigIpoptNLP::orig_d_L()` and `OrigIpoptNLP::orig_d_U()` to get + original constraint sides (before relaxation due to bound_relax_factor > 0). ### 3.14.9 (2022-07-21) diff --git a/src/Algorithm/IpOrigIpoptNLP.cpp b/src/Algorithm/IpOrigIpoptNLP.cpp index 357f832a9..e43f49009 100644 --- a/src/Algorithm/IpOrigIpoptNLP.cpp +++ b/src/Algorithm/IpOrigIpoptNLP.cpp @@ -347,6 +347,10 @@ bool OrigIpoptNLP::InitializeStructures( orig_x_L_ = ConstPtr(tmp); tmp = x_U->MakeNewCopy(); orig_x_U_ = ConstPtr(tmp); + tmp = d_L->MakeNewCopy(); + orig_d_L_ = ConstPtr(tmp); + tmp = d_U->MakeNewCopy(); + orig_d_U_ = ConstPtr(tmp); relax_bounds(-bound_relax_factor_, *x_L); relax_bounds(bound_relax_factor_, *x_U); diff --git a/src/Algorithm/IpOrigIpoptNLP.hpp b/src/Algorithm/IpOrigIpoptNLP.hpp index 33cd54662..75930d73f 100644 --- a/src/Algorithm/IpOrigIpoptNLP.hpp +++ b/src/Algorithm/IpOrigIpoptNLP.hpp @@ -241,6 +241,16 @@ class IPOPTLIB_EXPORT OrigIpoptNLP: public IpoptNLP return Pd_L_; } + /** Original lower bounds on d + * + * Returns NULL if bounds are not relaxed. + * @since 3.14.10 + */ + virtual SmartPtr orig_d_L() const + { + return orig_d_L_; + } + /** Upper bounds on d */ virtual SmartPtr d_U() const { @@ -253,6 +263,16 @@ class IPOPTLIB_EXPORT OrigIpoptNLP: public IpoptNLP return Pd_U_; } + /** Original upper bounds on d + * + * Returns NULL if bounds are not relaxed. + * @since 3.14.10 + */ + virtual SmartPtr orig_d_U() const + { + return orig_d_U_; + } + virtual SmartPtr HessianMatrixSpace() const { return h_space_; @@ -459,6 +479,12 @@ class IPOPTLIB_EXPORT OrigIpoptNLP: public IpoptNLP /** Original unmodified upper bounds on x */ SmartPtr orig_x_U_; + + /** Original unmodified lower bounds on d */ + SmartPtr orig_d_L_; + + /** Original unmodified upper bounds on d */ + SmartPtr orig_d_U_; ///@} /**@name Default Compiler Generated Methods