cMHN 1.2
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
relative_error.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_VALUE_FUNCTIONS_RELATIVE_ERROR_H
4#define pRC_CORE_VALUE_FUNCTIONS_RELATIVE_ERROR_H
5
14
15namespace pRC
16{
17 template<class XE, class XA>
18 requires IsInvocable<AbsoluteError, XE, XA> && IsInvocable<Norm<>, XE>
19 static inline constexpr auto relativeError(XE &&expected, XA &&approx)
20 {
21 auto const nrm = norm(expected);
22 using V = Value<decltype(nrm)>;
23
24 return absoluteError(expected, approx) /
26 }
27}
28#endif // pRC_CORE_VALUE_FUNCTIONS_RELATIVE_ERROR_H
Definition value.hpp:12
Definition cholesky.hpp:10
static constexpr auto absoluteError(XA &&a, XB &&b)
Definition absolute_error.hpp:18
typename ValueType< T >::Type Value
Definition value.hpp:72
static constexpr auto relativeError(XE &&expected, XA &&approx)
Definition relative_error.hpp:19
std::conditional_t< B, T, F > Conditional
Definition basics.hpp:56
static constexpr auto norm(T const &a)
Definition norm.hpp:12