Skip to content

Commit

Permalink
remember unmodified d_L and d_U in OrigIpoptNLP
Browse files Browse the repository at this point in the history
  • Loading branch information
svigerske committed Aug 30, 2022
1 parent defda81 commit 96e88f7
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 4 additions & 0 deletions src/Algorithm/IpOrigIpoptNLP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
26 changes: 26 additions & 0 deletions src/Algorithm/IpOrigIpoptNLP.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<const Vector> orig_d_L() const
{
return orig_d_L_;
}

/** Upper bounds on d */
virtual SmartPtr<const Vector> d_U() const
{
Expand All @@ -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<const Vector> orig_d_U() const
{
return orig_d_U_;
}

virtual SmartPtr<const SymMatrixSpace> HessianMatrixSpace() const
{
return h_space_;
Expand Down Expand Up @@ -459,6 +479,12 @@ class IPOPTLIB_EXPORT OrigIpoptNLP: public IpoptNLP

/** Original unmodified upper bounds on x */
SmartPtr<const Vector> orig_x_U_;

/** Original unmodified lower bounds on d */
SmartPtr<const Vector> orig_d_L_;

/** Original unmodified upper bounds on d */
SmartPtr<const Vector> orig_d_U_;
///@}

/**@name Default Compiler Generated Methods
Expand Down

0 comments on commit 96e88f7

Please sign in to comment.