Skip to content

Commit

Permalink
Update to easyfft v0.3
Browse files Browse the repository at this point in the history
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:
ejmahler/RustFFT#105
  • Loading branch information
WalterSmuts committed Dec 9, 2022
1 parent 14950db commit 14c1c07
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ ndarray = "^0.15"
ndarray-linalg = "^0.16"
num-traits = "^0.2"
num = "^0.4"
easyfft = "^0.2"
easyfft = "^0.3"
7 changes: 4 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -77,7 +78,7 @@ pub fn fftconvolve<A, S, D>(
mode: Mode,
) -> Result<ArrayBase<OwnedRepr<A>, D>, Box<dyn Error>>
where
A: FftNum + FromPrimitive,
A: FftNum + FromPrimitive + Default,
S: Data<Elem = A>,
D: Dimension,
{
Expand Down Expand Up @@ -138,7 +139,7 @@ pub fn fftcorrelate<A, S, D>(
mode: Mode,
) -> Result<ArrayBase<OwnedRepr<A>, D>, Box<dyn Error>>
where
A: FftNum + FromPrimitive,
A: FftNum + FromPrimitive + Default,
S: Data<Elem = A>,
D: Dimension,
{
Expand Down

0 comments on commit 14c1c07

Please sign in to comment.