Let NumericDiffFirstOrderFunction take a dynamically sized parameter vector

Also fix a template naming lint along the way.

Change-Id: Iabb98aeec2ff9609a19c3778b9ea2da37771c985
This commit is contained in:
Sameer Agarwal
2022-09-15 15:10:13 -07:00
committed by Sameer Agarwal
parent 6c27ac6d50
commit 4cd257cf4a
5 changed files with 129 additions and 29 deletions
@@ -76,7 +76,7 @@ namespace ceres {
// cost_function.AddParameterBlock(5);
// cost_function.AddParameterBlock(10);
// cost_function.SetNumResiduals(21);
template <typename CostFunctor, NumericDiffMethodType method = CENTRAL>
template <typename CostFunctor, NumericDiffMethodType kMethod = CENTRAL>
class DynamicNumericDiffCostFunction final : public DynamicCostFunction {
public:
explicit DynamicNumericDiffCostFunction(
@@ -134,7 +134,7 @@ class DynamicNumericDiffCostFunction final : public DynamicCostFunction {
for (size_t block = 0; block < block_sizes.size(); ++block) {
if (jacobians[block] != nullptr &&
!NumericDiff<CostFunctor,
method,
kMethod,
ceres::DYNAMIC,
internal::DynamicParameterDims,
ceres::DYNAMIC,