pRC
multi-purpose Tensor Train library for C++
Loading...
Searching...
No Matches
atan2.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_VALUE_FUNCTIONS_ATAN2_H
4#define pRC_CORE_VALUE_FUNCTIONS_ATAN2_H
5
6#include <cmath>
7
11
12namespace pRC
13{
26 template<class Y, class X, If<IsFloat<Y>> = 0, If<IsFloat<X>> = 0>
27 static inline constexpr auto atan2(Y const &y, X const &x)
28 {
29 return Float(std::atan2(y(), x()));
30 }
31
44 template<class Y, class X, If<IsInteger<Y>> = 0, If<IsFloat<X>> = 0>
45 static inline constexpr auto atan2(Y const &y, X const &x)
46 {
47 return atan2(cast<Float<>>(y), x);
48 }
49
62 template<class Y, class X, If<IsFloat<Y>> = 0, If<IsInteger<X>> = 0>
63 static inline constexpr auto atan2(Y const &y, X const &x)
64 {
65 return atan2(y, cast<Float<>>(x));
66 }
67
80 template<class Y, class X, If<IsInteger<Y>> = 0, If<IsInteger<X>> = 0>
81 static inline constexpr auto atan2(Y const &y, X const &x)
82 {
83 return atan2(cast<Float<>>(y), cast<Float<>>(x));
84 }
85}
86#endif // pRC_CORE_VALUE_FUNCTIONS_ATAN2_H
Top-level class storing a floating point number.
Definition float.hpp:35
Definition cholesky.hpp:18
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
static constexpr auto atan2(XA &&a, XB &&b)
Calculates element-wise atan2 of two Tensors containing x and y coordinates.
Definition atan2.hpp:28