GaussJacobiQuad

About

A permissively licensed modern Fortran implementation of Gauss–Jacobi quadrature: nodes and weights on [-1, 1] for weight (1-x)^α (1+x)^β (α,β > −1). Multiple algorithms, auto method selection, Coarray Fortran, and C/Python bindings.

Documentation

Start here Link
Docs hub (Diátaxis) docs/orgmode/index.org
Quickstart (build + first rule) tutorials/quickstart
C / Python howto/bindings
CAF multi-image howto/caf
Methods & auto policy explanation/methods
Method name strings reference/method-names
Bibliography docs/refs.bib (ookcite collection GaussJacobiQuad)

Build static narrative HTML (+ optional Doxygen):

./docs/scripts/build_docs.sh
# → docs/site/index.html

Quick install

micromamba create -f environment.yml
micromamba activate gaussjacquad
fpm build --flag "-fcoarray=single"
fpm test --flag "-fcoarray=single"
fpm run --flag "-fcoarray=single" gjp_quad -- 32 0.0 0.0 auto

Preferred library entry:

use GaussJacobiQuad, only: gauss_jacobi_rule
call gauss_jacobi_rule(npts, alpha, beta, x, wts) ! auto
call gauss_jacobi_rule(npts, alpha, beta, x, wts, "glr") ! forced

Methods: auto (picks *_caf when multi-image), rec=/=rec_caf, gw, algo665=/=algo665_dc=/=algo665_dc_caf, sturm=/=sturm_caf, glr=/=glr_caf, bogaert=/=bogaert_caf (Legendre only, n≥21). Details: methods · name list.

Meson (library + C CLI)

meson setup bbdir -Dfcoarray=single
meson compile -C bbdir
./bbdir/c_cli_gjpq 32 0 0 auto
./bbdir/c_cli_gjpq 40 0.5 0.5 glr

Install from released packages

Rust (crates.io)

# Cargo.toml
[dependencies]
gauss-jacobi-quad = "0.2"

Build libgjp_cinterp (meson) and set GJP_CINTERP to the .so path. See crates/gauss-jacobi-quad/README.md.

use gauss_jacobi_quad::{gauss_jacobi, Method};
let (x, w) = gauss_jacobi(32, 0.0, 0.0, Method::Auto)?;

Python (PyPI)

CPython extension (ISOCBINDING gauss_jacobi_rule_c, multi-phase init). Wheels: Stable ABI cp39-abi3 (3.9+ GIL) and free-threaded cp313t. No GJP_CINTERP needed after install.

pip install gauss-jacobi-quad
python -c "from gauss_jacobi_quad import gauss_jacobi; print(gauss_jacobi(32,0,0)[0][:3])"

Build from repo root (requires gfortran + OpenBLAS): pip install . or python -m build. Trusted publishing: .github/workflows/publish-pypi.yml (OIDC + cibuildwheel, incl. cp313t).

Cite

If you use this library (including the interfaces), please cite:

Rohit Goswami. (2023). HaoZeke/GaussJacobiQuad: GaussJacobiQuad I (v0.1.0). Zenodo. https://doi.org/10.5281/zenodo.8285112

Method literature is tracked in ookcite collection GaussJacobiQuad and exported to docs/refs.bib (see citation).

@software{goswami_2023_8285112,
author = {Goswami, Rohit},
title = {HaoZeke/GaussJacobiQuad: GaussJacobiQuad I},
month = aug,
year = 2023,
publisher = {Zenodo},
version = {v0.1.0},
doi = {10.5281/zenodo.8285112},
url = {https://doi.org/10.5281/zenodo.8285112}
}

License

MIT — see LICENSE.