28 struct residual_calculator;
31 template <
typename R,
ParID_t... params>
32 struct residual_calculator_impl;
35 struct residual_calculator {
38 static ParVector_t result(
const ParVector_t&
test,
const ParVector_t& ref) {
40 residual_calculator_impl<ParVector_t, params...>::calculate(result, test,
47 struct residual_calculator_impl<
R, first, others...> {
48 static void calculate(
R& result,
const R&
test,
const R& ref,
50 result(pos) = BoundParameterType<first>::getDifference(
test(pos), ref(pos));
51 residual_calculator_impl<R, others...>::calculate(result, test, ref,
56 template <
typename R, ParID_t last>
57 struct residual_calculator_impl<
R, last> {
58 static void calculate(
R& result,
const R& test,
const R& ref,
60 result(pos) = BoundParameterType<last>::getDifference(
test(pos), ref(pos));