From 14c1c07649f678bc64e2160fb1f88f47ede7ef89 Mon Sep 17 00:00:00 2001 From: Walter Smuts Date: Fri, 9 Dec 2022 16:10:14 +0200 Subject: [PATCH] Update to easyfft v0.3 Unfortunately this requires an extra Default trait bound which results in requiring a major version change. Practically it's not an issue since all elements that you'd want to convolve would implement Default, but it's a bit annoying. Default is required for initializing the scratch-buffer, which is strictly not necessary but requires changes to `rustfft`. It's currently pending this issue in rustfft: https://github.com/ejmahler/RustFFT/issues/105 --- Cargo.toml | 2 +- src/lib.rs | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index eee7598..328f165 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,4 +19,4 @@ ndarray = "^0.15" ndarray-linalg = "^0.16" num-traits = "^0.2" num = "^0.4" -easyfft = "^0.2" +easyfft = "^0.3" diff --git a/src/lib.rs b/src/lib.rs index 7f560d3..61897f3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,6 @@ use easyfft::prelude::*; -use easyfft::{Complex, FftNum}; +use easyfft::FftNum; +use easyfft::num_complex::Complex; use ndarray::{prelude::*, OwnedRepr, DataMut}; use ndarray::{Array, ArrayBase, Axis, Data, Dimension, Slice}; use num::FromPrimitive; @@ -77,7 +78,7 @@ pub fn fftconvolve( mode: Mode, ) -> Result, D>, Box> where - A: FftNum + FromPrimitive, + A: FftNum + FromPrimitive + Default, S: Data, D: Dimension, { @@ -138,7 +139,7 @@ pub fn fftcorrelate( mode: Mode, ) -> Result, D>, Box> where - A: FftNum + FromPrimitive, + A: FftNum + FromPrimitive + Default, S: Data, D: Dimension, {