Class ElementwisePow

Class Documentation

class ElementwisePow

The per-element kernel of Result::pow: x -> x^e for a fixed rational exponent e.

The exponent is decoded once, at construction, so applying the kernel to each element costs no multiprecision arithmetic. An integer exponent is exact: repeated multiplication (by squaring), then the reciprocal for a negative exponent, so 0^-n is inf per IEEE and is not checked. Any other exponent goes through std::pow with the exponent converted to double (the complex overload for complex elements).

Public Functions

inline explicit ElementwisePow(rational const &exponent)
template<typename T>
inline T operator()(T const &x) const