Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QUESTION] the confused unit about ranges_inverse_sum and residual #157

Open
democheng opened this issue Dec 13, 2022 · 1 comment
Open

Comments

@democheng
Copy link

Have you read the documentation?

  • [✔] Yes
  • [] No - then this issue will be closed.

Post your theoretical questions / usage questions here.

my question is about the "ranges_inverse_sum" and the "residual" in registration.cc,

// the unit is m
double ranges_inverse_sum = ranges.sum();
// the unit is m
ranges_inverse_sum -= epsilon * ranges(idx);
// the unit is m^2
double residual = consensus_set_cardinal * x_hat(i) * x_hat(i) + sum_xi_square  - 2 * sum_xi * x_hat(i);
// the unit is confused
x_cost(i) = residual + ranges_inverse_sum;

so, I rewrite it like this:

// the unit is m^2
double ranges_inverse_sum = ranges.array().square().sum();
// the unit is m^2
ranges_inverse_sum -= epsilon * ranges(idx) * ranges(idx);
// the unit is m^2
double residual = consensus_set_cardinal * x_hat(i) * x_hat(i) + sum_xi_square  - 2 * sum_xi * x_hat(i);
// the unit is m^2
x_cost(i) = residual + ranges_inverse_sum;

Thank you in advance for answering my question.

@jingnanshi
Copy link
Member

Hi @democheng this is a good catch! Do you mind submitting a PR? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants