Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
Catch::Matchers::Vector::ApproxMatcher< T > Struct Template Reference

#include <catch_matchers_vector.h>

Inheritance diagram for Catch::Matchers::Vector::ApproxMatcher< T >:
Collaboration diagram for Catch::Matchers::Vector::ApproxMatcher< T >:

Public Member Functions

 ApproxMatcher (std::vector< T > const &comparator)
 
bool match (std::vector< T > const &v) const override
 
std::string describe () const override
 
template<typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
ApproxMatcherepsilon (T const &newEpsilon)
 
template<typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
ApproxMatchermargin (T const &newMargin)
 
template<typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
ApproxMatcherscale (T const &newScale)
 
 ApproxMatcher (std::vector< T > const &comparator)
 
bool match (std::vector< T > const &v) const override
 
std::string describe () const override
 
template<typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
ApproxMatcherepsilon (T const &newEpsilon)
 
template<typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
ApproxMatchermargin (T const &newMargin)
 
template<typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
ApproxMatcherscale (T const &newScale)
 
- Public Member Functions inherited from Catch::Matchers::Impl::MatcherBase< T >
MatchAllOf< Toperator&& (MatcherBase const &other) const
 
MatchAnyOf< Toperator|| (MatcherBase const &other) const
 
MatchNotOf< Toperator! () const
 
MatchAllOf< Toperator&& (MatcherBase const &other) const
 
MatchAnyOf< Toperator|| (MatcherBase const &other) const
 
MatchNotOf< Toperator! () const
 
- Public Member Functions inherited from Catch::Matchers::Impl::MatcherUntypedBase
 MatcherUntypedBase ()=default
 
 MatcherUntypedBase (MatcherUntypedBase const &)=default
 
MatcherUntypedBaseoperator= (MatcherUntypedBase const &)=delete
 
std::string toString () const
 
 MatcherUntypedBase ()=default
 
 MatcherUntypedBase (MatcherUntypedBase const &)=default
 
MatcherUntypedBaseoperator= (MatcherUntypedBase const &)=delete
 
std::string toString () const
 
- Public Member Functions inherited from Catch::Matchers::Impl::MatcherMethod< T >
virtual bool match (T const &arg) const=0
 
virtual bool match (T const &arg) const=0
 

Public Attributes

std::vector< T > const & m_comparator
 
Catch::Detail::Approx approx = Catch::Detail::Approx::custom()
 

Additional Inherited Members

- Protected Member Functions inherited from Catch::Matchers::Impl::MatcherUntypedBase
virtual ~MatcherUntypedBase ()
 
virtual ~MatcherUntypedBase ()
 
- Protected Attributes inherited from Catch::Matchers::Impl::MatcherUntypedBase
std::string m_cachedToString
 

Detailed Description

template<typename T>
struct Catch::Matchers::Vector::ApproxMatcher< T >

Definition at line 3279 of file catch.hpp.

Constructor & Destructor Documentation

◆ ApproxMatcher() [1/2]

template<typename T >
Catch::Matchers::Vector::ApproxMatcher< T >::ApproxMatcher ( std::vector< T > const & comparator)
inline

Definition at line 97 of file catch_matchers_vector.h.

97: m_comparator( comparator ) {}

◆ ApproxMatcher() [2/2]

template<typename T >
Catch::Matchers::Vector::ApproxMatcher< T >::ApproxMatcher ( std::vector< T > const & comparator)
inline

Definition at line 3281 of file catch.hpp.

3281: m_comparator( comparator ) {}

Member Function Documentation

◆ describe() [1/2]

template<typename T >
std::string Catch::Matchers::Vector::ApproxMatcher< T >::describe ( ) const
inlineoverridevirtual

Implements Catch::Matchers::Impl::MatcherUntypedBase.

Definition at line 107 of file catch_matchers_vector.h.

107 {
108 return "is approx: " + ::Catch::Detail::stringify( m_comparator );
109 }
std::string stringify(const T &e)
Here is the call graph for this function:

