24 template <
typename indices_t, indices_t... kParameters>
33 template <
typename lhs_t,
typename rhs_t>
34 static auto run(
const Eigen::MatrixBase<lhs_t>& lhs,
35 const Eigen::MatrixBase<rhs_t>& rhs) {
39 template <
typename lhs_t,
typename rhs_t, std::size_t... kStorage>
40 static auto runImpl(
const Eigen::MatrixBase<lhs_t>& lhs,
41 const Eigen::MatrixBase<rhs_t>& rhs,
42 std::index_sequence<kStorage...>)
43 -> std::decay_t<decltype((lhs - rhs).eval())> {
44 EIGEN_STATIC_ASSERT_SAME_VECTOR_SIZE(lhs_t, rhs_t);
45 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(lhs_t,
sizeof...(kParameters));
46 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(rhs_t,
sizeof...(kParameters));
47 static_assert(
sizeof...(kParameters) ==
sizeof...(kStorage),
48 "Parameters and storage index packs must have the same size");
50 std::decay_t<decltype((lhs - rhs).eval())> residuals;
51 ((residuals[kStorage] =
53 lhs[kStorage], rhs[kStorage])),