diff --git a/momentum/character_solver/limit_error_function.cpp b/momentum/character_solver/limit_error_function.cpp index 2d8d392a..5e468f4a 100644 --- a/momentum/character_solver/limit_error_function.cpp +++ b/momentum/character_solver/limit_error_function.cpp @@ -239,10 +239,10 @@ double LimitErrorFunctionT::getGradient( error += residual * residual * limit.weight * tWeight; if (this->enabledParameters_.test(data.targetIndex)) { - gradient[data.targetIndex] += T(2) * residual * data.scale * tWeight; + gradient[data.targetIndex] += T(2) * residual * data.scale * limit.weight * tWeight; } if (this->enabledParameters_.test(data.referenceIndex)) { - gradient[data.referenceIndex] -= T(2) * residual * tWeight; + gradient[data.referenceIndex] -= T(2) * residual * limit.weight * tWeight; } } break; diff --git a/momentum/test/character_solver/error_functions_test.cpp b/momentum/test/character_solver/error_functions_test.cpp index 2aea5be9..7853efda 100644 --- a/momentum/test/character_solver/error_functions_test.cpp +++ b/momentum/test/character_solver/error_functions_test.cpp @@ -106,7 +106,7 @@ TYPED_TEST(Momentum_ErrorFunctionsTest, LimitError_GradientsAndJacobians) { SCOPED_TRACE("Limit LinearTest"); ParameterLimit limit; limit.type = Linear; - limit.weight = 1.0; + limit.weight = 1.5; limit.data.linear.referenceIndex = 0; limit.data.linear.targetIndex = 5; limit.data.linear.scale = 0.25; @@ -134,7 +134,7 @@ TYPED_TEST(Momentum_ErrorFunctionsTest, LimitError_GradientsAndJacobians) { limit.type = LimitType::Linear; limit.data.linear.referenceIndex = 0; limit.data.linear.targetIndex = 5; - limit.weight = 1.0f; + limit.weight = 0.5f; { ParameterLimit cur = limit;