From e5c3f4228a6a1e86ddbdbabaa23b99dc820c2146 Mon Sep 17 00:00:00 2001 From: dellaert Date: Mon, 6 Oct 2014 14:22:18 +0200 Subject: [PATCH] Some fixed size in UnaryExpression --- gtsam_unstable/nonlinear/Expression-inl.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gtsam_unstable/nonlinear/Expression-inl.h b/gtsam_unstable/nonlinear/Expression-inl.h index 786ee2b21..ab58dbf4c 100644 --- a/gtsam_unstable/nonlinear/Expression-inl.h +++ b/gtsam_unstable/nonlinear/Expression-inl.h @@ -310,7 +310,8 @@ class UnaryExpression: public ExpressionNode { public: - typedef boost::function)> Function; + typedef Eigen::Matrix JacobianTA; + typedef boost::function)> Function; private: @@ -344,16 +345,16 @@ public: virtual Augmented forward(const Values& values) const { using boost::none; Augmented argument = this->expressionA_->forward(values); - Matrix dTdA; + JacobianTA dTdA; T t = function_(argument.value(), - argument.constant() ? none : boost::optional(dTdA)); + argument.constant() ? none : boost::optional(dTdA)); return Augmented(t, dTdA, argument.jacobians()); } /// Trace structure for reverse AD struct Trace: public JacobianTrace { boost::shared_ptr > trace1; - Matrix dTdA; + JacobianTA dTdA; /// Start the reverse AD process virtual void reverseAD(JacobianMap& jacobians) const { trace1->reverseAD(dTdA, jacobians);