WPILibC++ 2023.4.3
drake Namespace Reference

Namespaces

namespace  assert
 
namespace  internal
 
namespace  math
 

Classes

class  never_destroyed
 Wraps an underlying type T such that its storage is a direct member field of this object (i.e., without any indirection into the heap), but unlike most member fields T's destructor is never invoked. More...
 

Functions

template<typename DerivedA , typename DerivedB >
bool is_approx_equal_abstol (const Eigen::MatrixBase< DerivedA > &m1, const Eigen::MatrixBase< DerivedB > &m2, double tolerance)
 Returns true if and only if the two matrices are equal to within a certain absolute elementwise tolerance. More...
 
template<typename DerivedA , typename DerivedB >
bool IsApproxEqualAbsTolWithPermutedColumns (const Eigen::MatrixBase< DerivedA > &m1, const Eigen::MatrixBase< DerivedB > &m2, double tolerance)
 Returns true if and only if a simple greedy search reveals a permutation of the columns of m2 to make the matrix equal to m1 to within a certain absolute elementwise tolerance. More...
 

Variables

constexpr bool kDrakeAssertIsArmed = true
 
constexpr bool kDrakeAssertIsDisarmed = false
 

Function Documentation

◆ is_approx_equal_abstol()

template<typename DerivedA , typename DerivedB >
bool drake::is_approx_equal_abstol ( const Eigen::MatrixBase< DerivedA > &  m1,
const Eigen::MatrixBase< DerivedB > &  m2,
double  tolerance 
)

Returns true if and only if the two matrices are equal to within a certain absolute elementwise tolerance.

Special values (infinities, NaN, etc.) do not compare as equal elements.

◆ IsApproxEqualAbsTolWithPermutedColumns()

template<typename DerivedA , typename DerivedB >
bool drake::IsApproxEqualAbsTolWithPermutedColumns ( const Eigen::MatrixBase< DerivedA > &  m1,
const Eigen::MatrixBase< DerivedB > &  m2,
double  tolerance 
)

Returns true if and only if a simple greedy search reveals a permutation of the columns of m2 to make the matrix equal to m1 to within a certain absolute elementwise tolerance.

E.g., there exists a P such that

   forall i,j,  |m1 - m2*P|_{i,j} <= tolerance
   where P is a permutation matrix:
      P(i,j)={0,1}, sum_i P(i,j)=1, sum_j P(i,j)=1.

Note: Returns false for matrices of different sizes. Note: The current implementation is O(n^2) in the number of columns. Note: In marginal cases (with similar but not identical columns) this algorithm can fail to find a permutation P even if it exists because it accepts the first column match (m1(i),m2(j)) and removes m2(j) from the pool. It is possible that other columns of m2 would also match m1(i) but that m2(j) is the only match possible for a later column of m1.

Variable Documentation

◆ kDrakeAssertIsArmed

constexpr bool drake::kDrakeAssertIsArmed = true
constexpr

◆ kDrakeAssertIsDisarmed

constexpr bool drake::kDrakeAssertIsDisarmed = false
constexpr