Utilities that relate simultaneously to both autodiff matrices and gradient matrices.
|
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={}) |
| Extracts the derivatives() portion from a matrix of AutoDiffScalar entries. More...
|
|
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. More...
|
|
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. More...
|
|
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. More...
|
|
template<typename Derived > |
std::enable_if<!std::is_same_v< typename Derived::Scalar, double >, int >::type | GetDerivativeSize (const Eigen::MatrixBase< Derived > &A) |
| Given a matrix of AutoDiffScalars, returns the size of the derivatives. More...
|
|
bool | AreAutoDiffVecXdEqual (const Eigen::Ref< const VectorX< AutoDiffXd >> &a, const Eigen::Ref< const VectorX< AutoDiffXd >> &b) |
| Determines if a and b are equal. More...
|
|