pRC
multi-purpose Tensor Train library for C++
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{
23 template<class B, class N, If<IsFloat<B>> = 0, If<IsFloat<N>> = 0>
24 static inline constexpr auto pow(B const &base, N const &exp)
25 {
26 return Float(std::pow(base(), exp()));
27 }
28
38 template<class B, class N, If<IsInteger<B>> = 0, If<IsFloat<N>> = 0>
39 static inline constexpr auto pow(B const &base, N const &exp)
40 {
41 return pow(cast<Float<>>(base), exp);
42 }
43
53 template<class B, class N, If<IsFloat<B>> = 0, If<IsInteger<N>> = 0>
54 static inline constexpr auto pow(B const &base, N const &exp)
55 {
56 return pow(base, cast<Float<>>(exp));
57 }
58
68 template<class B, class N, If<IsInteger<B>> = 0, If<IsInteger<N>> = 0>
69 static inline constexpr auto pow(B const &base, N const &exp)
70 {
71 return pow(cast<Float<>>(base), cast<Float<>>(exp));
72 }
73}
74#endif // pRC_CORE_VALUE_FUNCTIONS_POW_H
Top-level class storing a floating point number.
Definition float.hpp:35
Definition cholesky.hpp:18
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 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