cMHN 1.2
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
norm.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_VALUE_FUNCTIONS_NORM_H
4#define pRC_CORE_VALUE_FUNCTIONS_NORM_H
5
9
10namespace pRC
11{
12 template<Index P, Index Q, IsValue T>
13 requires(P == 2 && Q == 1)
14 static inline constexpr auto norm(T const &a)
15 {
16 return square(a);
17 }
18
19 template<Index P = 2, Index Q = P, IsValue T>
20 requires(P == Q)
21 static inline constexpr auto norm(T const &a)
22 {
23 return abs(a);
24 }
25}
26#endif // pRC_CORE_VALUE_FUNCTIONS_NORM_H
Definition value.hpp:12
Definition cholesky.hpp:10
static constexpr auto abs(T const &a)
Definition abs.hpp:11
static constexpr auto square(T const &a)
Definition square.hpp:11
static constexpr auto norm(T const &a)
Definition norm.hpp:12