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