| 2342 | */ |
| 2343 | template<class ValueType> |
| 2344 | bool SetBernoulliNumbers(CGamma<ValueType> & cgamma, uint more = 20, const volatile StopCalculating * stop = 0) |
| 2345 | { |
| 2346 | if( more == 0 ) |
| 2347 | more = 1; |
| 2348 | |
| 2349 | uint start = static_cast<uint>(cgamma.bern.size()); |
| 2350 | cgamma.bern.resize(cgamma.bern.size() + more); |
| 2351 | |
| 2352 | if( start == 0 ) |
| 2353 | { |
| 2354 | cgamma.bern[0].SetOne(); |
| 2355 | ++start; |
| 2356 | } |
| 2357 | |
| 2358 | if( cgamma.bern.size() == 1 ) |
| 2359 | return true; |
| 2360 | |
| 2361 | if( start == 1 ) |
| 2362 | { |
| 2363 | cgamma.bern[1].Set05(); |
| 2364 | cgamma.bern[1].ChangeSign(); |
| 2365 | ++start; |
| 2366 | } |
| 2367 | |
| 2368 | // we should have sufficient factorials in cgamma.fact |
| 2369 | if( cgamma.fact.size() < cgamma.bern.size() ) |
| 2370 | SetFactorialSequence(cgamma.fact, static_cast<uint>(cgamma.bern.size() - cgamma.fact.size())); |
| 2371 | |
| 2372 | |
| 2373 | return SetBernoulliNumbersMore(cgamma, start, stop); |
| 2374 | } |
| 2375 | |
| 2376 | |
| 2377 | /*! |
no test coverage detected