MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ distance_sq()

float MayaFlux::Kinesis::FeatureMetric::distance_sq ( const Eigen::VectorXd &  a,
const Eigen::VectorXd &  b 
) const
inline

Weighted squared distance under this metric.

Parameters
aLeft operand
bRight 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) {
92 const double w = (weights.size() == d.size()) ? weights(i) : 1.0;
93 const double s = w * d(i);
94 acc += s * s;
95 }
96 return static_cast<float>(acc);
97 }
size_t a
size_t b
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.

+ Here is the call graph for this function: