Weighted squared distance under this metric.
- Parameters
-
| a | Left operand |
| b | Right operand |
- Returns
- Sum over axes of (weight * wrapped difference) squared
Definition at line 87 of file FeatureExtent.hpp.
88 {
89 const Eigen::VectorXd d =
delta(
a,
b);
90 double acc = 0.0;
91 for (Eigen::Index i = 0; i < d.size(); ++i) {
93 const double s = w * d(i);
94 acc += s * s;
95 }
96 return static_cast<float>(acc);
97 }
Eigen::VectorXd weights
Per-axis scale applied before differencing. Empty means unit weights.
Eigen::VectorXd delta(const Eigen::VectorXd &a, const Eigen::VectorXd &b) const
Componentwise difference, wrapped on any axis with a period.
References a, b, delta(), and weights.