{"id":18858380,"url":"https://github.com/stephenberry/efftw","last_synced_at":"2025-07-14T23:06:07.101Z","repository":{"id":191670938,"uuid":"684769057","full_name":"stephenberry/efftw","owner":"stephenberry","description":"Modern C++ FFTW Wrapper for Eigen library","archived":false,"fork":false,"pushed_at":"2024-10-15T20:39:36.000Z","size":35,"stargazers_count":7,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-03T07:32:28.365Z","etag":null,"topics":["cpp","eigen","eigen3","fftw","fftw3","fftw3-binding","header-only"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stephenberry.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-08-29T20:18:50.000Z","updated_at":"2025-04-13T02:43:47.000Z","dependencies_parsed_at":"2025-04-14T12:03:45.391Z","dependency_job_id":"b93be7e2-e22d-4b30-87d3-852df50da3e5","html_url":"https://github.com/stephenberry/efftw","commit_stats":null,"previous_names":["stephenberry/efftw"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/stephenberry/efftw","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephenberry%2Fefftw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephenberry%2Fefftw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephenberry%2Fefftw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephenberry%2Fefftw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stephenberry","download_url":"https://codeload.github.com/stephenberry/efftw/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephenberry%2Fefftw/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265365575,"owners_count":23753354,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","eigen","eigen3","fftw","fftw3","fftw3-binding","header-only"],"created_at":"2024-11-08T04:12:21.278Z","updated_at":"2025-07-14T23:06:07.080Z","avatar_url":"https://github.com/stephenberry.png","language":"C++","readme":"# Eigen-FFTW\n\u003e This repository is brand new and under heavy development!\n\nE-FFTW is a modern C++20 wrapper library around [FFTW](http://www.fftw.org) for [Eigen](https://eigen.tuxfamily.org/index.php?title=Main_Page).\n\n- Supports 1D and 2D FFTs\n- Single header file: `#include \"efftw/efftw.hpp\"`\n\n## Including\n\n```cmake\ninclude(FetchContent)\n\nFetchContent_Declare(\n  efftw\n  GIT_REPOSITORY https://github.com/stephenberry/efftw\n  GIT_TAG main\n  GIT_SHALLOW TRUE\n)\nFetchContent_MakeAvailable(efftw)\n\ntarget_link_libraries(${PROJECT_NAME} PRIVATE efftw::efftw)\n```\n\n\u003e  Note: FFTW and Eigen dependencies are not included or installed by linking to `efftw::efftw`\n\n## Example\n\n```c++\n#include \"efftw/efftw.hpp\"\n\nint main()\n{\n   // init_threads must be called before the library is used\n   efftw::init_threads(4); // set FFTW to use 4 threads\n\n   // build a complex matrix\n   Eigen::MatrixXcd mat(N, N);\n\n   std::mt19937_64 g{}; // random number generator\n   std::uniform_real_distribution\u003cdouble\u003e dist{0.0, 1.0};\n\n   for (size_t r = 0; r \u003c N; ++r) {\n      for (size_t c = 0; c \u003c N; ++c) {\n         mat(r, c) = { dist(g), dist(g) };\n      }\n   }\n   \n   efftw::f2 fft{mat}; // FFTW planning on construction (may be reused)\n   fft(); // compute the FFT of mat in place\n}\n```\n\n## API\n\n```c++\nusing namespace efftw;\n// classes\nf1{vec} // 1D forward FFT (not normalized)\nf2{mat} // 2D forward FFT\ni1{vec} // 1D inverse FFT (1/(rows) normalization)\ni2{mat} // 2D inverse FFT (1/(rows * cols) normalization)\n\n// functions\nshift1(vec) // 1D forward FFT shift\nshift2(mat) // 2D forward FFT shift\ninv_shift1(vec) // 1D inverse FFT shift\ninv_shift2(mat) // 2D inverse FFT shift\n```\n\n## Important!\n\nE-FFTW classes take references to Eigen types. Do not delete the matrix or resize it without rebuilding the EFFTW class.\n\nThe E-FFTW classes maintain the FFTW plan, which is deleted in the E-FFTW class destructors. The classes are used to keep the plan alive and allow the same matrix memory to be used multiple times. It is inefficient to rebuild the plan, but the plan needs to be rebuilt if the size of the matrix or vector changes.\n\n## Alias Type Deduction\n\n```c++\n// For clang, alias type deduction is not yet supported, so you will need to write:\nefftw::f2\u003cdecltype(mat)\u003e fft{mat};\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephenberry%2Fefftw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstephenberry%2Fefftw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephenberry%2Fefftw/lists"}