ComPPare 1.0.0
Loading...
Searching...
No Matches
comppare::internal::policy::autopolicy::ArithmeticErrorPolicy< T > Class Template Reference

Concept for types supported by automatic error policy selection. More...

#include <policy.hpp>

Collaboration diagram for comppare::internal::policy::autopolicy::ArithmeticErrorPolicy< T >:
[legend]

Public Member Functions

 ArithmeticErrorPolicy ()
 
 ~ArithmeticErrorPolicy ()=default
 
MetricValue< T > metric (std::size_t) const
 
bool is_fail () const
 
void compute_error (const T &a, const T &b)
 

Static Public Member Functions

static constexpr std::size_t metric_count ()
 
static constexpr std::string_view metric_name (std::size_t)
 

Private Attributes

error_ = T(0)
 
std::string err_msg_
 
bool fail_ {false}
 
bool valid_ {true}
 
tolerance_
 

Static Private Attributes

static constexpr std::array names {"Total|err|"}
 

Detailed Description

template<typename T>
requires comppare::internal::concepts::Arithmetic<T>
class comppare::internal::policy::autopolicy::ArithmeticErrorPolicy< T >

Concept for types supported by automatic error policy selection.

Error policy for arithmetic types (e.g., int, float, double). Computes the absolute error between two values and checks if it exceeds a configurable tolerance.

Template Parameters
TValue type

Constructor & Destructor Documentation

◆ ArithmeticErrorPolicy()

template<typename T >
comppare::internal::policy::autopolicy::ArithmeticErrorPolicy< T >::ArithmeticErrorPolicy ( )
inline

◆ ~ArithmeticErrorPolicy()

Member Function Documentation

◆ compute_error()

template<typename T >
void comppare::internal::policy::autopolicy::ArithmeticErrorPolicy< T >::compute_error ( const T &  a,
const T &  b 
)
inline

◆ is_fail()

template<typename T >
bool comppare::internal::policy::autopolicy::ArithmeticErrorPolicy< T >::is_fail ( ) const
inline

◆ metric()

template<typename T >
MetricValue< T > comppare::internal::policy::autopolicy::ArithmeticErrorPolicy< T >::metric ( std::size_t  ) const
inline

◆ metric_count()

template<typename T >
static constexpr std::size_t comppare::internal::policy::autopolicy::ArithmeticErrorPolicy< T >::metric_count ( )
inlinestaticconstexpr

◆ metric_name()

template<typename T >
static constexpr std::string_view comppare::internal::policy::autopolicy::ArithmeticErrorPolicy< T >::metric_name ( std::size_t  )
inlinestaticconstexpr

Member Data Documentation

◆ err_msg_

template<typename T >
std::string comppare::internal::policy::autopolicy::ArithmeticErrorPolicy< T >::err_msg_
private

◆ error_

template<typename T >
T comppare::internal::policy::autopolicy::ArithmeticErrorPolicy< T >::error_ = T(0)
private

◆ fail_

template<typename T >
bool comppare::internal::policy::autopolicy::ArithmeticErrorPolicy< T >::fail_ {false}
private

◆ names

template<typename T >
constexpr std::array comppare::internal::policy::autopolicy::ArithmeticErrorPolicy< T >::names {"Total|err|"}
staticconstexprprivate

◆ tolerance_

template<typename T >
T comppare::internal::policy::autopolicy::ArithmeticErrorPolicy< T >::tolerance_
private

◆ valid_

template<typename T >
bool comppare::internal::policy::autopolicy::ArithmeticErrorPolicy< T >::valid_ {true}
private

The documentation for this class was generated from the following file: