Go to the documentation of this file.00001 #pragma once
00002 #include "basics/typedefs.hh"
00003 #include <map>
00004 #include <vector>
00005 #include "bernoulliPol.h"
00006
00007 namespace concepts {
00008
00009
00010 class SumOfPowers {
00011 public:
00012 typedef std::vector<Cmplx> VC;
00013 typedef std::pair<Real, Real> PRR;
00014 typedef std::pair<PRR, int> CacheKey;
00015 typedef std::map<CacheKey, VC> Cache;
00016
00017 SumOfPowers() {
00018
00019 }
00020
00021 ~SumOfPowers() {
00022 }
00023
00024 static SumOfPowers& getInstance() {
00025 return g_instance;
00026 }
00027
00029 Cmplx compute(Cmplx a, int k, int n);
00030
00031 Real binom(int a, int b);
00032
00033 const VC& cached(Cmplx a, int kmax, int nrep);
00034
00035 static inline Cmplx powi(Cmplx x, int power) {
00036 return BernoulliPol::powi(x, power);
00037 }
00038
00039 private:
00040 static SumOfPowers g_instance;
00041
00042 Cache cache;
00043 };
00044
00045 }