Skip to content

Commit

Permalink
use template cast for vec2f (#193)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #193

Hit compile error without the fix.
I wonder why CI didn't catch this problem. Is macos not covered?

Reviewed By: cdtwigg, jeongseok-meta

Differential Revision: D69079432

fbshipit-source-id: 8ba617c3b9224e37e41d9c9b372dde308b49f6a6
  • Loading branch information
lg-zhang authored and facebook-github-bot committed Feb 4, 2025
1 parent e87f7ac commit c4cd628
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions momentum/character_solver/limit_error_function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ double LimitErrorFunctionT<T>::getError(
if ((this->enabledParameters_.test(data.param1) ||
this->enabledParameters_.test(data.param2))) {
const Eigen::Vector2<T> p(params(data.param1), params(data.param2));
const T residual = p.dot(data.normal.cast<T>()) - data.offset;
const T residual = p.dot(data.normal.template cast<T>()) - data.offset;
if (residual < 0) {
error += residual * residual * limit.weight;
}
Expand Down Expand Up @@ -307,7 +307,7 @@ double LimitErrorFunctionT<T>::getGradient(
if ((this->enabledParameters_.test(data.param1) ||
this->enabledParameters_.test(data.param2))) {
const Eigen::Vector2<T> p(params(data.param1), params(data.param2));
const T residual = p.dot(data.normal.cast<T>()) - data.offset;
const T residual = p.dot(data.normal.template cast<T>()) - data.offset;
if (residual < 0.0f) {
error += residual * residual * limit.weight * tWeight;

Expand Down Expand Up @@ -568,7 +568,7 @@ double LimitErrorFunctionT<T>::getJacobian(
if ((this->enabledParameters_.test(data.param1) ||
this->enabledParameters_.test(data.param2))) {
const Eigen::Vector2<T> p(params(data.param1), params(data.param2));
const T res = p.dot(data.normal.cast<T>()) - data.offset;
const T res = p.dot(data.normal.template cast<T>()) - data.offset;
if (res < 0) {
error += res * res * limit.weight * tWeight;
residual(count) = res * wgt;
Expand Down

0 comments on commit c4cd628

Please sign in to comment.