Drake
Drake C++ Documentation
drake::solvers::test Namespace Reference

Functions

void CheckConstraintEvalNonsymbolic (const Constraint &constraint, const Eigen::Ref< const AutoDiffVecXd > &x_autodiff, double tol)
 Compare the result between Eval<double>() and Eval<AutoDiffXd>(). More...
 

Function Documentation

◆ CheckConstraintEvalNonsymbolic()

void drake::solvers::test::CheckConstraintEvalNonsymbolic ( const Constraint constraint,
const Eigen::Ref< const AutoDiffVecXd > &  x_autodiff,
double  tol 
)

Compare the result between Eval<double>() and Eval<AutoDiffXd>().

Also compare the gradient in Eval<AutoDiffXd>() with a finite difference approximation.

Parameters
constraintThe constraint object to test.
x_autodiffThe point at which the Eval() methods are tested.
tolTolerance on the comparison of the results from Eval<double>() and Eval<AutoDiffXd>(). The tolerance on the comparison between the autodiff gradient and the finite difference approximation is sqrt(tolerance) to account for approximation error.