Skip to main content

complex_bessel/
lib.rs

1//! Pure Rust implementation of complex Bessel functions based on Amos Algorithm 644 (TOMS 644).
2//!
3//! This crate provides complex-valued Bessel functions of the first kind (J),
4//! second kind (Y), modified first kind (I), modified second kind (K),
5//! Hankel functions (H), and Airy functions (Ai, Bi).
6//!
7//! # Status
8//!
9//! This crate is in early development (alpha). Function signatures are defined
10//! but implementations are not yet available.
11
12// TODO: remove this once functions are implemented
13#![allow(unused)]
14#![cfg_attr(not(feature = "std"), no_std)]
15
16#[cfg(not(feature = "std"))]
17extern crate alloc;
18
19pub mod machine;
20pub mod types;
21
22pub use machine::BesselFloat;
23pub use types::{AiryDerivative, BesselError, BesselResult, HankelKind, Scaling};
24
25use num_complex::Complex;
26
27// ── Single-value convenience functions ──
28
29/// Bessel function of the first kind, J_ν(z).
30pub fn besselj<T: BesselFloat>(nu: T, z: Complex<T>) -> Result<Complex<T>, BesselError> {
31    todo!()
32}
33
34/// Bessel function of the second kind, Y_ν(z).
35pub fn bessely<T: BesselFloat>(nu: T, z: Complex<T>) -> Result<Complex<T>, BesselError> {
36    todo!()
37}
38
39/// Modified Bessel function of the first kind, I_ν(z).
40pub fn besseli<T: BesselFloat>(nu: T, z: Complex<T>) -> Result<Complex<T>, BesselError> {
41    todo!()
42}
43
44/// Modified Bessel function of the second kind, K_ν(z).
45pub fn besselk<T: BesselFloat>(nu: T, z: Complex<T>) -> Result<Complex<T>, BesselError> {
46    todo!()
47}
48
49/// Hankel function, H_ν^(m)(z).
50pub fn hankel<T: BesselFloat>(
51    kind: HankelKind,
52    nu: T,
53    z: Complex<T>,
54) -> Result<Complex<T>, BesselError> {
55    todo!()
56}
57
58/// Airy function Ai(z) or its derivative Ai'(z).
59pub fn airy<T: BesselFloat>(
60    z: Complex<T>,
61    deriv: AiryDerivative,
62) -> Result<Complex<T>, BesselError> {
63    todo!()
64}
65
66/// Airy function Bi(z) or its derivative Bi'(z).
67pub fn biry<T: BesselFloat>(
68    z: Complex<T>,
69    deriv: AiryDerivative,
70) -> Result<Complex<T>, BesselError> {
71    todo!()
72}
73
74// ── Sequence functions with scaling option ──
75
76/// Compute J_{ν+j}(z) for j = 0, 1, ..., n-1.
77pub fn besselj_seq<T: BesselFloat>(
78    nu: T,
79    z: Complex<T>,
80    n: usize,
81    scaling: Scaling,
82) -> Result<BesselResult<T>, BesselError> {
83    todo!()
84}
85
86/// Compute Y_{ν+j}(z) for j = 0, 1, ..., n-1.
87pub fn bessely_seq<T: BesselFloat>(
88    nu: T,
89    z: Complex<T>,
90    n: usize,
91    scaling: Scaling,
92) -> Result<BesselResult<T>, BesselError> {
93    todo!()
94}
95
96/// Compute I_{ν+j}(z) for j = 0, 1, ..., n-1.
97pub fn besseli_seq<T: BesselFloat>(
98    nu: T,
99    z: Complex<T>,
100    n: usize,
101    scaling: Scaling,
102) -> Result<BesselResult<T>, BesselError> {
103    todo!()
104}
105
106/// Compute K_{ν+j}(z) for j = 0, 1, ..., n-1.
107pub fn besselk_seq<T: BesselFloat>(
108    nu: T,
109    z: Complex<T>,
110    n: usize,
111    scaling: Scaling,
112) -> Result<BesselResult<T>, BesselError> {
113    todo!()
114}
115
116/// Compute H_{ν+j}^(m)(z) for j = 0, 1, ..., n-1.
117pub fn hankel_seq<T: BesselFloat>(
118    kind: HankelKind,
119    nu: T,
120    z: Complex<T>,
121    n: usize,
122    scaling: Scaling,
123) -> Result<BesselResult<T>, BesselError> {
124    todo!()
125}