NAFPack is a Fortran-based numerical analysis package, offering a comprehensive set of algorithms for diverse numerical computations. These computations include Fast Fourier Transform, linear system solving, and eigenvalue/eigenvector calculations.
NAFPack incorporates the following numerical analysis algorithms:
-
Fast Fourier Transform (FFT): Implementation of the Cooley-Tukey FFT algorithm and integration with the FFTW library for signal processing and frequency domain analysis.
-
Linear System Solvers: Comprehensive implementations of various methods for solving linear systems, including Gaussian elimination, LU decomposition, and iterative methods like Gauss Seidel.
-
Eigenvalue and Eigenvector Computations: Algorithms designed to find eigenvalues and eigenvectors of matrices, such as the power iteration method and the QR algorithm.
Ensure you have CMake, FFTW, fpm and Fortran Compiler (e.g. gfortran) installed.
-
Linux (Debian/Ubuntu)
$ sudo apt-get update $ sudo apt-get install gfortran cmake pkg-config libfftw3-dev
# Install fpm $ curl -Lo fpm https://github.com/fortran-lang/fpm/releases/download/fpm-linux-x86_64 $ chmod +x fpm $ sudo mv fpm /usr/local/bin -
Windows (MSYS2)
Download and execute the MSYS2 installer, then update MSYS2 as explained on the site MSYS2
Note: All commands must be run from the MSYS2 MinGW terminal
- Build tools (gfortran, python, make, pkgconf, ...):
$ pacman -S mingw-w64-ucrt-x86_64-toolchain base-devel
- CMake:
$ pacman -S mingw-w64-ucrt-x86_64-cmake
- FFTW:
$ pacman -S mingw-w64-ucrt-x86_64-fftw
- fpm:
$ pacman -S mingw-w64-ucrt-x86_64-fpm
-
Create a
builddirectory:$ mkdir build && cd build
-
Run CMake to generate build files:
- Linux
$ cmake ..
- Windows
$ cmake -G "MSYS Makefiles" .. -
Compile the project with make :
$ make
-
Run the tests:
$ ctest
-
Build the project:
$ fpm build
-
Run the tests:
$ fpm test -
If you use conda environments with windows, you need to specify the path to the fftw library:
$ fpm test --link-flag "-L$env:CONDA_PREFIX/Library/bin"
-
To integrate NAFPack into your project, you can use the Fortran Package Manager fpm.
In your
fpm.tomlfile, add the following dependency:[dependencies] NAFPack = { git = "https://github.com/Minard-Jules/NAFPack.git" }
This project is licensed under the MIT License - see the LICENSE file for details.
- Minard Jules: Creator of the project.