pydrake_autodiffutils.cc File Reference
#include <pybind11/pybind11.h>
#include <pybind11/eigen.h>
#include <pybind11/stl.h>
#include "drake/bindings/pybind11/pydrake_autodiff_types.h"
Include dependency graph for pydrake_autodiffutils.cc:


template<typename Derived >
AutoDiffXd eval (const Eigen::AutoDiffScalar< Derived > &x)
 Force Eigen to evaluate an autodiff expression. More...
 PYBIND11_PLUGIN (_pydrake_autodiffutils)

Function Documentation

AutoDiffXd eval ( const Eigen::AutoDiffScalar< Derived > &  x)

Force Eigen to evaluate an autodiff expression.

We need this function because, for example, adding two Eigen::AutoDiffXd values produces an Eigen::AutoDiffScalar<Eigen::CWiseBinaryOp> which cannot be returned to python. This just forces an evaluation and conversion to AutoDiffXd which would normally happen automatically in C++.

Here is the caller graph for this function:

PYBIND11_PLUGIN ( _pydrake_autodiffutils  )

Here is the call graph for this function: