Template Function beluga::calculate_covariance(Range&&, const Sophus::Vector2<Scalar>&)

Function Documentation

template<class Range, class Scalar>
Sophus::Matrix2<Scalar> beluga::calculate_covariance(Range &&range, const Sophus::Vector2<Scalar> &mean)

Convenience overload that calculates the covariance of a range given its mean for the case where all samples have the same weight.

Template Parameters:
  • Range – A sized range type whose value type is Sophus::Vector2<Scalar>.

  • Scalar – A scalar type, e.g. double or float.

Parameters:
  • range – Range to be used to calculate the covariance.

  • mean – The previously calculated mean of range. The value must be correct for the resulting covariance to be correct.

Returns:

The calculated covariance, as a Sophus::Matrix2<Scalar>.