xtensor
|
Functions | |
template<class E1 , class E2 > | |
auto | xt::pow (E1 &&e1, E2 &&e2) noexcept -> detail::xfunction_type_t< math::pow_fun, E1, E2 > |
Power function. | |
template<class E1 > | |
auto | xt::square (E1 &&e1) noexcept |
Square power function, equivalent to e1 * e1. | |
template<class E1 > | |
auto | xt::cube (E1 &&e1) noexcept |
Cube power function, equivalent to e1 * e1 * e1. | |
template<std::size_t N, class E > | |
auto | xt::pow (E &&e) noexcept |
Integer power function. | |
template<class E > | |
auto | xt::sqrt (E &&e) noexcept -> detail::xfunction_type_t< math::sqrt_fun, E > |
Square root function. | |
template<class E > | |
auto | xt::cbrt (E &&e) noexcept -> detail::xfunction_type_t< math::cbrt_fun, E > |
Cubic root function. | |
template<class E1 , class E2 > | |
auto | xt::hypot (E1 &&e1, E2 &&e2) noexcept -> detail::xfunction_type_t< math::hypot_fun, E1, E2 > |
Hypotenuse function. | |
|
inlinenoexcept |
Cubic root function.
Returns an xfunction for the element-wise cubic root of e.
e | an xexpression |
Cube power function, equivalent to e1 * e1 * e1.
Returns an xfunction for the element-wise value of of e1 * e1.
e1 | an xexpression or a scalar |
|
inlinenoexcept |
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.
e1 | an xexpression or a scalar |
e2 | an xexpression or a scalar |
Integer power function.
Returns an xfunction for the element-wise power of e1 to an integral constant.
Instead of computing the power by using the (expensive) logarithm, this function computes the power in a number of straight-forward multiplication steps. This function is therefore much faster (even for high N) than the generic pow-function.
For example, e1^20
can be expressed as (((e1^2)^2)^2)^2*(e1^2)^2
, which is just 5 multiplications.
e | an xexpression |
N | the exponent (has to be positive integer) |
|
inlinenoexcept |
Power function.
Returns an xfunction for the element-wise value of of e1 raised to the power e2.
e1 | an xexpression or a scalar |
e2 | an xexpression or a scalar |
|
inlinenoexcept |
Square root function.
Returns an xfunction for the element-wise square root of e.
e | an xexpression |