Power functions¶
xtensor provides the following power functions for xexpressions and scalars:
Defined in xtensor/xmath.hpp
- template <class E1, class E2>
-
auto
xt::
pow
(E1 &&e1, E2 &&e2)¶ Power function.
Returns an xfunction for the element-wise value of of e1 raised to the power e2.
- Return
- an xfunction
- Note
- e1 and e2 can’t be both scalars.
- Parameters
e1
: an xexpression or a scalare2
: an xexpression or a scalar
- template <class E>
-
auto
xt::
sqrt
(E &&e)¶ Square root function.
Returns an xfunction for the element-wise square root of e.
- Return
- an xfunction
- Parameters
e
: an xexpression
- template <class E>
-
auto
xt::
cbrt
(E &&e)¶ Cubic root function.
Returns an xfunction for the element-wise cubic root of e.
- Return
- an xfunction
- Parameters
e
: an xexpression
- template <class E1, class E2>
-
auto
xt::
hypot
(E1 &&e1, E2 &&e2)¶ Hypotenuse function.
Returns an xfunction for the element-wise square root of the sum of the square of e1 and e2, avoiding overflow and underflow at intermediate stages of computation.
- Return
- an xfunction
- Note
- e1 and e2 can’t be both scalars.
- Parameters
e1
: an xexpression or a scalare2
: an xexpression or a scalar