16 : _type(_data.
getType()), _order(_data.getSpaceOrder())
22 static double sf0[100];
23 static double sf1[100];
29 for(
int k = 0; k <=
_order; ++k) { sf[k] = k + 1; }
36 for(
int i = 0; i <=
_order; ++i) {
38 double coeff =
pow_int(1 - u, i);
39 for(
int j = 0; j <=
_order - i; ++j) { sf1[j] *= coeff; }
40 for(
int j = 0; j <=
_order - i; ++j) { sf[k++] = sf0[i] * sf1[j]; }
46 for(
int i = 0; i <=
_order; ++i) {
47 for(
int j = 0; j <=
_order; ++j) { sf[k++] = sf0[i] * sf1[j]; }
58 for(
int i = 0; i <=
_order; ++i) { val[i] = 2. / (1 + 2 * i); }
61 for(
int i = 0; i <=
_order; ++i) {
62 for(
int j = 0; j <=
_order - i; ++j) {
63 val[k++] = .5 / (1 + i + j) / (1 + 2 * i);
68 for(
int i = 0; i <=
_order; ++i) {
69 for(
int j = 0; j <=
_order; ++j) {
70 val[k++] = 4. / (1 + 2 * i) / (1 + 2 * j);
77 void f(
int n,
double u,
double *val)
81 for(
int i = 0; i < n; i++) {
83 double a3i = 2. * i + 1;
86 val[i + 1] = a3i * u * val[i];
87 if(i > 0) val[i + 1] -= a4i * val[i - 1];
92 void fc(
int n,
double u,
double *val)
95 for(
int i = 2; i < n + 1; ++i) {
103 void df(
int n,
double u,
double *val)
106 if((u == 1.) || (u == -1.)) {
107 for(
int k = 0; k <= n; k++) val[k] = 0.5 * k * (k + 1);
108 if((u == -1.) && (n >= 2))
109 for(
int k = 2; k <= n; k += 2) val[k] = -val[k];
116 std::vector<double> tmp(n + 1);
121 double g2 = (1. - u * u);
125 for(
int i = 1; i <= n; i++) {
127 double g0 = (double)i;
128 val[i] = (g1 * tmp[i] + g0 * tmp[i - 1]) / g2;
134 void f(
int n,
double alpha,
double beta,
double u,
double *val)
136 const double alphaPlusBeta = alpha + beta;
137 const double a2MinusB2 = alpha * alpha - beta * beta;
140 val[1] = 0.5 * (2. * (alpha + 1.) + (alphaPlusBeta + 2.) * (u - 1.));
142 for(
int i = 1; i < n; i++) {
143 double ii = (double)i;
144 double twoI = 2. * ii;
147 2. * (ii + 1.) * (ii + alphaPlusBeta + 1.) * (twoI + alphaPlusBeta);
148 double a2i = (twoI + alphaPlusBeta + 1.) * (a2MinusB2);
149 double a3i =
Pochhammer(twoI + alphaPlusBeta, 3);
151 2. * (ii + alpha) * (ii + beta) * (twoI + alphaPlusBeta + 2.);
153 val[i + 1] = ((a2i + a3i * u) * val[i] - a4i * val[i - 1]) / a1i;
157 void df(
int n,
double alpha,
double beta,
double u,
double *val)
159 const double alphaPlusBeta = alpha + beta;
163 if((u == 1.) || (u == -1.)) {
165 int coeff = (u == 1.) ? (int)alpha : (
int)beta;
168 const int fMax = std::max(n, 1) + coeff;
169 std::vector<double> fact(fMax + 1);
171 for(
int i = 1; i <= fMax; i++) fact[i] = i * fact[i - 1];
175 for(
int k = 1; k <= n; k++)
176 val[k] = 0.5 * (k + alphaPlusBeta + 1) * fact[k + coeff] /
177 (fact[coeff + 1] * fact[k - 1]);
178 if((u == -1.) && (n >= 2))
179 for(
int k = 2; k <= n; k += 2) val[k] = -val[k];
187 std::vector<double> tmp(n + 1);
188 f(n, alpha, beta, u, &(tmp[0]));
192 if(n >= 1) val[1] = 0.5 * (alphaPlusBeta + 2.);
196 for(
int i = 2; i <= n; i++) {
197 double ii = (double)i;
198 double aa = (2. * ii + alphaPlusBeta);
199 double g2 = aa * (1. - u * u);
200 double g1 = ii * (alpha - beta - aa * u);
201 double g0 = 2. * (ii + alpha) * (ii + beta);
202 val[i] = (g1 * tmp[i] + g0 * tmp[i - 1]) / g2;