Add const accessor for functor wrapped by auto/numeric-diff objects

- The intended use-case for these accessors is in client code tests to
  support verification of the configuration with which cost functions
  were constructed.

Change-Id: Ib77afa6409804ba7f724138f579e0c51b154f5ad
This commit is contained in:
Alex Stewart
2022-02-06 21:14:16 +00:00
parent 9367ec9cc9
commit ce9669003a
6 changed files with 12 additions and 0 deletions
+2
View File
@@ -215,6 +215,8 @@ class AutoDiffCostFunction : public SizedCostFunction<kNumResiduals, Ns...> {
jacobians);
};
const CostFunctor & functor() const { return *functor_; }
private:
std::unique_ptr<CostFunctor> functor_;
Ownership ownership_;