ComPPare 1.0.0
|
Error policy for ranges of arithmetic types. More...
#include <policy.hpp>
Public Member Functions | |
RangeErrorPolicy () | |
~RangeErrorPolicy ()=default | |
MetricValue< T > | metric (std::size_t i) const |
bool | is_fail () const |
Checks if the current error state is a failure. | |
void | compute_error (const R &a, const R &b) |
Static Public Member Functions | |
static constexpr std::size_t | metric_count () |
static constexpr std::string_view | metric_name (std::size_t i) |
Private Types | |
using | T = std::remove_cvref_t< std::ranges::range_value_t< R > > |
Private Member Functions | |
MetricValue< T > | get_max () const |
MetricValue< T > | get_mean () const |
MetricValue< T > | get_total () const |
Private Attributes | |
T | max_error_ = T(0) |
T | total_error_ = T(0) |
std::size_t | elem_cnt_ = 0 |
bool | fail_ {false} |
bool | valid_ {true} |
Indicates if the current error state is a failure. | |
std::string | err_msg_ |
Indicates if the current error state is valid. | |
T | tolerance_ |
Static Private Attributes | |
static constexpr std::array | names {"Max|err|", "Mean|err|", "Total|err|"} |
Error policy for ranges of arithmetic types.
Compares two ranges element-wise and computes metrics such as maximum error, mean error, and total error.
R | Range type (e.g., std::vector<int>, std::deque<float>) |
|
private |
|
inline |
|
default |
|
inline |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inline |
Checks if the current error state is a failure.
|
inline |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
private |
|
private |
Indicates if the current error state is valid.
<
|
private |
|
private |
|
staticconstexprprivate |
|
private |
|
private |
|
private |
Indicates if the current error state is a failure.
<