153 double *z, *w, *
p, *q, sum = 0, alpha,
beta, *d, *dt;
165 printf(
"Begin checking Gauss integration\n");
176 for (n = 2; n < 2 * np - 1; ++n)
179 sum =
ddot(np, w, 1,
p, 1);
181 printf(
"alpha = %lf, beta = %lf, np = %d, n = %d "
183 alpha,
beta, np, n, sum);
189 printf(
"finished checking all beta values for alpha = %lf\n", alpha);
192 printf(
"Finished checking Gauss Integration\n");
197 printf(
"Begin checking Gauss Radau Integration\n");
207 for (n = 2; n < 2 * np - 2; ++n)
210 sum =
ddot(np, w, 1,
p, 1);
212 printf(
"alpha = %lf, beta = %lf, np = %d, n = %d "
214 alpha,
beta, np, n, sum);
220 printf(
"finished checking all beta values for alpha = %lf\n", alpha);
223 printf(
"Finished checking Gauss Radau (z=-1) Integration\n");
228 printf(
"Begin checking Gauss Radau Integration\n");
238 for (n = 2; n < 2 * np - 2; ++n)
241 sum =
ddot(np, w, 1,
p, 1);
243 printf(
"alpha = %lf, beta = %lf, np = %d, n = %d "
245 alpha,
beta, np, n, sum);
251 printf(
"finished checking all beta values for alpha = %lf\n", alpha);
254 printf(
"Finished checking Gauss Radau (z=1) Integration\n");
257 #if GAUSS_LOBATTO_INT
259 printf(
"Begin checking Gauss Lobatto integration\n");
270 for (n = 2; n < 2 * np - 3; ++n)
273 sum =
ddot(np, w, 1,
p, 1);
275 printf(
"alpha = %lf, beta = %lf, np = %d, n = %d "
277 alpha,
beta, np, n, sum);
283 printf(
"finished checking all beta values for alpha = %lf\n", alpha);
286 printf(
"Finished checking Gauss Lobatto Integration\n");
290 printf(
"Begin checking integration through Gauss points\n");
302 for (n = 2; n < np - 1; ++n)
304 for (i = 0; i < np; ++i)
307 for (i = 0; i < np; ++i)
308 sum += fabs(
ddot(np, q + i * np, 1,
p, 1) -
309 pow(z[i], n + 1) / (n + 1));
312 printf(
"alpha = %lf, beta = %lf, np = %d, n = %d "
314 alpha,
beta, np, n, sum);
319 printf(
"finished checking all beta values for alpha = %lf\n", alpha);
322 printf(
"Finished checking Gauss Jacobi integration\n");
326 printf(
"Begin checking integration through Gauss Radau points\n");
338 for (n = 2; n < np - 1; ++n)
340 for (i = 0; i < np; ++i)
343 for (i = 0; i < np; ++i)
344 sum += fabs(
ddot(np, q + i * np, 1,
p, 1) -
345 pow(z[i], n + 1) / (n + 1));
348 printf(
"alpha = %lf, beta = %lf, np = %d, n = %d "
350 alpha,
beta, np, n, sum);
355 printf(
"finished checking all beta values for alpha = %lf\n", alpha);
358 printf(
"Finished checking Gauss Radau integration\n");
362 printf(
"Begin checking integration through Gauss Radau (z=1) points\n");
374 for (n = 2; n < np - 1; ++n)
376 for (i = 0; i < np; ++i)
379 for (i = 0; i < np; ++i)
380 sum += fabs(
ddot(np, q + i * np, 1,
p, 1) -
381 pow(z[i], n + 1) / (n + 1));
384 printf(
"alpha = %lf, beta = %lf, np = %d, n = %d "
386 alpha,
beta, np, n, sum);
391 printf(
"finished checking all beta values for alpha = %lf\n", alpha);
394 printf(
"Finished checking Gauss Radau (z=1) integration\n");
397 #if GAUSS_LOBATTO_INT
398 printf(
"Begin checking integration through Gauss Lobatto points\n");
410 for (n = 2; n < np - 1; ++n)
412 for (i = 0; i < np; ++i)
415 for (i = 0; i < np; ++i)
416 sum += fabs(
ddot(np, q + i * np, 1,
p, 1) -
417 pow(z[i], n + 1) / (n + 1));
420 printf(
"alpha = %lf, beta = %lf, np = %d, n = %d "
422 alpha,
beta, np, n, sum);
427 printf(
"finished checking all beta values for alpha = %lf\n", alpha);
430 printf(
"Finished checking Gauss Lobatto integration\n");
434 printf(
"Begin checking differentiation through Gauss points\n");
446 for (n = 2; n < np - 1; ++n)
448 for (i = 0; i < np; ++i)
451 for (i = 0; i < np; ++i)
452 sum += fabs(
ddot(np, d + i, np,
p, 1) -
453 n * pow(z[i], n - 1));
456 printf(
"alpha = %lf, beta = %lf, np = %d, n = %d "
458 alpha,
beta, np, n, sum);
463 printf(
"finished checking all beta values for alpha = %lf\n", alpha);
466 printf(
"Finished checking Gauss Jacobi differentiation\n");
469 #if GAUSS_RADAUM_DIFF
470 printf(
"Begin checking differentiation through Gauss Radau points\n");
482 for (n = 2; n < np - 1; ++n)
484 for (i = 0; i < np; ++i)
487 for (i = 0; i < np; ++i)
488 sum += fabs(
ddot(np, d + i, np,
p, 1) -
489 n * pow(z[i], n - 1));
492 printf(
"alpha = %lf, beta = %lf, np = %d, n = %d "
494 alpha,
beta, np, n, sum);
499 printf(
"finished checking all beta values for alpha = %lf\n", alpha);
502 printf(
"Finished checking Gauss Radau (z=-1) differentiation\n");
505 #if GAUSS_RADAUP_DIFF
506 printf(
"Begin checking differentiation through Gauss Radau (z=1) points\n");
518 for (n = 2; n < np - 1; ++n)
520 for (i = 0; i < np; ++i)
523 for (i = 0; i < np; ++i)
524 sum += fabs(
ddot(np, d + i, np,
p, 1) -
525 n * pow(z[i], n - 1));
528 printf(
"alpha = %lf, beta = %lf, np = %d, n = %d "
530 alpha,
beta, np, n, sum);
535 printf(
"finished checking all beta values for alpha = %lf\n", alpha);
538 printf(
"Finished checking Gauss Radau (z=1) differentiation\n");
541 #if GAUSS_LOBATTO_DIFF
542 printf(
"Begin checking differentiation through Gauss Lobatto points\n");
554 for (n = 2; n < np - 1; ++n)
556 for (i = 0; i < np; ++i)
559 for (i = 0; i < np; ++i)
560 sum += fabs(
ddot(np, d + i, np,
p, 1) -
561 n * pow(z[i], n - 1));
564 printf(
"alpha = %lf, beta = %lf, np = %d, n = %d "
566 alpha,
beta, np, n, sum);
571 printf(
"finished checking all beta values for alpha = %lf\n", alpha);
574 printf(
"Finished checking Gauss Lobatto differentiation\n");
579 printf(
"Begin checking interpolation through Gauss points\n");
590 for (n = 2; n < np - 1; ++n)
592 for (i = 0; i < np; ++i)
594 w[i] = 2.0 * i / (double)(np - 1) - 1.0;
599 for (i = 0; i < np; ++i)
600 sum += fabs(
ddot(np, d + i, np,
p, 1) - pow(w[i], n));
603 printf(
"alpha = %lf, beta = %lf, np = %d, n = %d "
605 alpha,
beta, np, n, sum);
610 printf(
"finished checking all beta values for alpha = %lf\n", alpha);
613 printf(
"Finished checking Gauss Jacobi interpolation\n");
616 #if GAUSS_RADAUM_INTERP
617 printf(
"Begin checking Interpolation through Gauss Radau (z=-1) points\n");
628 for (n = 2; n < np - 1; ++n)
630 for (i = 0; i < np; ++i)
632 w[i] = 2.0 * i / (double)(np - 1) - 1.0;
637 for (i = 0; i < np; ++i)
638 sum += fabs(
ddot(np, d + i, np,
p, 1) - pow(w[i], n));
641 printf(
"alpha = %lf, beta = %lf, np = %d, n = %d "
643 alpha,
beta, np, n, sum);
648 printf(
"finished checking all beta values for alpha = %lf\n", alpha);
651 printf(
"Finished checking Gauss Radua Jacobi (z=-1) interpolation\n");
653 #if GAUSS_RADAUP_INTERP
654 printf(
"Begin checking Interpolation through Gauss Radau (z=1) points\n");
665 for (n = 2; n < np - 1; ++n)
667 for (i = 0; i < np; ++i)
669 w[i] = 2.0 * i / (double)(np - 1) - 1.0;
674 for (i = 0; i < np; ++i)
675 sum += fabs(
ddot(np, d + i, np,
p, 1) - pow(w[i], n));
678 printf(
"alpha = %lf, beta = %lf, np = %d, n = %d "
680 alpha,
beta, np, n, sum);
685 printf(
"finished checking all beta values for alpha = %lf\n", alpha);
688 printf(
"Finished checking Gauss Radau (z=1) interpolation\n");
691 #if GAUSS_LOBATTO_INTERP
692 printf(
"Begin checking Interpolation through Gauss Lobatto points\n");
703 for (n = 2; n < np - 1; ++n)
705 for (i = 0; i < np; ++i)
707 w[i] = 2.0 * i / (double)(np - 1) - 1.0;
712 for (i = 0; i < np; ++i)
713 sum += fabs(
ddot(np, d + i, np,
p, 1) - pow(w[i], n));
716 printf(
"alpha = %lf, beta = %lf, np = %d, n = %d "
718 alpha,
beta, np, n, sum);
723 printf(
"finished checking all beta values for alpha = %lf\n", alpha);
726 printf(
"Finished checking Gauss Lobatto interploation\n");
double * dvector(int, int)
int test_gamma_fraction()
double ddot(int, double *, int, double *, int)
@ beta
Gauss Radau pinned at x=-1,.
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.
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.
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.
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.
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 ...
void Qg(double *Q, const double *z, const int np, const int offset)
Compute the Integration Matrix.
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.
void zwgj(double *z, double *w, const int np, const double alpha, const double beta)
Gauss-Jacobi zeros and weights.
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.
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...
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...
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.
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.
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, .