Skip to content

Commit

Permalink
Fix eval_jac_g error being silently ignored in TNLPAdapter::GetSpaces (
Browse files Browse the repository at this point in the history
…#697)

- throw INVALID_NLP exception now
  • Loading branch information
chrhansk authored Sep 16, 2023
1 parent 5a492e9 commit 5fc4842
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/Interfaces/IpTNLPAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1085,7 +1085,16 @@ bool TNLPAdapter::GetSpaces(
// Get the non zero structure
Index* g_iRow = new Index[nz_full_jac_g_];
Index* g_jCol = new Index[nz_full_jac_g_];
tnlp_->eval_jac_g(n_full_x_, NULL, false, n_full_g_, nz_full_jac_g_, g_iRow, g_jCol, NULL);

bool retval = tnlp_->eval_jac_g(n_full_x_, NULL, false, n_full_g_, nz_full_jac_g_, g_iRow, g_jCol, NULL);

if( !retval )
{
delete[] g_iRow;
delete[] g_jCol;

ASSERT_EXCEPTION(INVALID_TNLP, "eval_jac_g returned false in GetSpaces");
}

if( index_style_ != TNLP::FORTRAN_STYLE )
{
Expand Down

0 comments on commit 5fc4842

Please sign in to comment.