dwt_simd

Function dwt_simd 

pub fn dwt_simd<T: SignalType + 'static>(
    signal: &Signal<T>,
    wavelet: &dyn Wavelet,
    boundary: BoundaryMode,
) -> Result<DWTResult<T>>
Expand description

Generic SIMD DWT dispatcher — routes to the type-specific entry point that computes in T’s own precision domain.

dwt_generic (the fast path’s fallback) accumulates in T, so an f32 signal must stay in f32 here: routing it through dwt_simd_f64 and truncating would make the SIMD path diverge from the canonical path on the large Haar/Periodic f32 inputs that dwt::select_optimal_dwt_implementation sends to SIMD. The f32 -> f64 -> f32 and T::from_f64(v as f64) conversions below are exact for both supported SignalTypes, so this is a pure dispatch, not a re-quantization. Mirrors the zero-copy specialization in dwt::select_optimal_dwt_implementation, which reinterprets the slice in place on the production hot path.