◆ describe() [2/2]

template<typename T >
std::string Catch::Matchers::Vector::ApproxMatcher< T >::describe ( ) const
inlineoverridevirtual

Implements Catch::Matchers::Impl::MatcherUntypedBase.

Definition at line 3291 of file catch.hpp.

3291 {
3292 return "is approx: " + ::Catch::Detail::stringify( m_comparator );
3293 }
Here is the call graph for this function:

◆ epsilon() [1/2]

template<typename T >
template<typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
ApproxMatcher & Catch::Matchers::Vector::ApproxMatcher< T >::epsilon ( T const & newEpsilon)
inline

Definition at line 111 of file catch_matchers_vector.h.

111 {
112 approx.epsilon(newEpsilon);
113 return *this;
114 }
Approx & epsilon(T const &newEpsilon)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ epsilon() [2/2]

template<typename T >
template<typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
ApproxMatcher & Catch::Matchers::Vector::ApproxMatcher< T >::epsilon ( T const & newEpsilon)
inline

Definition at line 3295 of file catch.hpp.

3295 {
3296 approx.epsilon(newEpsilon);
3297 return *this;
3298 }
Here is the call graph for this function:

◆ margin() [1/2]

template<typename T >
template<typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
ApproxMatcher & Catch::Matchers::Vector::ApproxMatcher< T >::margin ( T const & newMargin)
inline

Definition at line 116 of file catch_matchers_vector.h.

116 {
117 approx.margin(newMargin);
118 return *this;
119 }
Approx & margin(T const &newMargin)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ margin() [2/2]

template<typename T >
template<typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
ApproxMatcher & Catch::Matchers::Vector::ApproxMatcher< T >::margin ( T const & newMargin)
inline

Definition at line 3300 of file catch.hpp.

3300 {
3301 approx.margin(newMargin);
3302 return *this;
3303 }
Here is the call graph for this function:

◆ match() [1/2]

template<typename T >
bool Catch::Matchers::Vector::ApproxMatcher< T >::match ( std::vector< T > const & v) const
inlineoverride

Definition at line 99 of file catch_matchers_vector.h.

99 {
100 if (m_comparator.size() != v.size())
101 return false;
102 for (std::size_t i = 0; i < v.size(); ++i)
103 if (m_comparator[i] != approx(v[i]))
104 return false;
105 return true;
106 }

◆ match() [2/2]

template<typename T >
bool Catch::Matchers::Vector::ApproxMatcher< T >::match ( std::vector< T > const & v) const
inlineoverride

Definition at line 3283 of file catch.hpp.

3283 {
3284 if (m_comparator.size() != v.size())
3285 return false;
3286 for (std::size_t i = 0; i < v.size(); ++i)
3287 if (m_comparator[i] != approx(v[i]))
3288 return false;
3289 return true;
3290 }

◆ scale() [1/2]

template<typename T >
template<typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
ApproxMatcher & Catch::Matchers::Vector::ApproxMatcher< T >::scale ( T const & newScale)
inline

Definition at line 121 of file catch_matchers_vector.h.

121 {
122 approx.scale(newScale);
123 return *this;
124 }
Approx & scale(T const &newScale)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ scale() [2/2]

template<typename T >
template<typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
ApproxMatcher & Catch::Matchers::Vector::ApproxMatcher< T >::scale ( T const & newScale)
inline

Definition at line 3305 of file catch.hpp.

3305 {
3306 approx.scale(newScale);
3307 return *this;
3308 }
Here is the call graph for this function:

Member Data Documentation

◆ approx

Definition at line 127 of file catch_matchers_vector.h.

◆ m_comparator

template<typename T >
std::vector< T > const & Catch::Matchers::Vector::ApproxMatcher< T >::m_comparator

Definition at line 126 of file catch_matchers_vector.h.


The documentation for this struct was generated from the following files: