Add an accessor for the CostFunctor in DynamicAutoDiffCostFunction

https://github.com/ceres-solver/ceres-solver/issues/962

Change-Id: I50c327eb7ac09a894582ee3fb3311825607640c0
diff --git a/include/ceres/dynamic_autodiff_cost_function.h b/include/ceres/dynamic_autodiff_cost_function.h
index ce0f802..e47f32f 100644
--- a/include/ceres/dynamic_autodiff_cost_function.h
+++ b/include/ceres/dynamic_autodiff_cost_function.h
@@ -264,6 +264,8 @@
     return true;
   }
 
+  const CostFunctor& functor() const { return *functor_; }
+
  private:
   std::unique_ptr<CostFunctor> functor_;
   Ownership ownership_;