30 #include "gsl/gsl_sf_gamma.h"
31 #include "gsl/gsl_sf_pow_int.h"
41 std::vector< std::vector<int> > qt =
GetQIndex(
n);
42 std::vector<double> g;
44 for (
size_t i = 0; i < qt.size(); ++i) {
46 for (
size_t j = 1; j < qt[i].size(); ++j) {
47 if (j > g.size()) g.push_back(
GN(x, j-1));
48 ei *= gsl_sf_pow_int(g[j-1], qt[i][j]);
62 for (
unsigned int i =
n; i <
_a.size(); i++)
63 hn +=
_a[i]/gsl_sf_pow_int(
_lambda, i)*gsl_sf_pow_int(x, i-
n)*
64 static_cast<double>(gsl_sf_fact(i))
65 /
static_cast<double>(gsl_sf_fact(i-
n));
72 if (
n == 0)
return 1+
exp(
HN(x, 0));
73 std::vector<double> hn(
n+1);
74 for (
int i = 0; i <=
n; i++) hn[i] =
HN(x, i);
75 double exp_h0 =
exp(hn[0]);
77 for (
size_t i = 0; i <
_h[
n].size(); ++i) {
78 double gnj =
_h[
n][i][0]*exp_h0;
79 for (
size_t j = 1; j <
_h[
n][i].size(); ++j)
80 gnj *= gsl_sf_pow_int(hn[j],
_h[
n][i][j]);
91 std::vector< std::vector< std::vector<int> > >
Enge::_q;
92 std::vector< std::vector< std::vector<int> > >
Enge::_h;
95 _q.push_back(std::vector< std::vector<int> >(1, std::vector<int>(3)) );
101 for (
size_t i =
_q.size(); i <
n+1; ++i) {
102 _q.push_back(std::vector< std::vector<int> >() );
103 for (
size_t j = 0; j <
_q[i-1].size(); ++j) {
104 size_t k_max =
_q[i-1][j].size();
105 std::vector<int> new_vec(
_q[i-1][j]);
107 new_vec[0] *= new_vec[1];
110 _q[i].push_back(new_vec);
111 for (
size_t k = 2; k < k_max; ++k) {
113 if (
_q[i-1][j][k] > 0) {
114 std::vector<int> new_vec(
_q[i-1][j]);
115 if ( k == k_max-1 ) new_vec.push_back(0);
116 new_vec[0] *= new_vec[k];
119 _q[i].push_back(new_vec);
125 if (
_h.size() == 0) {
127 _h.push_back(std::vector< std::vector<int> >());
129 _h.push_back(std::vector< std::vector<int> >());
130 _h[1].push_back(std::vector<int>(2, 1));
132 for (
size_t i =
_h.size(); i <
n+1; ++i) {
133 _h.push_back(std::vector< std::vector<int> >());
134 for (
size_t j = 0; j <
_h[i-1].size(); ++j) {
137 std::vector<int> new_vec(
_h[i-1][j]);
139 _h[i].push_back(new_vec);
140 for (
size_t k = 1; k <
_h[i-1][j].size(); ++k) {
141 if (
_h[i-1][j][k] > 0) {
142 std::vector<int> new_vec(
_h[i-1][j]);
143 if (k ==
_h[i-1][j].size()-1) new_vec.push_back(0);
144 new_vec[0] *= new_vec[k];
147 _h[i].push_back(new_vec);
Tps< T > exp(const Tps< T > &x)
Exponential.
std::vector< std::vector< int > > CompactVector(std::vector< std::vector< int > > vec)
constexpr double e
The value of.
double GetEnge(double x, int n) const
double HN(double x, int n) const
static std::vector< std::vector< std::vector< int > > > _h
static std::vector< std::vector< std::vector< int > > > _q
double GN(double x, int n) const
static std::vector< std::vector< int > > GetQIndex(int n)
static void SetEngeDiffIndices(size_t n)