maliput
maliput::math::test Namespace Reference

Classes

class  MockBoundingRegion
 

Enumerations

enum  CompareType { kAbsolute, kRelative }
 

Functions

template<std::size_t N, typename Derived >
testing::AssertionResult CompareVectors (const math::VectorBase< N, Derived > &v1, const math::VectorBase< N, Derived > &v2, double tolerance=0.0, CompareType compare_type=CompareType::kAbsolute)
 Assert that two vectors v1 and v2 are equal down to a certain tolerance. More...
 
template<std::size_t N>
testing::AssertionResult CompareMatrices (const math::Matrix< N > &m1, const math::Matrix< N > &m2, double tolerance=0.0, CompareType compare_type=CompareType::kAbsolute)
 Assert that two matrices m1 and m2 are equal down to a certain tolerance. More...
 

Enumeration Type Documentation

◆ CompareType

enum CompareType
strong
Enumerator
kAbsolute 
kRelative 

Function Documentation

◆ CompareMatrices()

testing::AssertionResult CompareMatrices ( const math::Matrix< N > &  m1,
const math::Matrix< N > &  m2,
double  tolerance = 0.0,
CompareType  compare_type = CompareType::kAbsolute 
)

Assert that two matrices m1 and m2 are equal down to a certain tolerance.

Instantiations for comparing Matrix2, Matrix3 and Matrix4 are provided.

Parameters
m1The first matrix to compare.
m2The second matrix to compare.
toleranceThe tolerance for determining equivalence.
compare_typeWhether the tolerance is absolute or relative.
Returns
::testing::AssertionSuccess if the two matrices are equal based on the specified tolerance, ::testing::AssertionFailure otherwise.

◆ CompareVectors()

testing::AssertionResult CompareVectors ( const math::VectorBase< N, Derived > &  v1,
const math::VectorBase< N, Derived > &  v2,
double  tolerance = 0.0,
CompareType  compare_type = CompareType::kAbsolute 
)

Assert that two vectors v1 and v2 are equal down to a certain tolerance.

Instantiations for comparing Vector2, Vector3 and Vector4 are provided.

Parameters
v1The first vector to compare.
v2The second vector to compare.
toleranceThe tolerance for determining equivalence.
compare_typeWhether the tolerance is absolute or relative.
Returns
::testing::AssertionSuccess if the two matrices are equal based on the specified tolerance, ::testing::AssertionFailure otherwise.