cMHN 1.2
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
arg.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_VALUE_FUNCTIONS_ARG_H
4#define pRC_CORE_VALUE_FUNCTIONS_ARG_H
5
10
11namespace pRC
12{
13 template<IsFloat T>
14 static inline constexpr auto arg(T const &a)
15 {
16 if(a < zero())
17 {
18 return pi<T>();
19 }
20 else
21 {
22 return zero<T>();
23 }
24 }
25
26 template<IsInteger T>
27 static inline constexpr auto arg(T const &a)
28 {
29 return arg(cast<Float<>>(a));
30 }
31}
32#endif // pRC_CORE_VALUE_FUNCTIONS_ARG_H
Definition value.hpp:12
Definition cholesky.hpp:10
Float(Float< 16 >::Fundamental const) -> Float< 16 >
static constexpr T pi()
Definition pi.hpp:12
static constexpr auto cast(T const &a)
Definition cast.hpp:11
static constexpr auto arg(T const &a)
Definition arg.hpp:11
static constexpr auto zero()
Definition zero.hpp:12