mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-30 00:50:37 +08:00
NumericDiffCostFunction supports dynamic number of residuals.
1. Update AutoDiffCostFunction template parameters to be consistent with NumericDiffCostFunction. 2. Update the documentation for NumericDiffCostFunction and AutoDiffCostFunction. Change-Id: I113038abb5bedebb0f6f326f2a4ac31480d785fc
This commit is contained in:
committed by
Keir Mierle
parent
835ae9a639
commit
3a2158d728
@@ -184,5 +184,18 @@ TEST(NumericDiffCostFunction, EigenRowMajorColMajorTest) {
|
||||
new SizeTestingCostFunction<2,2>, ceres::TAKE_OWNERSHIP));
|
||||
}
|
||||
|
||||
TEST(NumericDiffCostFunction, EasyCaseFunctorCentralDifferencesAndDynamicNumResiduals) {
|
||||
internal::scoped_ptr<CostFunction> cost_function;
|
||||
cost_function.reset(
|
||||
new NumericDiffCostFunction<EasyFunctor,
|
||||
CENTRAL,
|
||||
ceres::DYNAMIC,
|
||||
5, /* size of x1 */
|
||||
5 /* size of x2 */>(
|
||||
new EasyFunctor, TAKE_OWNERSHIP, 3));
|
||||
EasyFunctor functor;
|
||||
functor.ExpectCostFunctionEvaluationIsNearlyCorrect(*cost_function, CENTRAL);
|
||||
}
|
||||
|
||||
} // namespace internal
|
||||
} // namespace ceres
|
||||
|
||||
Reference in New Issue
Block a user