34 template <
typename index_container_t,
typename measured_t,
typename res
iduals_t>
36 const index_container_t& indices,
38 const Eigen::MatrixBase<measured_t>& measured,
39 Eigen::MatrixBase<residuals_t>& residuals) {
42 EIGEN_STATIC_ASSERT_VECTOR_ONLY(measured_t);
43 EIGEN_STATIC_ASSERT_VECTOR_ONLY(residuals_t);
45 assert((size <= measured.size()) and
"Inconsistent measured size");
46 assert((size <= residuals.size()) and
"Inconsistent residuals size");
48 for (
size_t i = 0;
i <
size; ++
i) {
49 size_t fullIndex = indices[
i];
57 residuals[
i] = difference_periodic<OutputScalar>(
58 measured[
i], reference[fullIndex],
59 static_cast<OutputScalar
>(2 * M_PI));
61 residuals[
i] = measured[
i] - reference[fullIndex];
79 template <
typename index_container_t,
typename measured_t,
typename res
iduals_t>
81 const index_container_t& indices,
83 const Eigen::MatrixBase<measured_t>& measured,
84 Eigen::MatrixBase<residuals_t>& residuals) {
85 EIGEN_STATIC_ASSERT_VECTOR_ONLY(measured_t);
86 EIGEN_STATIC_ASSERT_VECTOR_ONLY(residuals_t);
88 assert((size <= measured.size()) and
"Inconsistent measured size");
89 assert((size <= residuals.size()) and
"Inconsistent residuals size");
91 for (
size_t i = 0;
i <
size; ++
i) {
93 residuals[
i] = measured[
i] - reference[indices[
i]];