cMHN 1.2
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
is_approx.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_VALUE_FUNCTIONS_IS_APPROX_H
4#define pRC_CORE_VALUE_FUNCTIONS_IS_APPROX_H
5
9
10namespace pRC
11{
12 template<class XE, class XA, IsValue TT = Value<RemoveReference<XE>>>
13 requires IsInvocable<RelativeError, XE, XA>
14 static inline constexpr auto isApprox(XE &&expected, XA &&approx,
15 TT const &tolerance = NumericLimits<TT>::tolerance())
16 {
17 return relativeError(expected, approx) <= tolerance;
18 }
19}
20#endif // pRC_CORE_VALUE_FUNCTIONS_IS_APPROX_H
Definition cholesky.hpp:10
static constexpr auto relativeError(XE &&expected, XA &&approx)
Definition relative_error.hpp:19
static constexpr auto isApprox(XE &&expected, XA &&approx, TT const &tolerance=NumericLimits< TT >::tolerance())
Definition is_approx.hpp:14
Definition limits.hpp:13