diff options
Diffstat (limited to 'extern/ceres/include/ceres/internal/variadic_evaluate.h')
-rw-r--r-- | extern/ceres/include/ceres/internal/variadic_evaluate.h | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/extern/ceres/include/ceres/internal/variadic_evaluate.h b/extern/ceres/include/ceres/internal/variadic_evaluate.h index 046832c0bb4..47ff6b18fa0 100644 --- a/extern/ceres/include/ceres/internal/variadic_evaluate.h +++ b/extern/ceres/include/ceres/internal/variadic_evaluate.h @@ -46,8 +46,10 @@ namespace internal { // For fixed size cost functors template <typename Functor, typename T, int... Indices> -inline bool VariadicEvaluateImpl(const Functor& functor, T const* const* input, - T* output, std::false_type /*is_dynamic*/, +inline bool VariadicEvaluateImpl(const Functor& functor, + T const* const* input, + T* output, + std::false_type /*is_dynamic*/, std::integer_sequence<int, Indices...>) { static_assert(sizeof...(Indices), "Invalid number of parameter blocks. At least one parameter " @@ -57,26 +59,31 @@ inline bool VariadicEvaluateImpl(const Functor& functor, T const* const* input, // For dynamic sized cost functors template <typename Functor, typename T> -inline bool VariadicEvaluateImpl(const Functor& functor, T const* const* input, - T* output, std::true_type /*is_dynamic*/, +inline bool VariadicEvaluateImpl(const Functor& functor, + T const* const* input, + T* output, + std::true_type /*is_dynamic*/, std::integer_sequence<int>) { return functor(input, output); } // For ceres cost functors (not ceres::CostFunction) template <typename ParameterDims, typename Functor, typename T> -inline bool VariadicEvaluateImpl(const Functor& functor, T const* const* input, - T* output, const void* /* NOT USED */) { +inline bool VariadicEvaluateImpl(const Functor& functor, + T const* const* input, + T* output, + const void* /* NOT USED */) { using ParameterBlockIndices = std::make_integer_sequence<int, ParameterDims::kNumParameterBlocks>; using IsDynamic = std::integral_constant<bool, ParameterDims::kIsDynamic>; - return VariadicEvaluateImpl(functor, input, output, IsDynamic(), - ParameterBlockIndices()); + return VariadicEvaluateImpl( + functor, input, output, IsDynamic(), ParameterBlockIndices()); } // For ceres::CostFunction template <typename ParameterDims, typename Functor, typename T> -inline bool VariadicEvaluateImpl(const Functor& functor, T const* const* input, +inline bool VariadicEvaluateImpl(const Functor& functor, + T const* const* input, T* output, const CostFunction* /* NOT USED */) { return functor.Evaluate(input, output, nullptr); @@ -95,7 +102,8 @@ inline bool VariadicEvaluateImpl(const Functor& functor, T const* const* input, // blocks. The signature of the functor must have the following signature // 'bool()(const T* i_1, const T* i_2, ... const T* i_n, T* output)'. template <typename ParameterDims, typename Functor, typename T> -inline bool VariadicEvaluate(const Functor& functor, T const* const* input, +inline bool VariadicEvaluate(const Functor& functor, + T const* const* input, T* output) { return VariadicEvaluateImpl<ParameterDims>(functor, input, output, &functor); } |