You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The function is for bounding \c var to the interval -a < var < a , but the code is
if (var < -a+epsilon)
{
return (-var - (a - epsilon));
}
if (var <= a-epsilon)
{
return 0.;
}
else
{
return (var - (a - epsilon));
}
inline double penaltyBoundToIntervalDerivative(const double& var,const double& a, const double& epsilon)
{
if (var < -a+epsilon)
{
return -1;
}
if (var <= a-epsilon)
{
return 0.;
}
else
{
return 1;
}
}
I think it should be if (var >= a-epsilon), the other overload funtion has the same problem
The text was updated successfully, but these errors were encountered:
charon-cheung
changed the title
I think something is wrong with penaltyBoundToInterval
I think something is wrong with penaltyBoundToInterval and penaltyBoundToIntervalDerivative
Feb 6, 2023
The function is for bounding \c var to the interval
-a < var < a
, but the code isI think it should be
if (var >= a-epsilon)
, the other overload funtion has the same problemThe text was updated successfully, but these errors were encountered: