Ensure DynamicCostFunctionToFunctor to be exported

Fixes #1022

Change-Id: I090790ac4a1f32e6cb318bc32273d63898659dc3
This commit is contained in:
Sergiu Deitsch
2024-01-18 23:45:55 +01:00
parent 1b27b6610c
commit 2d2b7b57c7
3 changed files with 60 additions and 12 deletions
@@ -1,5 +1,5 @@
// Ceres Solver - A fast non-linear least squares minimizer
// Copyright 2023 Google Inc. All rights reserved.
// Copyright 2025 Google Inc. All rights reserved.
// http://ceres-solver.org/
//
// Redistribution and use in source and binary forms, with or without
@@ -105,20 +105,13 @@ namespace ceres {
class CERES_EXPORT DynamicCostFunctionToFunctor {
public:
// Takes ownership of cost_function.
explicit DynamicCostFunctionToFunctor(CostFunction* cost_function)
: DynamicCostFunctionToFunctor{
std::unique_ptr<CostFunction>{cost_function}} {}
explicit DynamicCostFunctionToFunctor(CostFunction* cost_function);
// Takes ownership of cost_function.
explicit DynamicCostFunctionToFunctor(
std::unique_ptr<CostFunction> cost_function)
: cost_function_(std::move(cost_function)) {
CHECK(cost_function_ != nullptr);
}
std::unique_ptr<CostFunction> cost_function);
bool operator()(double const* const* parameters, double* residuals) const {
return cost_function_->Evaluate(parameters, residuals, nullptr);
}
bool operator()(double const* const* parameters, double* residuals) const;
template <typename JetT>
bool operator()(JetT const* const* inputs, JetT* output) const {