hankrs 2.0.0

An implementation of quasi-discrete Hankel transforms in Rust
Documentation
//! A library for performing quasi-discrete Hankel transforms.
//!
//! This crate provides tools for efficiently computing Hankel transforms
//! of various orders using a quasi-discrete approximation. It operates seamlessly
//! on `ndarray` arrays and natively supports both real (`f64`) and complex
//! (`num_complex::Complex64`) numbers via the [`HankelScalar`] trait.
//!
//! # Compatibility
//!
//! * **`hankrs 2.x`** targets `ndarray 0.17`.
//! * For projects using `ndarray 0.16`, use **`hankrs 1.x`**.
//!
//! # Examples and Guides
//! Comprehensive examples and theoretical demonstrations can be found in the
//! [online `hankrs` book](https://etfrogers.github.io/hankrs/).
//!
//! ## Quick Start
//! ```rust
//! # #[cfg(feature = "blas")]
//! # extern crate blas_src;
//! use hankrs::HankelTransform;
//! use ndarray::{Array1, Axis};
//!
//! // 1. Create a transformer for order 0 up to radius 10.0 with 256 points
//! let transformer = HankelTransform::new(0, 10.0, 256).unwrap();
//!
//! // 2. Define a function on the generated radial grid `transformer.radius()`
//! let r = transformer.radius();
//! let f = r.mapv(|rad| (-rad * rad).exp()); // Gaussian function
//!
//! // 3. Compute the quasi-discrete Hankel transform (QDHT)
//! let ht = transformer.qdht(&f, Axis(0));
//!
//! // The transformed values are evaluated at `transformer.kr()` (or `transformer.frequency()`)
//! ```

// Not using BLAS increases time by 4% on a qdht with 256 points, and 233% on a qdht with 1024 points
// Using bessel_zeros fast mode, and real_bessel, speeds up creation by a factor of 4.
#![warn(clippy::all, clippy::pedantic)]
#![warn(missing_docs)]

mod hankel;

/// Convenience functions for performing one-off Hankel transforms.
pub mod one_shot;

/// The primary struct used for computing Hankel transforms.
pub use hankel::{HankelError, HankelScalar, HankelTransform, TransformType};

#[cfg(test)]
pub(crate) use hankel::{spherical_jn, spherical_jn_zeros};

#[cfg(test)]
mod tests;