GaussJacobiQuadCInterp.c
Go to the documentation of this file.
1 // BEGIN_HEADER
2 // -----------------------------------------------------------------------------
3 // Gauss-Jacobi Quadrature Implementation
4 // Authors: Rohit Goswami <rgoswami[at]ieee.org>
5 // Source: GaussJacobiQuad Library
6 // License: MIT
7 // GitHub Repository: https://github.com/HaoZeke/GaussJacobiQuad
8 // Date: 2023-08-28
9 // Commit: c442f77
10 // -----------------------------------------------------------------------------
11 // This code is part of the GaussJacobiQuad library, providing an efficient
12 // implementation for Gauss-Jacobi quadrature nodes and weights computation.
13 // -----------------------------------------------------------------------------
14 // To cite this software:
15 // Rohit Goswami (2023). HaoZeke/GaussJacobiQuad: v0.1.0.
16 // Zenodo: https://doi.org/10.5281/ZENODO.8285112
17 // ---------------------------------------------------------------------
18 // END_HEADER
19 #include "GaussJacobiQuadCInterp.h"
20 
21 void gauss_jacobi_c(int* npts, double* alpha, double* beta, double x[], double wts[], const char* method) {
22  if (*npts <= 0) {
23  fprintf(stderr, "Error: npts must positive\n");
24  exit(EXIT_FAILURE);
25  }
26 
27  if (*alpha <= -1.0f) {
28  fprintf(stderr, "Error: alpha must be greater than -1\n");
29  exit(EXIT_FAILURE);
30  }
31 
32  if (*beta <= -1.0f) {
33  fprintf(stderr, "Error: beta must be greater than -1\n");
34  exit(EXIT_FAILURE);
35  }
36 
37  if (strcmp(method, "rec") == 0) {
38  gauss_jacobi_rec_c(npts, alpha, beta, x, wts);
39  } else if (strcmp(method, "gw") == 0) {
40  gauss_jacobi_gw_c(npts, alpha, beta, x, wts);
41  } else if (strcmp(method, "algo665") == 0) {
42  gauss_jacobi_algo665_c(npts, alpha, beta, x, wts);
43  } else {
44  fprintf(stderr, "Error: Unknown method specified: %s\n", method);
45  fprintf(stderr, "Supported methods: 'rec', 'gw', 'algo665'\n");
46  exit(EXIT_FAILURE);
47  }
48 }
void gauss_jacobi_c(int *npts, double *alpha, double *beta, double x[], double wts[], const char *method)
void gauss_jacobi_algo665_c(int *npts, double *alpha, double *beta, double x[], double wts[])
void gauss_jacobi_gw_c(int *npts, double *alpha, double *beta, double x[], double wts[])
void gauss_jacobi_rec_c(int *npts, double *alpha, double *beta, double x[], double wts[])