Skip to content

Commit

Permalink
use z_U-z_L to initialize y_c for fixed vars treated as constraints
Browse files Browse the repository at this point in the history
- fixes #728
  • Loading branch information
svigerske committed Dec 12, 2023
1 parent a8e153f commit 363143b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 2 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ More detailed information about incremental changes can be found in the
### 3.14.14 (202x-yy-zz)

- Fixed build of MA57 interface when `FUNNY_MA57_FINT` is defined (MA57 with long integers).
- Fixed that initial dual values for fixed variables (z_L, z_U) were ignored when doing a
warm start with fixed_variable_treatment = make_constraint [#728].

### 3.14.13 (2023-11-08)

Expand Down
11 changes: 6 additions & 5 deletions src/Interfaces/IpTNLPAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1570,7 +1570,7 @@ bool TNLPAdapter::GetStartingPoint(
Number* full_z_u = new Number[n_full_x_];
Number* full_lambda = new Number[n_full_g_];
bool init_x = need_x;
bool init_z = need_z_L || need_z_U;
bool init_z = need_z_L || need_z_U || (fixed_variable_treatment_ == MAKE_CONSTRAINT && n_x_fixed_ > 0 && need_y_c);
bool init_lambda = need_y_c || need_y_d;

bool retvalue = tnlp_->get_starting_point(n_full_x_, init_x, full_x, init_z, full_z_l, full_z_u, n_full_g_,
Expand Down Expand Up @@ -1617,9 +1617,10 @@ bool TNLPAdapter::GetStartingPoint(
}
if( fixed_variable_treatment_ == MAKE_CONSTRAINT )
{
// ToDo maybe use info from z_L and Z_U here?
const Number zero = 0.;
IpBlasCopy(n_x_fixed_, &zero, 0, &values[P_c_g_->NCols()], 1);
for( Index i = 0; i < n_x_fixed_; i++ )
{
values[P_c_g_->NCols() + i] = full_z_u[x_fixed_map_[i]] - full_z_l[x_fixed_map_[i]];
}
}
}

Expand Down Expand Up @@ -2386,7 +2387,7 @@ void TNLPAdapter::GetQuasiNewtonApproximationSpaces(
else
{
SmartPtr<ExpansionMatrixSpace> ex_sp = new ExpansionMatrixSpace(n_x_free, nonfixed_nonlin_vars,
nonfixed_pos_nonlin_vars);
nonfixed_pos_nonlin_vars);
P_approx = ex_sp->MakeNew();
approx_space = new DenseVectorSpace(nonfixed_nonlin_vars);
}
Expand Down

0 comments on commit 363143b

Please sign in to comment.