Power functions¶
xtensor provides the following power functions for xexpressions and scalars:
Defined in xtensor/xmath.hpp
Warning
doxygenfunction: Unable to resolve multiple matches for function “pow” with arguments ((E1&&, E2&&)) in doxygen xml output for project “xtensor” from directory: ../xml. Potential matches:
- template<class E1, class E2> auto pow(E1 &&e1, E2 &&e2) noexcept -> detail::xfunction_type_t<math::pow_fun, E1, E2>
- template<std::size_t N, class E> auto pow(E &&e) noexcept
Warning
doxygenfunction: Unable to resolve multiple matches for function “pow” with arguments ((E&&)) in doxygen xml output for project “xtensor” from directory: ../xml. Potential matches:
- template<class E1, class E2> auto pow(E1 &&e1, E2 &&e2) noexcept -> detail::xfunction_type_t<math::pow_fun, E1, E2>
- template<std::size_t N, class E> auto pow(E &&e) noexcept
-
template<class
E1
>
autoxt
::
square
(E1 &&e1) noexcept¶ Square power function, equivalent to e1 * e1.
Returns an xfunction for the element-wise value of of e1 * e1.
- Return
an xfunction
- Parameters
e1
: an xexpression or a scalar
-
template<class
E1
>
autoxt
::
cube
(E1 &&e1) noexcept¶ Cube power function, equivalent to e1 * e1 * e1.
Returns an xfunction for the element-wise value of of e1 * e1.
- Return
an xfunction
- Parameters
e1
: an xexpression or a scalar
-
template<class
E
>
autoxt
::
sqrt
(E &&e) noexcept -> detail::xfunction_type_t<math::sqrt_fun, 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
>
autoxt
::
cbrt
(E &&e) noexcept -> detail::xfunction_type_t<math::cbrt_fun, 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
, classE2
>
autoxt
::
hypot
(E1 &&e1, E2 &&e2) noexcept -> detail::xfunction_type_t<math::hypot_fun, E1, 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