MCPcopy Create free account
hub / github.com/Gecode/gecode / root_aux

Function root_aux

gecode/third-party/boost/numeric/interval/arith2.hpp:228–240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

226namespace detail {
227
228template< class I > inline
229I root_aux(typename I::base_type const &x, int k) // x and k are bigger than one
230{
231 typedef typename I::base_type T;
232 T tk(k);
233 I y(static_cast<T>(1), x, true);
234 for(;;) {
235 T y0 = median(y);
236 I yy = intersect(y, y0 - (pow(I(y0, y0, true), k) - x) / (tk * pow(y, k - 1)));
237 if (equal(y, yy)) return y;
238 y = yy;
239 }
240}
241
242template< class I > inline // x is positive and k bigger than one
243typename I::base_type root_aux_dn(typename I::base_type const &x, int k)

Callers

nothing calls this directly

Calls 4

medianFunction · 0.85
intersectFunction · 0.70
powFunction · 0.70
equalFunction · 0.70

Tested by

no test coverage detected