mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-31 01:20:38 +08:00
Sized cost function using variadic templates
This PR changes the interface of sized_cost_fucntion, autodiff_cost_function and numeric_diff_costfunction from using ten hardcoded parameter blocks to a variable number of parameter blocks using variadic templates. Trailing parameter blocks of size zero are now considered as error. Change-Id: I37b9a0a420ef0eda6476a46672bbf6bd57e19760
This commit is contained in:
@@ -134,12 +134,9 @@ class AutoDiffLocalParameterization : public LocalParameterization {
|
||||
|
||||
const double* parameter_ptrs[2] = {x, zero_delta};
|
||||
double* jacobian_ptrs[2] = { NULL, jacobian };
|
||||
return internal::AutoDiff<Functor, double, kGlobalSize, kLocalSize>
|
||||
::Differentiate(*functor_,
|
||||
parameter_ptrs,
|
||||
kGlobalSize,
|
||||
x_plus_delta,
|
||||
jacobian_ptrs);
|
||||
return internal::AutoDifferentiate<
|
||||
internal::StaticParameterDims<kGlobalSize, kLocalSize>>(
|
||||
*functor_, parameter_ptrs, kGlobalSize, x_plus_delta, jacobian_ptrs);
|
||||
}
|
||||
|
||||
virtual int GlobalSize() const { return kGlobalSize; }
|
||||
|
||||
Reference in New Issue
Block a user