Helpers for defining scalars and values.
#include "drake/bindings/pydrake/autodiff_types_pybind.h"
#include "drake/bindings/pydrake/common/cpp_template_pybind.h"
#include "drake/bindings/pydrake/common/type_pack.h"
#include "drake/bindings/pydrake/pydrake_pybind.h"
#include "drake/bindings/pydrake/symbolic_types_pybind.h"
#include "drake/common/default_scalars.h"
Namespaces | |
drake | |
drake::pydrake | |
For more high-level information, see the Python Bindings technical notes. | |
Typedefs | |
using | CommonScalarPack = type_pack< double, AutoDiffXd, symbolic::Expression > |
Type pack defining common scalar types. More... | |
using | NonSymbolicScalarPack = type_pack< double, AutoDiffXd > |
Type pack for non-symbolic common scalar types. More... | |
Functions | |
template<typename T , typename PyClass , typename UPack = typename internal::CastUPack<T>::Pack> | |
void | DefCast (PyClass *cls, const char *doc, UPack U_pack={}) |
Binds cast<T>() explicitly. More... | |
Handling special non-POD scalar types. | |
Because we use dtype=object in NumPy, we cannot alias (share references to) the data underlying matrix objects when passing data between NumPy and Eigen (see #8116). The simple policy these functions help enforce:
| |
template<typename T > | |
py::return_value_policy | return_value_policy_for_scalar_type () |
Permits referencing for builtin dtypes (e.g., T == double), but then switches to copying for custom dtypes (T ∈ {AutoDiffXd, Expression}). More... | |
template<typename SomeBlock > | |
decltype(auto) | CopyIfNotPodType (const SomeBlock &x) |
A no-op for builtin dtypes (e.g., T == double), but then switches to copying for custom dtypes (T ∈ {AutoDiffXd, Expression}). More... | |