Drake
drake::util Namespace Reference

Enumerations

enum  MatrixCompareType { absolute, relative }
 

Functions

template<typename DerivedA , typename DerivedB >
bool CompareMatrices (const Eigen::MatrixBase< DerivedA > &m1, const Eigen::MatrixBase< DerivedB > &m2, double tolerance, MatrixCompareType compare_type, std::string *explanation=nullptr)
 Compares two matrices to determine whether they are equal to within a certain threshold. More...
 

Enumeration Type Documentation

Enumerator
absolute 
relative 

Function Documentation

bool drake::util::CompareMatrices ( const Eigen::MatrixBase< DerivedA > &  m1,
const Eigen::MatrixBase< DerivedB > &  m2,
double  tolerance,
MatrixCompareType  compare_type,
std::string *  explanation = nullptr 
)

Compares two matrices to determine whether they are equal to within a certain threshold.

Parameters
m1The first matrix to compare.
m2The second matrix to compare.
toleranceThe tolerance for determining equivalence.
compare_typeWhether the tolereance is absolute or relative.
explanationA pointer to a string variable for saving an explanation of why m1 and m2 are unequal. This parameter is optional and defaults to nullptr.
Returns
true if the two matrices are equal based on the specified tolerance.

Here is the call graph for this function:

Here is the caller graph for this function: