Skip to content

Commit b908d35

Browse files
committed
KINSOL: add a more useful error message when an NLA system contains some Inf and/or NaN value.
1 parent ce39ffe commit b908d35

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/solver/solverkinsol.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ bool SolverKinsol::Impl::solve(ComputeObjectiveFunction pComputeObjectiveFunctio
389389
#ifndef CODE_COVERAGE_ENABLED
390390
if (userData.infOrNanFound) {
391391
#endif
392-
addError("The input vector contains some Inf and/or NaN values.");
392+
addError("The NLA system could not be solved (it contains some Inf and/or NaN values).");
393393
#ifndef CODE_COVERAGE_ENABLED
394394
} else {
395395
addError(mErrorMessage);

tests/api/sed/coveragetests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ TEST(CoverageSedTest, math)
590590
TEST(CoverageSedTest, KinsolWithInfAndOrNanValues)
591591
{
592592
static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES = {
593-
{libOpenCOR::Issue::Type::ERROR, "Task instance | KINSOL: the input vector contains some Inf and/or NaN values."},
593+
{libOpenCOR::Issue::Type::ERROR, "Task instance | KINSOL: the NLA system could not be solved (it contains some Inf and/or NaN values)."},
594594
};
595595

596596
auto file = libOpenCOR::File::create(libOpenCOR::resourcePath("api/sed/kinsol_with_inf_and_or_nan_values.cellml"));

0 commit comments

Comments
 (0)