chalharu / chfft Goto Github PK
View Code? Open in Web Editor NEWChalharu's Fastest Fourier Transform crate for Rust.
License: Mozilla Public License 2.0
Chalharu's Fastest Fourier Transform crate for Rust.
License: Mozilla Public License 2.0
I used chfft during my thesis. Should I cite this? If so, how exactly?
I'm trying to build a crate depended on chfft
and have this error:
error[E0308]: mismatched types
--> /Users/hombit/.cargo/registry/src/github.com-1ecc6299db9ec823/chfft-0.3.2/src/precompute_utils.rs:18:9
|
16 | pub fn calc_omega_item<T: Float + FloatConst>(len: usize, position: usize) -> Complex<T> {
| - this type parameter
17 | Complex::from_polar(
18 | &one(),
| ^^^^^^
| |
| expected type parameter `T`, found reference
| help: consider removing the borrow: `one()`
|
= note: expected type parameter `T`
found reference `&_`
= help: type parameters must be constrained to match other types
= note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters
error[E0308]: mismatched types
--> /Users/hombit/.cargo/registry/src/github.com-1ecc6299db9ec823/chfft-0.3.2/src/precompute_utils.rs:19:9
|
16 | pub fn calc_omega_item<T: Float + FloatConst>(len: usize, position: usize) -> Complex<T> {
| - this type parameter
...
19 | &(cast::<_, T>(-2.0).unwrap() * T::PI() / cast(len).unwrap() * cast(position).unwrap()),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| expected type parameter `T`, found `&T`
| help: consider removing the borrow: `(cast::<_, T>(-2.0).unwrap() * T::PI() / cast(len).unwrap() * cast(position).unwrap())`
|
= note: expected type parameter `T`
found reference `&T`
= help: type parameters must be constrained to match other types
= note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0308`.
error: could not compile `chfft`.
To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed
First of all, thanks for maintaining this crate, much appreciated!
Did you by any chance benchmark this crate against RustFFT or fourier? It looks like they also put some effort into optimizing it, so without benchmarks it is hard to judge if they are on a similar level.
Would also be intersting to benchmark against arrayfire::fft
or rgsl::fft
to see how pure Rust compares against other solutions.
If there are no benchmarks, maybe you can share what is unique / different about the approach taken in this implementation. Presumably there was a motivation to do something different then RustFFT?
As shown, LaTeX equations aren't being properly rendered (I've tried in Safari, Firefox and Chrome). You may want to follow the instructions here, which uses KaTeX and renders well
First of all, thanks for writing chfft, its great!
However since num 0.1.41 came out compiling chfft off master fails with:
error: the type of this value must be known in this context
--> src/rfft1d.rs:54:21
|
54 | (Complex::new(one(), zero()) + Complex::i() * w).scale(cast(0.5).unwrap())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: the type of this value must be known in this context
--> src/dct1d.rs:202:21
|
202 | (Complex::new(one(), zero()) + Complex::i() * w).scale(cast(0.5).unwrap())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: the type of this value must be known in this context
--> src/dct1d.rs:323:21
|
323 | (Complex::new(one(), zero()) - Complex::i() * w).scale(cast(0.5).unwrap())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error(s)
Apparently there was some regression in num_complex 0.1.41 which causes type inference / bounds checking to fail in this constellation...
An easy fix would be to lock num_complex at <=0.1.40.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.