Nektar++
Polylib_test.cpp
Go to the documentation of this file.
1 #include "Polylib.h"
2 #include <cmath>
3 #include <cstdio>
4 
5 using namespace std;
6 using namespace Polylib;
7 
8 /* --------------------------------------------------------------------
9  To compile:
10  g++ -g -c Polylib.cpp -I ./ -I ../../
11  g++ -g -c Polylib_test.cpp -I ./ -I ../../
12  g++ -g -o polytest Polylib_test.o Polylib.o -lm
13  * --------------------------------------------------------------------*/
14 
15 /* -------------------------------------------------------------------
16  This is a routine to test the integration, differentiation and
17  interpolation routines in the polylib.c.
18 
19  First, it performs the integral
20 
21  /1 alpha beta alpha,beta
22  | (1-x) (1+x) P (x) dx = 0
23  /-1 n
24 
25  for all -0.5 <= alpha <= 5 (increments of 0.5)
26  -0.5 <= beta <= 5 (increments of 0.5)
27 
28  using np points where
29  NPLOWER <= np <= NPUPPER
30  2 <= n <= 2*np - delta
31 
32  delta = 1 (gauss), 2(radau), 3(lobatto).
33  The integral is evaluated and if it is larger that EPS then the
34  value of alpha,beta,np,n and the integral is printed to the screen.
35 
36  After every alpha value the statement
37  "finished checking all beta values for alpha = #"
38  is printed
39 
40  The routine then evaluates the derivate of
41 
42  d n n-1
43  -- x = n x
44  dx
45 
46  for all -0.5 <= alpha <= 5 (increments of 0.5)
47  -0.5 <= beta <= 5 (increments of 0.5)
48 
49  using np points where
50  NPLOWER <= np <= NPUPPER
51  2 <= n <= np - 1
52 
53  The error is check in a pointwise sense and if it is larger than
54  EPS then the value of alpha,beta,np,n and the error is printed to
55  the screen. After every alpha value the statement
56  "finished checking all beta values for alpha = #"
57  is printed
58 
59  Finally the routine evaluates the interpolation of
60 
61  n n
62  z to x
63 
64  where z are the quadrature zeros and x are the equispaced points
65 
66  2*i
67  x = ----- - 1.0 (0 <= i <= np-1)
68  i (np-1)
69 
70 
71  for all -0.5 <= alpha <= 5 (increments of 0.5)
72  -0.5 <= beta <= 5 (increments of 0.5)
73 
74  using np points where
75  NPLOWER <= np <= NPUPPER
76  2 <= n <= np - 1
77 
78  The error is check in a pointwise sense and if it is larger than
79  EPS then the value of alpha,beta,np,n and the error is printed to
80  the screen. After every alpha value the statement
81  "finished checking all beta values for alpha = #"
82  is printed
83 
84  The above checks are performed for all the Gauss, Gauss-Radau and
85  Gauss-Lobatto points. If you want to disable any routine then set
86  GAUSS_INT, GAUSS_RADAU_INT, GAUSS_LOBATTO_INT = 0
87  for the integration rouintes
88  GAUSS_DIFF,GAUSS_RADAU_DIFF, GAUSS_LOBATTO_DIFF = 0
89  for the differentiation routines
90  GAUSS_INTERP,GAUSS_RADAU_INTERP, GAUSS_LOBATTO_INTERP = 0
91  for the interpolation routines.
92  ------------------------------------------------------------------*/
93 
94 #define NPLOWER 5
95 #define NPUPPER 15
96 #define EPS 1e-12
97 
98 #define GAUSS_INT 1
99 #define GAUSS_RADAUM_INT 1
100 #define GAUSS_RADAUP_INT 1
101 #define GAUSS_LOBATTO_INT 1
102 #define GAUSS_DIFF 1
103 #define GAUSS_RADAUM_DIFF 1
104 #define GAUSS_RADAUP_DIFF 1
105 #define GAUSS_LOBATTO_DIFF 1
106 #define GAUSS_INTERP 1
107 #define GAUSS_RADAUM_INTERP 1
108 #define GAUSS_RADAUP_INTERP 1
109 #define GAUSS_LOBATTO_INTERP 1
110 
111 /* local routines */
112 double ddot(int, double *, int, double *, int);
113 double *dvector(int, int);
114 int test_gamma_fraction();
115 
116 int main()
117 {
118  int np, n, i;
119  double *z, *w, *p, sum = 0, alpha, beta, *d, *dt;
120 
121  z = dvector(0, NPUPPER - 1);
122  w = dvector(0, NPUPPER - 1);
123  p = dvector(0, NPUPPER - 1);
124 
125  d = dvector(0, NPUPPER * NPUPPER - 1);
126  dt = dvector(0, NPUPPER * NPUPPER - 1);
127 
128 #if GAUSS_INT
129  /* Gauss Integration */
130  printf("Begin checking Gauss integration\n");
131  alpha = -0.5;
132  while (alpha <= 5.0)
133  {
134  beta = -0.5;
135  while (beta <= 5.0)
136  {
137 
138  for (np = NPLOWER; np <= NPUPPER; ++np)
139  {
140  zwgj(z, w, np, alpha, beta);
141  for (n = 2; n < 2 * np - 1; ++n)
142  {
143  jacobfd(np, z, p, NULL, n, alpha, beta);
144  sum = ddot(np, w, 1, p, 1);
145  if (fabs(sum) > EPS)
146  printf("alpha = %lf, beta = %lf, np = %d, n = %d "
147  "integal was %lg\n",
148  alpha, beta, np, n, sum);
149  }
150  }
151 
152  beta += 0.5;
153  }
154  printf("finished checking all beta values for alpha = %lf\n", alpha);
155  alpha += 0.5;
156  }
157  printf("Finished checking Gauss Integration\n");
158 #endif
159 
160 #if GAUSS_RADAUM_INT
161  /* Gauss Radau Integration */
162  printf("Begin checking Gauss Radau Integration\n");
163  alpha = -0.5;
164  while (alpha <= 5.0)
165  {
166  beta = -0.5;
167  while (beta <= 5.0)
168  {
169  for (np = NPLOWER; np <= NPUPPER; ++np)
170  {
171  zwgrjm(z, w, np, alpha, beta);
172  for (n = 2; n < 2 * np - 2; ++n)
173  {
174  jacobfd(np, z, p, NULL, n, alpha, beta);
175  sum = ddot(np, w, 1, p, 1);
176  if (fabs(sum) > EPS)
177  printf("alpha = %lf, beta = %lf, np = %d, n = %d "
178  "integal was %lg\n",
179  alpha, beta, np, n, sum);
180  }
181  }
182 
183  beta += 0.5;
184  }
185  printf("finished checking all beta values for alpha = %lf\n", alpha);
186  alpha += 0.5;
187  }
188  printf("Finished checking Gauss Radau (z=-1) Integration\n");
189 #endif
190 
191 #if GAUSS_RADAUP_INT
192  /* Gauss Radau Integration */
193  printf("Begin checking Gauss Radau Integration\n");
194  alpha = -0.5;
195  while (alpha <= 5.0)
196  {
197  beta = -0.5;
198  while (beta <= 5.0)
199  {
200  for (np = NPLOWER; np <= NPUPPER; ++np)
201  {
202  zwgrjp(z, w, np, alpha, beta);
203  for (n = 2; n < 2 * np - 2; ++n)
204  {
205  jacobfd(np, z, p, NULL, n, alpha, beta);
206  sum = ddot(np, w, 1, p, 1);
207  if (fabs(sum) > EPS)
208  printf("alpha = %lf, beta = %lf, np = %d, n = %d "
209  "integal was %lg\n",
210  alpha, beta, np, n, sum);
211  }
212  }
213 
214  beta += 0.5;
215  }
216  printf("finished checking all beta values for alpha = %lf\n", alpha);
217  alpha += 0.5;
218  }
219  printf("Finished checking Gauss Radau (z=1) Integration\n");
220 #endif
221 
222 #if GAUSS_LOBATTO_INT
223  /* Gauss Lobatto Integration */
224  printf("Begin checking Gauss Lobatto integration\n");
225  alpha = -0.5;
226  while (alpha <= 5.0)
227  {
228  beta = -0.5;
229  while (beta <= 5.0)
230  {
231 
232  for (np = NPLOWER; np <= NPUPPER; ++np)
233  {
234  zwglj(z, w, np, alpha, beta);
235  for (n = 2; n < 2 * np - 3; ++n)
236  {
237  jacobfd(np, z, p, NULL, n, alpha, beta);
238  sum = ddot(np, w, 1, p, 1);
239  if (fabs(sum) > EPS)
240  printf("alpha = %lf, beta = %lf, np = %d, n = %d "
241  "integal was %lg\n",
242  alpha, beta, np, n, sum);
243  }
244  }
245 
246  beta += 0.5;
247  }
248  printf("finished checking all beta values for alpha = %lf\n", alpha);
249  alpha += 0.5;
250  }
251  printf("Finished checking Gauss Lobatto Integration\n");
252 #endif
253 
254 #if GAUSS_DIFF
255  printf("Begin checking differentiation through Gauss points\n");
256  alpha = -0.5;
257  while (alpha <= 5.0)
258  {
259  beta = -0.5;
260  while (beta <= 5.0)
261  {
262 
263  for (np = NPLOWER; np <= NPUPPER; ++np)
264  {
265  zwgj(z, w, np, alpha, beta);
266  for (n = 2; n < np - 1; ++n)
267  {
268  Dgj(d, z, np, alpha, beta);
269 
270  for (i = 0; i < np; ++i)
271  p[i] = pow(z[i], n);
272  sum = 0;
273  for (i = 0; i < np; ++i)
274  sum += fabs(ddot(np, d + i * np, 1, p, 1) -
275  n * pow(z[i], n - 1));
276  sum /= np;
277  if (fabs(sum) > EPS)
278  printf("alpha = %lf, beta = %lf, np = %d, n = %d "
279  "difference %lg\n",
280  alpha, beta, np, n, sum);
281  }
282  }
283  beta += 0.5;
284  }
285  printf("finished checking all beta values for alpha = %lf\n", alpha);
286  alpha += 0.5;
287  }
288  printf("Finished checking Gauss Jacobi differentiation\n");
289 #endif
290 
291 #if GAUSS_RADAUM_DIFF
292  printf("Begin checking differentiation through Gauss Radau points\n");
293  alpha = -0.5;
294  while (alpha <= 5.0)
295  {
296  beta = -0.5;
297  while (beta <= 5.0)
298  {
299 
300  for (np = NPLOWER; np <= NPUPPER; ++np)
301  {
302  zwgrjm(z, w, np, alpha, beta);
303  for (n = 2; n < np - 1; ++n)
304  {
305  Dgrjm(d, z, np, alpha, beta);
306  for (i = 0; i < np; ++i)
307  p[i] = pow(z[i], n);
308  sum = 0;
309  for (i = 0; i < np; ++i)
310  sum += fabs(ddot(np, d + i * np, 1, p, 1) -
311  n * pow(z[i], n - 1));
312  sum /= np;
313  if (fabs(sum) > EPS)
314  printf("alpha = %lf, beta = %lf, np = %d, n = %d "
315  "difference %lg\n",
316  alpha, beta, np, n, sum);
317  }
318  }
319  beta += 0.5;
320  }
321  printf("finished checking all beta values for alpha = %lf\n", alpha);
322  alpha += 0.5;
323  }
324  printf("Finished checking Gauss Radau (z=-1) differentiation\n");
325 #endif
326 
327 #if GAUSS_RADAUP_DIFF
328  printf("Begin checking differentiation through Gauss Radau (z=1) points\n");
329  alpha = -0.5;
330  while (alpha <= 5.0)
331  {
332  beta = -0.5;
333  while (beta <= 5.0)
334  {
335 
336  for (np = NPLOWER; np <= NPUPPER; ++np)
337  {
338  zwgrjp(z, w, np, alpha, beta);
339  for (n = 2; n < np - 1; ++n)
340  {
341  Dgrjp(d, z, np, alpha, beta);
342  for (i = 0; i < np; ++i)
343  p[i] = pow(z[i], n);
344  sum = 0;
345  for (i = 0; i < np; ++i)
346  sum += fabs(ddot(np, d + i * np, 1, p, 1) -
347  n * pow(z[i], n - 1));
348  sum /= np;
349  if (fabs(sum) > EPS)
350  printf("alpha = %lf, beta = %lf, np = %d, n = %d "
351  "difference %lg\n",
352  alpha, beta, np, n, sum);
353  }
354  }
355  beta += 0.5;
356  }
357  printf("finished checking all beta values for alpha = %lf\n", alpha);
358  alpha += 0.5;
359  }
360  printf("Finished checking Gauss Radau (z=1) differentiation\n");
361 #endif
362 
363 #if GAUSS_LOBATTO_DIFF
364  printf("Begin checking differentiation through Gauss Lobatto points\n");
365  alpha = -0.5;
366  while (alpha <= 5.0)
367  {
368  beta = -0.5;
369  while (beta <= 5.0)
370  {
371 
372  for (np = NPLOWER; np <= NPUPPER; ++np)
373  {
374  zwglj(z, w, np, alpha, beta);
375  for (n = 2; n < np - 1; ++n)
376  {
377  Dglj(d, z, np, alpha, beta);
378  for (i = 0; i < np; ++i)
379  p[i] = pow(z[i], n);
380  sum = 0;
381  for (i = 0; i < np; ++i)
382  sum += fabs(ddot(np, d + i * np, 1, p, 1) -
383  n * pow(z[i], n - 1));
384  sum /= np;
385  if (fabs(sum) > EPS)
386  printf("alpha = %lf, beta = %lf, np = %d, n = %d "
387  "difference %lg\n",
388  alpha, beta, np, n, sum);
389  }
390  }
391  beta += 0.5;
392  }
393  printf("finished checking all beta values for alpha = %lf\n", alpha);
394  alpha += 0.5;
395  }
396  printf("Finished checking Gauss Lobatto differentiation\n");
397 #endif
398 
399  /* check interpolation routines */
400 #if GAUSS_INTERP
401  printf("Begin checking interpolation through Gauss points\n");
402  alpha = -0.5;
403  while (alpha <= 5.0)
404  {
405  beta = -0.5;
406  while (beta <= 5.0)
407  {
408 
409  for (np = NPLOWER; np <= NPUPPER; ++np)
410  {
411  zwgj(z, w, np, alpha, beta);
412  for (n = 2; n < np - 1; ++n)
413  {
414  for (i = 0; i < np; ++i)
415  {
416  w[i] = 2.0 * i / (double)(np - 1) - 1.0;
417  p[i] = pow(z[i], n);
418  }
419  Imgj(d, z, w, np, np, alpha, beta);
420  sum = 0;
421  for (i = 0; i < np; ++i)
422  sum +=
423  fabs(ddot(np, d + i * np, 1, p, 1) - pow(w[i], n));
424  sum /= np;
425  if (fabs(sum) > EPS)
426  printf("alpha = %lf, beta = %lf, np = %d, n = %d "
427  "difference %lg\n",
428  alpha, beta, np, n, sum);
429  }
430  }
431  beta += 0.5;
432  }
433  printf("finished checking all beta values for alpha = %lf\n", alpha);
434  alpha += 0.5;
435  }
436  printf("Finished checking Gauss Jacobi interpolation\n");
437 #endif
438 
439 #if GAUSS_RADAUM_INTERP
440  printf("Begin checking Interpolation through Gauss Radau (z=-1) points\n");
441  alpha = -0.5;
442  while (alpha <= 5.0)
443  {
444  beta = -0.5;
445  while (beta <= 5.0)
446  {
447 
448  for (np = NPLOWER; np <= NPUPPER; ++np)
449  {
450  zwgrjm(z, w, np, alpha, beta);
451  for (n = 2; n < np - 1; ++n)
452  {
453  for (i = 0; i < np; ++i)
454  {
455  w[i] = 2.0 * i / (double)(np - 1) - 1.0;
456  p[i] = pow(z[i], n);
457  }
458  Imgrjm(d, z, w, np, np, alpha, beta);
459  sum = 0;
460  for (i = 0; i < np; ++i)
461  sum +=
462  fabs(ddot(np, d + i * np, 1, p, 1) - pow(w[i], n));
463  sum /= np;
464  if (fabs(sum) > EPS)
465  printf("alpha = %lf, beta = %lf, np = %d, n = %d "
466  "difference %lg\n",
467  alpha, beta, np, n, sum);
468  }
469  }
470  beta += 0.5;
471  }
472  printf("finished checking all beta values for alpha = %lf\n", alpha);
473  alpha += 0.5;
474  }
475  printf("Finished checking Gauss Radua Jacobi (z=-1) interpolation\n");
476 #endif
477 #if GAUSS_RADAUP_INTERP
478  printf("Begin checking Interpolation through Gauss Radau (z=1) points\n");
479  alpha = -0.5;
480  while (alpha <= 5.0)
481  {
482  beta = -0.5;
483  while (beta <= 5.0)
484  {
485 
486  for (np = NPLOWER; np <= NPUPPER; ++np)
487  {
488  zwgrjp(z, w, np, alpha, beta);
489  for (n = 2; n < np - 1; ++n)
490  {
491  for (i = 0; i < np; ++i)
492  {
493  w[i] = 2.0 * i / (double)(np - 1) - 1.0;
494  p[i] = pow(z[i], n);
495  }
496  Imgrjp(d, z, w, np, np, alpha, beta);
497  sum = 0;
498  for (i = 0; i < np; ++i)
499  sum +=
500  fabs(ddot(np, d + i * np, 1, p, 1) - pow(w[i], n));
501  sum /= np;
502  if (fabs(sum) > EPS)
503  printf("alpha = %lf, beta = %lf, np = %d, n = %d "
504  "difference %lg\n",
505  alpha, beta, np, n, sum);
506  }
507  }
508  beta += 0.5;
509  }
510  printf("finished checking all beta values for alpha = %lf\n", alpha);
511  alpha += 0.5;
512  }
513  printf("Finished checking Gauss Radau (z=1) interpolation\n");
514 #endif
515 
516 #if GAUSS_LOBATTO_INTERP
517  printf("Begin checking Interpolation through Gauss Lobatto points\n");
518  alpha = -0.5;
519  while (alpha <= 5.0)
520  {
521  beta = -0.5;
522  while (beta <= 5.0)
523  {
524 
525  for (np = NPLOWER; np <= NPUPPER; ++np)
526  {
527  zwglj(z, w, np, alpha, beta);
528  for (n = 2; n < np - 1; ++n)
529  {
530  for (i = 0; i < np; ++i)
531  {
532  w[i] = 2.0 * i / (double)(np - 1) - 1.0;
533  p[i] = pow(z[i], n);
534  }
535  Imglj(d, z, w, np, np, alpha, beta);
536  sum = 0;
537  for (i = 0; i < np; ++i)
538  sum +=
539  fabs(ddot(np, d + i * np, 1, p, 1) - pow(w[i], n));
540  sum /= np;
541  if (fabs(sum) > EPS)
542  printf("alpha = %lf, beta = %lf, np = %d, n = %d "
543  "difference %lg\n",
544  alpha, beta, np, n, sum);
545  }
546  }
547  beta += 0.5;
548  }
549  printf("finished checking all beta values for alpha = %lf\n", alpha);
550  alpha += 0.5;
551  }
552  printf("Finished checking Gauss Lobatto interploation\n");
553 #endif
555 
556  free(z);
557  free(w);
558  free(p);
559  free(d);
560  free(dt);
561  return 0;
562 }
563 
564 double ddot(int n, double *x, int incx, double *y, int incy)
565 {
566  register double sum = 0.;
567 
568  while (n--)
569  {
570  sum += (*x) * (*y);
571  x += incx;
572  y += incy;
573  }
574  return sum;
575 }
576 
577 double *dvector(int nl, int nh)
578 {
579  double *v;
580 
581  v = (double *)malloc((unsigned)(nh - nl + 1) * sizeof(double));
582  return v - nl;
583 }
584 
586 {
587  double a = 362880.;
588  double c = Polylib::gammaFracGammaF(10, 0., 0, 1.);
589  printf("alpha = %7.2lf, beta = %7.2lf, difference %9.2e\n", 10., 1.,
590  c / a - 1.);
591  c = Polylib::gammaFracGammaF(1, 0., 12, -2.);
592  printf("alpha = %7.2lf, beta = %7.2lf, difference %9.2e\n", 1., 10.,
593  c * a - 1.);
594 
595  a = 30.;
596  c = Polylib::gammaFracGammaF(4, 3., 5, 0.);
597  printf("alpha = %7.2lf, beta = %7.2lf, difference %9.2e\n", 5., 7.,
598  c / a - 1.);
599  c = Polylib::gammaFracGammaF(5, 0., 7, 0.);
600  printf("alpha = %7.2lf, beta = %7.2lf, difference %9.2e\n", 7., 5.,
601  c * a - 1.);
602 
603  a = 21651.09375;
604  c = Polylib::gammaFracGammaF(7, 3.5, 5, 0.5);
605  printf("alpha = %7.2lf, beta = %7.2lf, difference %9.2e\n", 10.5, 5.5,
606  c / a - 1.);
607  c = Polylib::gammaFracGammaF(5, 0.5, 10, 0.5);
608  printf("alpha = %7.2lf, beta = %7.2lf, difference %9.2e\n", 5.5, 10.5,
609  c * a - 1.);
610 
611  a = 97429.921875;
612  c = Polylib::gammaFracGammaF(10, 0.5, 5, -0.5);
613  printf("alpha = %7.2lf, beta = %7.2lf, difference %9.2e\n", 10.5, 4.5,
614  c / a - 1.);
615  c = Polylib::gammaFracGammaF(5, -0.5, 11, -0.5);
616  printf("alpha = %7.2lf, beta = %7.2lf, difference %9.2e\n", 4.5, 10.5,
617  c * a - 1.);
618 
619  a = 2279.0625;
620  c = Polylib::gammaFracGammaF(10, -0.5, 5, 0.5);
621  printf("alpha = %7.2lf, beta = %7.2lf, difference %9.2e\n", 9.5, 5.5,
622  c / a - 1.);
623  c = Polylib::gammaFracGammaF(5, 0.5, 10, -0.5);
624  printf("alpha = %7.2lf, beta = %7.2lf, difference %9.2e\n", 5.5, 9.5,
625  c * a - 1.);
626 
627  a = 639383.8623046875;
628  c = Polylib::gammaFracGammaF(10, 0.5, 0, 0.5);
629  printf("alpha = %7.2lf, beta = %7.2lf, difference %9.2e\n", 10.5, 0.5,
630  c / a - 1.);
631  c = Polylib::gammaFracGammaF(0, 0.5, 10, 0.5);
632  printf("alpha = %7.2lf, beta = %7.2lf, difference %9.2e\n", 0.5, 10.5,
633  c * a - 1.);
634 
635  a = 5967498288235982848.;
636  c = Polylib::gammaFracGammaF(100, 0., 90, 0.5);
637  printf("alpha = %7.2lf, beta = %7.2lf, difference %9.2e\n", 100., 90.5,
638  c / a - 1.);
639  c = Polylib::gammaFracGammaF(90, 0.5, 100, 0.);
640  printf("alpha = %7.2lf, beta = %7.2lf, difference %9.2e\n", 90.5, 100.,
641  c * a - 1.);
642 
643  a = 5618641603777298169856.;
644  c = Polylib::gammaFracGammaF(200, 0., 191, -0.5);
645  printf("alpha = %7.2lf, beta = %7.2lf, difference %9.2e\n", 200., 190.5,
646  c / a - 1.);
647  c = Polylib::gammaFracGammaF(190, 0.5, 200, 0.);
648  printf("alpha = %7.2lf, beta = %7.2lf, difference %9.2e\n", 190.5, 200.,
649  c * a - 1.);
650 
651  a = 77396694214720029196288.;
652  c = Polylib::gammaFracGammaF(200, 0., 190, 0.);
653  printf("alpha = %7.2lf, beta = %7.2lf, difference %9.2e\n", 200., 190.,
654  c / a - 1.);
655  c = Polylib::gammaFracGammaF(190, 0., 200, 0.);
656  printf("alpha = %7.2lf, beta = %7.2lf, difference %9.2e\n", 190., 200.,
657  c * a - 1.);
658 
659  int Q = 2;
660  for (double alpha = -0.5; alpha <= 150.; alpha += 0.5)
661  {
662  for (double beta = -0.5; beta <= 150.; beta += 0.5)
663  {
664  a = Polylib::gammaF(Q + alpha) / Polylib::gammaF(Q + beta);
665  c = Polylib::gammaFracGammaF(Q, alpha, Q, beta) / a - 1.;
666  if (fabs(c) > 5.e-15)
667  {
668  printf("alpha = %7.2lf, beta = %7.2lf, difference %9.2e\n",
669  Q + alpha, Q + beta, c);
670  }
671  }
672  }
673 
674  return 0;
675 }
double * dvector(int, int)
#define NPUPPER
int test_gamma_fraction()
#define EPS
double ddot(int, double *, int, double *, int)
#define NPLOWER
int main()
@ beta
Gauss Radau pinned at x=-1,.
Definition: PointsType.h:61
The namespace associated with the the Polylib library (Polylib introduction)
Definition: Polylib.cpp:18
double gammaF(const double)
Calculate the Gamma function , , for integer values and halves.
Definition: Polylib.cpp:1216
void Dgj(double *D, const double *z, const int np, const double alpha, const double beta)
Compute the Derivative Matrix and its transpose associated with the Gauss-Jacobi zeros.
Definition: Polylib.cpp:558
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.
Definition: Polylib.cpp:127
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.
Definition: Polylib.cpp:168
void Dglj(double *D, const double *z, const int np, const double alpha, const double beta)
Compute the Derivative Matrix associated with the Gauss-Lobatto-Jacobi zeros.
Definition: Polylib.cpp:718
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 (including z=1) to an arbitrary distrubtion at ...
Definition: Polylib.cpp:985
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.
Definition: Polylib.cpp:207
void zwgj(double *z, double *w, const int np, const double alpha, const double beta)
Gauss-Jacobi zeros and weights.
Definition: Polylib.cpp:99
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 arbitrary distribution at points zm.
Definition: Polylib.cpp:923
double gammaFracGammaF(const int, const double, const int, const double)
Calculate fraction of two Gamma functions, , for integer values and halves.
Definition: Polylib.cpp:1265
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 (including z=-1) to an arbitrary distrubtion at...
Definition: Polylib.cpp:954
void Dgrjm(double *D, const double *z, const int np, const double alpha, const double beta)
Compute the Derivative Matrix and its transpose associated with the Gauss-Radau-Jacobi zeros with a z...
Definition: Polylib.cpp:605
void Dgrjp(double *D, const double *z, const int np, const double alpha, const double beta)
Compute the Derivative Matrix associated with the Gauss-Radau-Jacobi zeros with a zero at z=1.
Definition: Polylib.cpp:661
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 to an arbitrary distrubtion at points zm.
Definition: Polylib.cpp:1016
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, .
Definition: Polylib.cpp:1074