Utilities for arithmetic on AutoDiffScalar.
#include <array>
#include <cmath>
#include <optional>
#include <tuple>
#include <utility>
#include <Eigen/Dense>
#include <unsupported/Eigen/AutoDiff>
#include "drake/common/autodiff.h"
#include "drake/common/eigen_types.h"
#include "drake/common/unused.h"
Namespaces | |
drake | |
drake::math | |
Typedefs | |
template<typename Derived , int nq> | |
using | AutoDiffMatrixType = MatrixLikewise< Eigen::AutoDiffScalar< Vector< typename Derived::Scalar, nq > >, Derived > |
The appropriate AutoDiffScalar matrix type given the value type and the number of derivatives at compile time. More... | |
Functions | |
template<typename Derived > | |
MatrixLikewise< typename Derived::Scalar::Scalar, Derived > | ExtractValue (const Eigen::MatrixBase< Derived > &auto_diff_matrix) |
Extracts the value() portion from a matrix of AutoDiffScalar entries. More... | |
template<typename Derived > | |
decltype(auto) | DiscardGradient (const Eigen::MatrixBase< Derived > &matrix) |
B = DiscardGradient(A) enables casting from a matrix of AutoDiffScalars to AutoDiffScalar::Scalar type, explicitly throwing away any gradient information. More... | |
template<typename Derived , typename DerivedAutoDiff > | |
void | InitializeAutoDiff (const Eigen::MatrixBase< Derived > &value, std::optional< int > num_derivatives, std::optional< int > deriv_num_start, Eigen::MatrixBase< DerivedAutoDiff > *auto_diff_matrix) |
Initializes a single AutoDiff matrix given the corresponding value matrix. More... | |
template<typename Derived , typename DerivedAutoDiff > | |
void | InitializeAutoDiff (const Eigen::MatrixBase< Derived > &value, Eigen::MatrixBase< DerivedAutoDiff > *auto_diff_matrix) |
Alternate signature provides default values for the number of derivatives (dynamic, determined at run time) and the starting index (0). More... | |
template<int nq = Eigen::Dynamic, typename Derived > | |
AutoDiffMatrixType< Derived, nq > | InitializeAutoDiff (const Eigen::MatrixBase< Derived > &value, std::optional< int > num_derivatives={}, std::optional< int > deriv_num_start={}) |
Initializes a single AutoDiff matrix given the corresponding value matrix. More... | |
template<typename... Deriveds> | |
auto | InitializeAutoDiffTuple (const Eigen::MatrixBase< Deriveds > &... args) |