pRC
multi-purpose Tensor Train library for C++
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{
24 template<class T, If<IsFloat<T>> = 0>
25 static inline constexpr auto arg(T const &a)
26 {
27 if(a < zero())
28 {
29 return pi<T>();
30 }
31 else
32 {
33 return zero<T>();
34 }
35 }
36
48 template<class T, If<IsInteger<T>> = 0>
49 static inline constexpr auto arg(T const &a)
50 {
51 return arg(cast<Float<>>(a));
52 }
53}
54#endif // pRC_CORE_VALUE_FUNCTIONS_ARG_H
Definition cholesky.hpp:18
static constexpr auto arg(Complex< T > const &a)
Definition arg.hpp:12
static constexpr auto zero()
Definition zero.hpp:12
static constexpr Conditional< IsSatisfied< C >, RemoveConstReference< X >, X > copy(X &&a)
Definition copy.hpp:13
static constexpr auto cast(Complex< T > const &a)
Definition cast.hpp:13