cMHN 1.1
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
pow.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_VALUE_FUNCTIONS_POW_H
4#define pRC_CORE_VALUE_FUNCTIONS_POW_H
5
6#include <cmath>
7
11
12namespace pRC
13{
14 template<class B, class N, If<IsFloat<B>> = 0, If<IsFloat<N>> = 0>
15 static inline constexpr auto pow(B const &base, N const &exp)
16 {
17 return Float(std::pow(base(), exp()));
18 }
19
20 template<class B, class N, If<IsInteger<B>> = 0, If<IsFloat<N>> = 0>
21 static inline constexpr auto pow(B const &base, N const &exp)
22 {
23 return pow(cast<Float<>>(base), exp);
24 }
25
26 template<class B, class N, If<IsFloat<B>> = 0, If<IsInteger<N>> = 0>
27 static inline constexpr auto pow(B const &base, N const &exp)
28 {
29 return pow(base, cast<Float<>>(exp));
30 }
31
32 template<class B, class N, If<IsInteger<B>> = 0, If<IsInteger<N>> = 0>
33 static inline constexpr auto pow(B const &base, N const &exp)
34 {
35 return pow(cast<Float<>>(base), cast<Float<>>(exp));
36 }
37}
38#endif // pRC_CORE_VALUE_FUNCTIONS_POW_H
Definition cholesky.hpp:18
Float(Float< 16 >::Fundamental const) -> Float< 16 >
static constexpr auto makeConstantSequence()
Definition sequence.hpp:402
static constexpr auto exp(Complex< T > const &a)
Definition exp.hpp:12
static constexpr auto pow(Complex< X > const &x, Complex< Y > const &y)
Definition pow.hpp:13
static constexpr auto cast(Complex< T > const &a)
Definition cast.hpp:13