Skip to main content

Crate mathverse_complex

Crate mathverse_complex 

Source
Expand description

Complex numbers over any RealFull type (f64 by default).

Division by zero and ln(0) etc. yield NaN/inf components, mirroring std float semantics (no panics).

§Generic precision

Complex defaults to f64 components (Complex<T = f64>), so existing code that writes Complex keeps working unchanged. C32 and C64 are convenience aliases. The whole arithmetic suite is generic over T: RealFull (conversion, powers, transcendental, trigonometric, hyperbolic and float-classification operations), so Complex<f32>, Complex<f64>, and any future RealFull type share the same code.

Several method names follow the cmath/numpy conventions for Python parity: Complex::phase, Complex::to_polar, Complex::rect and Complex::is_close.

Re-exports§

pub use analysis::ComplexAnalysis;
pub use fft::fft;
pub use fft::ifft;
pub use matrix::ComplexMatrix;
pub use polynomial::eval_polynomial;
pub use polynomial::polynomial_roots;
pub use special_functions::ComplexSpecialFunctions;

Modules§

analysis
Complex analysis: residues, contour integration, analytic continuation.
fft
Fast Fourier Transform (radix-2 Cooley–Tukey) and inverse FFT.
matrix
Complex matrix operations: arithmetic, decomposition, eigenvalues.
polynomial
Polynomial evaluation and root finding.
special_functions
Complex special functions: gamma, zeta, polylog, and related functions.

Structs§

Complex
Complex number re + im·i over any real type T (defaults to f64).

Functions§

mandelbrot_iterate
Iterate z → z² + c until escape or max_iterations. Returns the iteration count at which |z|² > escape_radius² (max_iterations if the orbit never escapes).
mandelbrot_smooth
Smooth iteration count for Mandelbrot coloring: n + 1 − log₂(log|z|) at escape (fractional for smooth gradients).

Type Aliases§

C32
Single-precision complex number (f32 components).
C64
Double-precision complex number (f64 components).