Skip to content

Commit

Permalink
Add fix for boundaries outside of theta values
Browse files Browse the repository at this point in the history
  • Loading branch information
mattfidler committed Nov 12, 2024
1 parent 30969e7 commit f026e1d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/inner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5278,11 +5278,15 @@ NumericMatrix foceiCalcCov(Environment e){
// Upper only
checkUpperBound = true;
}
if (checkLowerBound && (std::fabs((cur-op_focei.lower[k])/cur) < op_focei.boundTol)) {
if (checkLowerBound &&
j < thetaNames.size() &&
(std::fabs((cur-op_focei.lower[k])/cur) < op_focei.boundTol)) {
boundary = true;
boundStr += "\"" + thetaNames[j] + "\" ";
}
if (checkUpperBound && (std::fabs((op_focei.upper[k]-cur)/cur) < op_focei.boundTol)) {
if (checkUpperBound &&
j < thetaNames.size() &&
(std::fabs((op_focei.upper[k]-cur)/cur) < op_focei.boundTol)) {
boundary = true;
boundStr += "\"" + thetaNames[j] + "\" ";
}
Expand Down

0 comments on commit f026e1d

Please sign in to comment.