23 #define EPS 100*DBL_EPSILON
27 #define sign(a,b) ((b)<0 ? -fabs(a) : fabs(a))
37 #define POLYNOMIAL_DEFLATION 0
41 #ifdef POLYNOMIAL_DEFLATION
45 #define jacobz(n,z,alpha,beta) Jacobz(n,z,alpha,beta)
51 #define jacobz(n,z,alpha,beta) JacZeros(n,z,alpha,beta)
63 static void Jacobz (
const int n,
double *z,
const double alpha,
73 static void TriQL(
const int,
double *,
double *,
double **);
75 double gammaF (
const double);
77 static void RecCoeff(
const int,
double *,
double *,
const double,
81 void JKMatrix(
int,
double *,
double *);
83 void chri1(
int,
double*,
double*,
double*,
double*,
double);
107 void zwgj (
double *z,
double *w,
const int np,
const double alpha,
115 double fac, one = 1.0, two = 2.0, apb = alpha + beta;
121 jacobd (np,z,w,np,alpha,beta);
125 fac = pow(two,apb + one)*
gammaF(alpha + np + one)*
gammaF(beta + np + one);
131 for(i = 0; i < np; ++i) w[i] = fac/(w[i]*w[i]*(one-z[i]*z[i]));
163 void zwgrjm(
double *z,
double *w,
const int np,
const double alpha,
183 double fac, one = 1.0, two = 2.0, apb = alpha + beta;
189 jacobz (np-1,z+1,alpha,beta+1);
191 jacobfd (np,z,w,NULL,np-1,alpha,beta);
195 fac = pow(two,apb)*
gammaF(alpha + np)*
gammaF(beta + np);
201 for(i = 0; i < np; ++i) w[i] = fac*(1-z[i])/(w[i]*w[i]);
203 w[0] *= (beta + one);
239 void zwgrjp(
double *z,
double *w,
const int np,
const double alpha,
259 double fac, one = 1.0, two = 2.0, apb = alpha + beta;
263 jacobz (np-1,z,alpha+1,beta);
267 jacobfd (np,z,w,NULL,np-1,alpha,beta);
271 fac = pow(two,apb)*
gammaF(alpha + np)*
gammaF(beta + np);
277 for(i = 0; i < np; ++i) w[i] = fac*(1+z[i])/(w[i]*w[i]);
279 w[np-1] *= (alpha + one);
311 void zwglj(
double *z,
double *w,
const int np,
const double alpha,
331 double fac, one = 1.0, apb = alpha + beta, two = 2.0;
339 jacobz (np-2,z + 1,alpha + one,beta + one);
341 jacobfd (np,z,w,NULL,np-1,alpha,beta);
345 fac = pow(two,apb + 1)*
gammaF(alpha + np)*
gammaF(beta + np);
347 fac /= (np-1)*
gammaF(np)*
gammaF(alpha + beta + np + one);
351 for(i = 0; i < np; ++i) w[i] = fac/(w[i]*w[i]);
353 w[0] *= (beta + one);
355 w[np-1] *= (alpha + one);
385 void zwgk(
double *z,
double *w,
const int npt ,
const double alpha,
403 int kpoints = 2*np + 1;
409 int ncoeffs = (int)floor(3.0*(np+1)/2);
419 double *a =
new double[kpoints];
421 double *b =
new double[kpoints];
427 for(i = 0; i < kpoints; i++)
453 double** zmatrix =
new double*[kpoints];
455 for(i = 0; i < kpoints; i++)
459 zmatrix[i] =
new double[kpoints];
461 for(j = 0; j < kpoints; j++)
471 for(i = 0; i < kpoints; i++)
483 TriQL(kpoints, a, b, zmatrix);
487 for(i = 0; i < kpoints; i++)
519 void zwrk(
double* z,
double* w,
const int npt ,
const double alpha,
535 fprintf(stderr,
"too few points in formula\n");
559 int ncoeffs = (int)ceil(3.0*np/2);
565 double *a =
new double[ncoeffs+1];
567 double *b =
new double[ncoeffs+1];
573 for(i = 0; i < ncoeffs+1; i++)
591 double* a0 =
new double[ncoeffs];
593 double* b0 =
new double[ncoeffs];
597 chri1(ncoeffs,a,b,a0,b0,end0);
601 double s = b0[0]/fabs(b0[0]);
609 double* z1 =
new double[2*np-1];
611 double* w1 =
new double[2*np-1];
613 for(i = 0; i < ncoeffs; i++)
627 double** zmatrix =
new double*[2*np-1];
629 for(i = 0; i < 2*np-1; i++)
633 zmatrix[i] =
new double[2*np-1];
635 for(j = 0; j < 2*np-1; j++)
645 for(i = 0; i < 2*np-1; i++)
657 TriQL(2*np-1, z1, w1, zmatrix);
663 for(i = 0; i < 2*np-1; i++)
667 w1[i] = s*w1[i]/(z1[i]-end0);
679 for(i = 1; i < kpoints; i++)
711 void zwlk(
double* z,
double* w,
const int npt,
713 const double alpha,
const double beta)
727 fprintf (stderr,
"too few points in formula\n");
745 int kpoints = 2*np-1;
751 int ncoeffs = (int)ceil(3.0*np/2)-1;
757 double *a =
new double[ncoeffs+1];
759 double *b =
new double[ncoeffs+1];
765 for(i = 0; i < ncoeffs+1; i++)
785 double* a0 =
new double[ncoeffs];
787 double* b0 =
new double[ncoeffs];
791 chri1(ncoeffs,a,b,a0,b0,endl);
795 double* a1 =
new double[ncoeffs-1];
797 double* b1 =
new double[ncoeffs-1];
801 chri1(ncoeffs-1,a0,b0,a1,b1,endr);
807 double s = b1[0]/fabs(b1[0]);
815 double* z1 =
new double[2*np-3];
817 double* w1 =
new double[2*np-3];
819 for(i = 0; i < ncoeffs; i++)
833 double** zmatrix =
new double*[2*np-3];
835 for(i = 0; i < 2*np-3; i++)
839 zmatrix[i] =
new double[2*np-3];
841 for(j = 0; j < 2*np-3; j++)
851 for(i = 0; i < 2*np-3; i++)
863 TriQL(2*np-3, z1, w1, zmatrix);
869 double sumW1Z1 = 0.0;
871 for(i = 0; i < 2*np-3; i++)
875 w1[i] = s*w1[i]/(z1[i]-endl)/(z1[i]-endr);
879 sumW1Z1 += z1[i]*w1[i];
885 double c0 = b[0]-sumW1;
887 double c1 = a[0]*b[0]-sumW1Z1;
895 w[0] = (c0*endr-c1)/(endr-endl);
897 w[2*np-2] = (c1-c0*endl)/(endr-endl);
901 for(i = 1; i < kpoints-1; i++)
937 void Dgj(
double *D,
const double *z,
const int np,
const double alpha,
945 double one = 1.0, two = 2.0;
963 pd = (
double *)malloc(np*
sizeof(
double));
965 jacobd(np,z,pd,np,alpha,beta);
969 for (i = 0; i < np; i++){
971 for (j = 0; j < np; j++){
977 D[i*np+j] = pd[j]/(pd[i]*(z[j]-z[i]));
981 D[i*np+j] = (alpha - beta + (alpha + beta + two)*z[j])/
983 (two*(one - z[j]*z[j]));
1023 void Dgrjm(
double *D,
const double *z,
const int np,
const double alpha,
1041 double one = 1.0, two = 2.0;
1047 pd = (
double *)malloc(np*
sizeof(
double));
1051 pd[0] = pow(-one,np-1)*
gammaF(np+beta+one);
1055 jacobd(np-1,z+1,pd+1,np-1,alpha,beta+1);
1057 for(i = 1; i < np; ++i) pd[i] *= (1+z[i]);
1061 for (i = 0; i < np; i++)
1063 for (j = 0; j < np; j++){
1067 D[i*np+j] = pd[j]/(pd[i]*(z[j]-z[i]));
1073 D[i*np+j] = -(np + alpha + beta + one)*(np - one)/
1079 D[i*np+j] = (alpha - beta + one + (alpha + beta + one)*z[j])/
1081 (two*(one - z[j]*z[j]));
1121 void Dgrjp(
double *D,
const double *z,
const int np,
const double alpha,
1139 double one = 1.0, two = 2.0;
1145 pd = (
double *)malloc(np*
sizeof(
double));
1151 jacobd(np-1,z,pd,np-1,alpha+1,beta);
1153 for(i = 0; i < np-1; ++i) pd[i] *= (1-z[i]);
1155 pd[np-1] = -
gammaF(np+alpha+one);
1161 for (i = 0; i < np; i++)
1163 for (j = 0; j < np; j++){
1167 D[i*np+j] = pd[j]/(pd[i]*(z[j]-z[i]));
1173 D[i*np+j] = (np + alpha + beta + one)*(np - one)/
1175 (two*(alpha + two));
1179 D[i*np+j] = (alpha - beta - one + (alpha + beta + one)*z[j])/
1181 (two*(one - z[j]*z[j]));
1221 void Dglj(
double *D,
const double *z,
const int np,
const double alpha,
1239 double one = 1.0, two = 2.0;
1245 pd = (
double *)malloc(np*
sizeof(
double));
1249 pd[0] = two*pow(-one,np)*
gammaF(np + beta);
1253 jacobd(np-2,z+1,pd+1,np-2,alpha+1,beta+1);
1255 for(i = 1; i < np-1; ++i) pd[i] *= (one-z[i]*z[i]);
1257 pd[np-1] = -two*
gammaF(np + alpha);
1263 for (i = 0; i < np; i++)
1265 for (j = 0; j < np; j++){
1269 D[i*np+j] = pd[j]/(pd[i]*(z[j]-z[i]));
1275 D[i*np+j] = (alpha - (np-1)*(np + alpha + beta))/(two*(beta+ two));
1279 D[i*np+j] =-(beta - (np-1)*(np + alpha + beta))/(two*(alpha+ two));
1283 D[i*np+j] = (alpha - beta + (alpha + beta)*z[j])/
1285 (two*(one - z[j]*z[j]));
1345 double hgj (
const int i,
const double z,
const double *zgj,
1347 const int np,
const double alpha,
const double beta)
1353 double zi, dz,
p, pd, h;
1361 if (fabs(dz) <
EPS)
return 1.0;
1365 jacobd (1, &zi, &pd , np, alpha, beta);
1367 jacobfd(1, &z , &p, NULL , np, alpha, beta);
1421 double hgrjm (
const int i,
const double z,
const double *zgrj,
const int np,
1423 const double alpha,
const double beta)
1429 double zi, dz,
p, pd, h;
1437 if (fabs(dz) <
EPS)
return 1.0;
1441 jacobfd (1, &zi, &p , NULL, np-1, alpha, beta + 1);
1445 jacobd (1, &zi, &pd, np-1, alpha, beta + 1);
1447 h = (1.0 + zi)*pd + p;
1449 jacobfd (1, &z, &p, NULL, np-1, alpha, beta + 1);
1451 h = (1.0 + z )*p/(h*dz);
1505 double hgrjp (
const int i,
const double z,
const double *zgrj,
const int np,
1507 const double alpha,
const double beta)
1513 double zi, dz,
p, pd, h;
1521 if (fabs(dz) <
EPS)
return 1.0;
1525 jacobfd (1, &zi, &p , NULL, np-1, alpha+1, beta );
1529 jacobd (1, &zi, &pd, np-1, alpha+1, beta );
1531 h = (1.0 - zi)*pd - p;
1533 jacobfd (1, &z, &p, NULL, np-1, alpha+1, beta);
1535 h = (1.0 - z )*p/(h*dz);
1589 double hglj (
const int i,
const double z,
const double *zglj,
const int np,
1591 const double alpha,
const double beta)
1595 double one = 1., two = 2.;
1597 double zi, dz,
p, pd, h;
1605 if (fabs(dz) <
EPS)
return 1.0;
1609 jacobfd(1, &zi, &p , NULL, np-2, alpha + one, beta + one);
1613 jacobd (1, &zi, &pd, np-2, alpha + one, beta + one);
1615 h = (one - zi*zi)*pd - two*zi*p;
1617 jacobfd(1, &z, &p, NULL, np-2, alpha + one, beta + one);
1619 h = (one - z*z)*p/(h*dz);
1657 void Imgj(
double *im,
const double *zgj,
const double *zm,
const int nz,
1659 const int mz,
const double alpha,
const double beta){
1667 for (i = 0; i < nz; ++i) {
1669 for (j = 0; j < mz; ++j)
1675 im [i*mz+j] =
hgj(i, zp, zgj, nz, alpha, beta);
1715 void Imgrjm(
double *im,
const double *zgrj,
const double *zm,
const int nz,
1717 const int mz,
const double alpha,
const double beta)
1727 for (i = 0; i < nz; i++) {
1729 for (j = 0; j < mz; j++)
1735 im [i*mz+j] =
hgrjm(i, zp, zgrj, nz, alpha, beta);
1775 void Imgrjp(
double *im,
const double *zgrj,
const double *zm,
const int nz,
1777 const int mz,
const double alpha,
const double beta)
1787 for (i = 0; i < nz; i++) {
1789 for (j = 0; j < mz; j++)
1795 im [i*mz+j] =
hgrjp(i, zp, zgrj, nz, alpha, beta);
1837 void Imglj(
double *im,
const double *zglj,
const double *zm,
const int nz,
1839 const int mz,
const double alpha,
const double beta)
1849 for (i = 0; i < nz; i++) {
1851 for (j = 0; j < mz; j++)
1857 im[i*mz+j] =
hglj(i, zp, zglj, nz, alpha, beta);
1951 void jacobfd(
const int np,
const double *z,
double *poly_in,
double *polyd,
1953 const int n,
const double alpha,
const double beta){
1957 double zero = 0.0, one = 1.0, two = 2.0;
1971 for(i = 0; i < np; ++i)
1977 for(i = 0; i < np; ++i)
1987 for(i = 0; i < np; ++i)
1989 poly_in[i] = 0.5*(alpha - beta + (alpha + beta + two)*z[i]);
1993 for(i = 0; i < np; ++i)
1995 polyd[i] = 0.5*(alpha + beta + two);
2005 double two = 2.0, apb = alpha + beta;
2007 double *poly, *polyn1,*polyn2;
2013 polyn1 = (
double *)malloc(2*np*
sizeof(
double));
2023 polyn1 = (
double *)malloc(3*np*
sizeof(
double));
2033 for(i = 0; i < np; ++i){
2037 polyn1[i] = 0.5*(alpha - beta + (alpha + beta + two)*z[i]);
2043 for(k = 2; k <= n; ++k){
2045 a1 = two*k*(k + apb)*(two*k + apb - two);
2047 a2 = (two*k + apb - one)*(alpha*alpha - beta*beta);
2049 a3 = (two*k + apb - two)*(two*k + apb - one)*(two*k + apb);
2051 a4 = two*(k + alpha - one)*(k + beta - one)*(two*k + apb);
2063 for(i = 0; i < np; ++i){
2065 poly [i] = (a2 + a3*z[i])*polyn1[i] - a4*polyn2[i];
2067 polyn2[i] = polyn1[i];
2069 polyn1[i] = poly [i];
2079 a1 = n*(alpha - beta);
2081 a2 = n*(two*n + alpha + beta);
2083 a3 = two*(n + alpha)*(n + beta);
2085 a4 = (two*n + alpha + beta);
2087 a1 /= a4; a2 /= a4; a3 /= a4;
2093 for(i = 0; i < np; ++i){
2095 polyd[i] = (a1- a2*z[i])*poly[i] + a3*polyn2[i];
2097 polyd[i] /= (one - z[i]*z[i]);
2151 void jacobd(
const int np,
const double *z,
double *polyd,
const int n,
2153 const double alpha,
const double beta)
2163 for(i = 0; i < np; ++i) polyd[i] = 0.0;
2169 jacobfd(np,z,polyd,NULL,n-1,alpha+one,beta+one);
2171 for(i = 0; i < np; ++i) polyd[i] *= 0.5*(alpha + beta + (
double)n + one);
2211 if (x == -0.5) gamma = -2.0*sqrt(M_PI);
2213 else if (!x)
return gamma;
2215 else if ((x-(
int)x) == 0.5){
2235 else if ((x-(
int)x) == 0.0){
2255 fprintf(stderr,
"%lf is not of integer or half order\n",x);
2279 static void Jacobz(
const int n,
double *z,
const double alpha,
2285 double dth = M_PI/(2.0*(double)n);
2287 double poly,pder,rlast=0.0;
2291 double one = 1.0, two = 2.0;
2301 for(k = 0; k < n; ++k){
2303 r = -cos((two*(
double)k + one) * dth);
2305 if(k) r = 0.5*(r + rlast);
2309 for(j = 1; j <
STOP; ++j){
2311 jacobfd(1,&r,&poly, &pder, n, alpha, beta);
2315 for(i = 0, sum = 0.0; i < k; ++i) sum += one/(r - z[i]);
2319 delr = -poly / (pder - sum * poly);
2323 if( fabs(delr) <
EPS )
break;
2389 void JacZeros(
const int n,
double *a,
double*b,
const double alpha,
2401 double **z =
new double*[n];
2403 for(i = 0; i < n; i++)
2407 z[i] =
new double[n];
2409 for(j = 0; j < n; j++)
2419 for(i = 0; i < n; i++)
2449 static void RecCoeff(
const int n,
double *a,
double *b,
const double alpha,
2457 double apb, apbi,a2b2;
2477 a[0] = (beta-alpha)/apbi;
2479 b[1] = (4.0*(1.0+alpha)*(1.0+beta)/((apbi+1.0)*apbi*apbi));
2483 a2b2 = beta*beta-alpha*alpha;
2487 for(i = 1; i < n-1; i++){
2489 apbi = 2.0*(i+1) + apb;
2491 a[i] = a2b2/((apbi-2.0)*apbi);
2493 b[i+1] = (4.0*(i+1)*(i+1+alpha)*(i+1+beta)*(i+1+apb)/
2495 ((apbi*apbi-1)*apbi*apbi));
2503 a[n-1] = a2b2/((apbi-2.0)*apbi);
2565 static void TriQL(
const int n,
double *d,
double *e,
double **z){
2569 double s,r,
p,g,f,dd,c,b;
2573 double MuZero = e[0];
2579 for(i = 0; i < n-1; i++)
2583 e[i] = sqrt(e[i+1]);
2599 for (m=l;m<n-1;m++) {
2601 dd=fabs(d[m])+fabs(d[m+1]);
2603 if (fabs(e[m])+dd == dd)
break;
2609 if (iter++ ==
STOP){
2611 fprintf(stderr,
"triQL: Too many iterations in TQLI");
2617 g=(d[l+1]-d[l])/(2.0*e[l]);
2621 g=d[m]-d[l]+e[l]/(g+
sign(r,g));
2627 for (i=m-1;i>=l;i--) {
2633 if (fabs(f) >= fabs(g)) {
2657 r=(d[i]-g)*s+2.0*c*b;
2669 for(k = 0; k < n; k++)
2675 z[k][i+1] = s*z[k][i] + c*f;
2677 z[k][i] = c*z[k][i] - s*f;
2705 for(i = 0; i < n-1; ++i){
2711 for(l = i+1; l < n; ++l)
2727 double temp = z[0][k];
2739 for(i =0 ; i < n; i++)
2743 e[i] = MuZero*z[0][i]*z[0][i];
2777 int size = (int)floor(n/2.0)+2;
2779 double *s =
new double[size];
2781 double *t =
new double[size];
2787 for(i = 0; i < size; i++)
2801 for(m = 0; m <= n-2; m++)
2807 for(k = (
int)floor((m+1)/2.0); k >= 0; k--)
2813 u = u+(a[k+n+1]-a[l])*t[k+1] + b[k+n+1]*s[k] - b[l]*s[k+1];
2835 for(j = (
int)floor(n/2.0); j >= 0; j--)
2845 for(m = n-1; m <= 2*n-3; m++)
2851 for(k = m+1-n; k <= floor((m-1)/2.0); k++)
2859 u = u-(a[k+n+1]-a[l])*t[j+1] - b[k+n+1]*s[j+1] + b[l]*s[j+2];
2873 a[k+n+1] = a[k] + (s[j+1]-b[k+n+1]*s[j+2])/t[j+2];
2883 b[k+n+1] = s[j+1]/s[j+2];
2903 a[2*n ] = a[n-1]-b[2*n]*s[1]/t[1];
2931 void chri1(
int n,
double* a,
double* b,
double* a0,
2933 double* b0,
double z)
2939 double q = ceil(3.0*n/2);
2941 int size = (int)q+1;
2947 fprintf(stderr,
"input arrays a and b are too short\n");
2951 double* r =
new double[n+1];
2955 r[1] = z - a[1] - b[1]/r[0];
2957 a0[0] = a[1] + r[1] - r[0];
2973 for(k = 1; k < n; k++)
2977 r[k+1] = z - a[k+1] - b[k+1]/r[k];
2979 a0[k] = a[k+1] + r[k+1] - r[k];
2981 b0[k] = b[k] * r[k]/r[k-1];
2999 std::complex<Nektar::NekDouble>
ImagBesselComp(
int n,std::complex<Nektar::NekDouble> y)
3001 std::complex<Nektar::NekDouble> z (1.0,0.0);
3002 std::complex<Nektar::NekDouble> zbes (1.0,0.0);
3003 std::complex<Nektar::NekDouble> zarg;
3010 while (abs(z) > tol && i <= maxit){
3011 z = z*(1.0/i/(i+n)*zarg);
3012 if (abs(z) <= tol)
break;
void Dgj(double *D, const double *z, const int np, const double alpha, const double beta)
Compute the Derivative Matrix and its transpose associated.
#define sign(a, b)
return the sign(b)*a
static void RecCoeff(const int, double *, double *, const double, const double)
The routine finds the recurrence coefficients a and.
void zwgrjp(double *z, double *w, const int np, const double alpha, const double beta)
Gauss-Radau-Jacobi zeros and weights with end point at z=1.
double hgj(const int i, const double z, const double *zgj, const int np, const double alpha, const double beta)
Compute the value of the i th Lagrangian interpolant through.
void Imgrjp(double *im, const double *zgrj, const double *zm, const int nz, const int mz, const double alpha, const double beta)
Interpolation Operator from Gauss-Radau-Jacobi points.
void zwglj(double *z, double *w, const int np, const double alpha, const double beta)
Gauss-Lobatto-Jacobi zeros and weights with end point at z=-1,1.
double hgrjp(const int i, const double z, const double *zgrj, const int np, const double alpha, const double beta)
Compute the value of the i th Lagrangian interpolant through the.
void zwlk(double *z, double *w, const int npt, const double alpha, const double beta)
Gauss-Lobatto-Kronrod-Jacobi zeros and weights.
void JacZeros(const int n, double *a, double *b, const double alpha, const double beta)
Zero and Weight determination through the eigenvalues and eigenvectors of a tridiagonal.
void chri1(int, double *, double *, double *, double *, double)
Given a weight function through the first n+1.
void jacobd(const int np, const double *z, double *polyd, const int n, const double alpha, const double beta)
Calculate the derivative of Jacobi polynomials.
#define jacobz(n, z, alpha, beta)
zero determination using Newton iteration with polynomial deflation
#define STOP
Maximum number of iterations in polynomial defalation routine Jacobz.
void Imglj(double *im, const double *zglj, const double *zm, const int nz, const int mz, const double alpha, const double beta)
Interpolation Operator from Gauss-Lobatto-Jacobi points.
void JKMatrix(int, double *, double *)
Calcualtes the Jacobi-kronrod matrix by determining the.
void Dgrjm(double *D, const double *z, const int np, const double alpha, const double beta)
Compute the Derivative Matrix and its transpose associated.
void zwgk(double *z, double *w, const int npt, const double alpha, const double beta)
Gauss-Kronrod-Jacobi zeros and weights.
void Imgrjm(double *im, const double *zgrj, const double *zm, const int nz, const int mz, const double alpha, const double beta)
Interpolation Operator from Gauss-Radau-Jacobi points.
void Dgrjp(double *D, const double *z, const int np, const double alpha, const double beta)
Compute the Derivative Matrix associated with the.
void zwgrjm(double *z, double *w, const int np, const double alpha, const double beta)
Gauss-Radau-Jacobi zeros and weights with end point at z=-1.
The namespace associated with the the Polylib library (Polylib introduction)
static void TriQL(const int, double *, double *, double **)
QL algorithm for symmetric tridiagonal matrix.
static void Jacobz(const int n, double *z, const double alpha, const double beta)
Calculate the n zeros, z, of the Jacobi polynomial, i.e.
void zwrk(double *z, double *w, const int npt, const double alpha, const double beta)
Gauss-Radau-Kronrod-Jacobi zeros and weights.
double hglj(const int i, const double z, const double *zglj, const int np, const double alpha, const double beta)
Compute the value of the i th Lagrangian interpolant through the.
std::complex< Nektar::NekDouble > ImagBesselComp(int n, std::complex< Nektar::NekDouble > y)
Calcualte the bessel function of the first kind with complex double input y. Taken from Numerical Rec...
double hgrjm(const int i, const double z, const double *zgrj, const int np, const double alpha, const double beta)
Compute the value of the i th Lagrangian interpolant through the.
#define EPS
Precision tolerance for two points to be similar.
void Dglj(double *D, const double *z, const int np, const double alpha, const double beta)
Compute the Derivative Matrix associated with the.
void Imgj(double *im, const double *zgj, const double *zm, const int nz, const int mz, const double alpha, const double beta)
Interpolation Operator from Gauss-Jacobi points to an.
void jacobfd(const int np, const double *z, double *poly_in, double *polyd, const int n, const double alpha, const double beta)
Routine to calculate Jacobi polynomials, , and their first derivative, .
double gammaF(const double)
Calculate the Gamma function , , for integer.
void zwgj(double *z, double *w, const int np, const double alpha, const double beta)
Gauss-Jacobi zeros and weights.