Skip to content
Snippets Groups Projects
Commit b03fa10f authored by Timo Koch's avatar Timo Koch Committed by Mathis Kelm
Browse files

[tabulatedcomponent][bugfix] Clamp index to allowed range

parent 3c910454
No related branches found
No related tags found
1 merge request!3321Refactor tabulated component for multithreading
......@@ -1165,7 +1165,8 @@ private:
if (alphaT < 0 - 1e-7*nTemp || alphaT >= nTemp - 1 + 1e-7*nTemp)
return std::numeric_limits<Scalar>::quiet_NaN();
const auto iT = static_cast<int>(alphaT);
using std::clamp;
const auto iT = clamp<int>(static_cast<int>(alphaT), 0, nTemp - 2);
alphaT -= iT;
return values[iT ]*(1 - alphaT) +
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment