Utilities that relate simultaneously to both autodiff matrices and gradient matrices.
|
| template<typename Derived> |
| void | ExtractGradient (const Eigen::MatrixBase< Derived > &auto_diff_matrix, std::optional< int > num_derivatives, Eigen::Matrix< typename Derived::Scalar::Scalar, Derived::SizeAtCompileTime, Eigen::Dynamic > *gradient) |
| | Extracts the derivatives() portion from an AutoDiffScalar matrix into a pre-existing matrix (resizing if necessary).
|
| template<typename Derived> |
| Eigen::Matrix< typename Derived::Scalar::Scalar, Derived::SizeAtCompileTime, Eigen::Dynamic > | ExtractGradient (const Eigen::MatrixBase< Derived > &auto_diff_matrix, std::optional< int > num_derivatives={}) |
| | Returns the derivatives() portion from a matrix of AutoDiffScalar entries.
|
| template<typename DerivedValue, typename DerivedGradient, typename DerivedAutoDiff> |
| void | InitializeAutoDiff (const Eigen::MatrixBase< DerivedValue > &value, const Eigen::MatrixBase< DerivedGradient > &gradient, Eigen::MatrixBase< DerivedAutoDiff > *auto_diff_matrix) |
| | Initializes an AutoDiff matrix given a matrix of values and a gradient matrix.
|
| template<typename DerivedValue, typename DerivedGradient> |
| AutoDiffMatrixType< DerivedValue, DerivedGradient::ColsAtCompileTime > | InitializeAutoDiff (const Eigen::MatrixBase< DerivedValue > &value, const Eigen::MatrixBase< DerivedGradient > &gradient) |
| | Returns an AutoDiff matrix given a matrix of values and a gradient matrix.
|
| template<typename Derived> |
| decltype(auto) | DiscardZeroGradient (const Eigen::MatrixBase< Derived > &auto_diff_matrix, double precision=Eigen::NumTraits< double >::dummy_precision()) |
| | B = DiscardZeroGradient(A, precision) enables casting from a matrix of AutoDiffScalars to AutoDiffScalar::Scalar type, but first checking that the gradient matrix is empty or zero.
|
| template<typename Derived> |
| std::enable_if<!std::is_same_v< typenameDerived::Scalar, double >, int >::type | GetDerivativeSize (const Eigen::MatrixBase< Derived > &A) |
| | Given a matrix of AutoDiffScalars, returns the size of the derivatives.
|
| bool | AreAutoDiffVecXdEqual (const Eigen::Ref< const VectorX< AutoDiffXd > > &a, const Eigen::Ref< const VectorX< AutoDiffXd > > &b) |
| | Determines if a and b are equal.
|