cMHN 1.1
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
is_identity.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_VALUE_FUNCTIONS_IS_IDENTITY_H
4#define pRC_CORE_VALUE_FUNCTIONS_IS_IDENTITY_H
5
10
11namespace pRC
12{
13 template<class X, class R = RemoveReference<X>,
14 class TT = typename R::Value, If<IsValue<TT>> = 0,
15 If<IsDefined<Identity<R>>> = 0, If<IsInvocable<Identity<R>>> = 0,
16 If<IsInvocable<AbsoluteError, X, R>> = 0>
17 static inline constexpr auto isIdentity(X &&a,
18 TT const &tolerance = NumericLimits<TT>::tolerance())
19 {
20 return absoluteError(forward<X>(a), identity<R>()) <= tolerance;
21 }
22}
23#endif // pRC_CORE_VALUE_FUNCTIONS_IS_IDENTITY_H
Definition cholesky.hpp:18
static constexpr auto makeConstantSequence()
Definition sequence.hpp:402
static constexpr auto absoluteError(XA &&a, XB &&b)
Definition absolute_error.hpp:18
static constexpr auto isIdentity(T const a)
Definition is_identity.hpp:11
Definition limits.hpp:13